-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAMD21: possible CMSIS bug ? #6874
Comments
Hmm. I vaguely remember that I brought this up in the SAMR21 versus SAMD21 discussion. But not only that, there are some differences in the Generic Clock Selection ID. It's one of the very few areas where we have to apply #ifdef's and select alternative code for either SAMD21 or SAMR21. |
Aaaw, ok. |
Indeed, the latest SAMD21 datasheet (Rev N) and the include files (up to ASF 3.34) don't match. I also have an older datasheet (Rev E) which matches the ASF include files. If the Rev N. datasheet is correct then Atmel forgot to update ASF. |
In that case, what would be the best solution to integrate this change ? |
I don't have a straightforward answer. There is no define for the last ID. Would it hurt to set the clock for "reserved" ID's? If not we could initialize up to 0x3F. But I do think that |
BTW, I'm sure there is a historical reason, but why samr21 is define as part of |
O shit. I now see that
It's a long story. First there was support for SAMR21 (board samr21-xpro) and it was done "using" |
Thanks @keestux for the story ! @haukepetersen @keestux what can we do about that ? |
Let's see: the cleanest solution would be to move the So for a quick solution, I would propose the following:
|
I think we can keep samr21 and samd21 chip under the same tree and use some ifdef for the small differences. |
:-) |
@haukepetersen Yes, I agree with your suggestion to introduce a new variable.
But that requires us to create a define like
Or, in
|
Before we do anything it may be good to look at all the variables we have today, like, CPU, CPU_MODEL, CPU_FAM. I'm losing track of what is used for what. in
in
Why do we have |
Have a look at my
|
Maybe we should also think to get the CPU variant. |
Shall we close this issue? There is no activity for two years, and I think we have a working solution right now. |
Hello,
I've noticed a possible bug in cpu/samd21/cpu.c file
Here, code disables all periphs clock. And it stops at 0x22. If we take a quick look in SAMD21 datasheet (Table 15.5 page 131-132) the last periph clock ID is 0x26.
Moreover, if we now take a look at Atmel CMSIS (cpu/sam0_common/include/vendor/samd21/include/component/gclk.h)
The last periph ID is 0x24 (and doesn't take into account the two blank lines from SAMD21 datasheet).
What do you think ?
The text was updated successfully, but these errors were encountered: