Skip to content

cpu: saml21 initial commit#2849

Merged
haukepetersen merged 4 commits intoRIOT-OS:masterfrom
kaspar030:saml21
May 26, 2015
Merged

cpu: saml21 initial commit#2849
haukepetersen merged 4 commits intoRIOT-OS:masterfrom
kaspar030:saml21

Conversation

@kaspar030
Copy link
Copy Markdown
Contributor

basic port, uart, one timer, gpio, spi working.

Needs MCU support patch for openocd. [1]

My work on this port was mostly paid by FreshTemp, LLC. Thanks, guys!

[1] https://www.mail-archive.com/[email protected]/msg07241.html

@kaspar030 kaspar030 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Apr 22, 2015
@OlegHahm
Copy link
Copy Markdown
Member

+21,943 −0

Spammer! 😝

@kaspar030
Copy link
Copy Markdown
Contributor Author

have to top your codestyle commits somehow! ;)

@OlegHahm
Copy link
Copy Markdown
Member

By importing hundreds of vendor headers? j/k

@kaspar030
Copy link
Copy Markdown
Contributor Author

Is that an ACK? ;)

@OlegHahm
Copy link
Copy Markdown
Member

GitHub does not even allow me to review:

Sorry, we could not display the entire diff because it was too big.

(Best excuse ever...)

@kaspar030
Copy link
Copy Markdown
Contributor Author

If I'm the only one with that board, who's gonna review this?

@OlegHahm
Copy link
Copy Markdown
Member

Maybe at the Hack'n'ACK someone can review?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/arduino due/saml21-xpro/

@haukepetersen
Copy link
Copy Markdown
Contributor

ok, this PR is a bitch to review (too many large header files). Let's do the following: you fix the few comments I had and show me that the board is working and we merge this PR. Then we can fix any stuff that we find afterwards.

@OlegHahm OlegHahm modified the milestone: Release 2015.06 Apr 29, 2015
@kaspar030
Copy link
Copy Markdown
Contributor Author

  • accidently rebased
  • comments addressed

Somehow I can't get the PLL to clock the board with 48MHz. But I've set the speed to 16MHz, can we keep that for now?

@haukepetersen
Copy link
Copy Markdown
Contributor

Fine for now I guess. I have it on my list to look at the PLL stuff, maybe in the end of this week...

@kaspar030
Copy link
Copy Markdown
Contributor Author

@haukepetersen ping You've seen this working, right?

@OlegHahm
Copy link
Copy Markdown
Member

@haukepetersen has probably still >800 GItHub notifications. No chance to trigger him this way. ;)

@haukepetersen
Copy link
Copy Markdown
Contributor

Yes, I have seen this working. And there are still open comments above :-)

@kaspar030
Copy link
Copy Markdown
Contributor Author

@haukepetersen The leds are fine now. Anything else?

@kaspar030
Copy link
Copy Markdown
Contributor Author

Hm, follow-up PR's are coming. @OlegHahm, if I give you remote access, would you take a look?

@OlegHahm
Copy link
Copy Markdown
Member

Sure - will be difficult to test the leds though. ;)

@kaspar030
Copy link
Copy Markdown
Contributor Author

  • squashed

@haukepetersen
Copy link
Copy Markdown
Contributor

Then lets wait for Travis and merge!

@kaspar030 kaspar030 removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label May 18, 2015
@kaspar030
Copy link
Copy Markdown
Contributor Author

actually there's a problem with SPI at 16mhz, works fine with 4mhz. Its weird, because the formula for calculating the baudrate is so simple. I only tested initialization of ng_at86rf212b, maybe something is going too fast at 16mhz... Still I'd like to merge and find a solution an another PR.

@jnohlgard
Copy link
Copy Markdown
Member

The at86rf212b is picky with the timings between the bytes as well, not
just the baud rate. Check the data sheet for details on that.
On May 18, 2015 7:57 PM, "Kaspar Schleiser" [email protected]
wrote:

actually there's a problem with SPI at 16mhz, works fine with 4mhz. Its
weird, because the formula for calculating the baudrate is so simple. I
only tested initialization of ng_at86rf212b, maybe something is going too
fast at 16mhz... Still I'd like to merge and find a solution an another PR.


Reply to this email directly or view it on GitHub
#2849 (comment).

@OlegHahm
Copy link
Copy Markdown
Member

C++ header guards are missing in cpu/saml21/include/atmel/component

@kaspar030
Copy link
Copy Markdown
Contributor Author

C++ header guards are missing in cpu/saml21/include/atmel/component

I solved this by putting the #include of the first atmel header within #ifdef C++ in cpu-conf.h.
That way we don't have to change all the headers. They are not supposed to be included by anything other than cpu-conf.h.

@OlegHahm
Copy link
Copy Markdown
Member

Maybe you can modify the script, to exclude certain directories from the check? I just want to make sure, that the other Travis scripts are ran and show no errors.

@kaspar030
Copy link
Copy Markdown
Contributor Author

I'll take a look...

@kaspar030
Copy link
Copy Markdown
Contributor Author

  • added the atmel dirs to externc's ignore regex

@OlegHahm
Copy link
Copy Markdown
Member

Doesn't seem very scalable 😉, but will work for now and is out of scope for thie PR.

@kaspar030
Copy link
Copy Markdown
Contributor Author

@gebart Found it, it was spi_transfer_byte not waiting for receive to finish when in==null, causing the CS line to be dropped too early. I wonder why this works in the very similar samr21 implementation...

Will commit in a follow up, I'm tired of rebasing & squashing & waiting again for travis. :)

@OlegHahm
Copy link
Copy Markdown
Member

Somehow your last commit keeps on causing Travis to hang. I have no clue why.

@OlegHahm
Copy link
Copy Markdown
Member

Runs without problems on my laptop though, apart from

cpu/saml21/syscalls.c:233: style (unreadVariable): Variable 'c' is assigned a value that is never used.

Merge at will.

@kaspar030
Copy link
Copy Markdown
Contributor Author

Somehow your last commit keeps on causing Travis to hang. I have no clue why.

seems like cppcheck takes too long on the atmel headers... I'll add an exclude mechanism to cppcheck.

@kaspar030
Copy link
Copy Markdown
Contributor Author

  • rebased
  • exclude atmel headers also from cppcheck

@OlegHahm
Copy link
Copy Markdown
Member

cpu/saml21/periph/gpio.c:345: performance (redundantAssignment): Variable 'res' is reassigned a value before the old one has been used.

cpu/saml21/periph/uart.c:90: style (unreadVariable): Variable 'baud_calculated' is assigned a value that is never used.

cpu/saml21/syscalls.c:233: style (unreadVariable): Variable 'c' is assigned a value that is never used.

@OlegHahm
Copy link
Copy Markdown
Member

And most applications faill to build.

@kaspar030
Copy link
Copy Markdown
Contributor Author

@OlegHahm: adaption to the new THREAD_defines was missing. Compile-test works flawlessly now.

@kaspar030
Copy link
Copy Markdown
Contributor Author

We could save travis the work...

@kaspar030
Copy link
Copy Markdown
Contributor Author

@OlegHahm The syscalls will be dropped in a follow-up PR.

@haukepetersen
Copy link
Copy Markdown
Contributor

Compile tests work here as well. ACK and go.

haukepetersen added a commit that referenced this pull request May 26, 2015
cpu: saml21 initial commit
@haukepetersen haukepetersen merged commit 42f3812 into RIOT-OS:master May 26, 2015
@kaspar030 kaspar030 deleted the saml21 branch February 7, 2017 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants