-
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
cpu/samd21: fix NVM wait states #6875
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow. Good catch! The change loos good to me, and I guess (hope) you've tested it.
But I'm a bit puzzled. The old code was starting/stopping the APBA(!) clock for the SYSCTRL, leaving the SYSCTRL stopped. So, how could it have worked???
Unfortunately I don't own SAMR21-Xpro board so I cannot test it. I was looking in this file for my SAMD20-Xpro port to RIOT. Maybe no one ever try to get a CORECLOCK > 24 Mhz ? But I agree with you, this is weird. |
My Autonomo board runs at 48MHz. I will try to test it on it. |
Many thanks @keestux ! |
It's good that I tested it. The patch is not OK :-) But the original code is wrong too. It just happened to be somewhat harmless. Let's look at the code once more.
Given the code above there are three things mixed up. The define Now, there is also an enable for the
Digging a little deeper in ASF, there is a
I've tried it with hello world and can confirm that it still works. |
Thank you for the time you spent on it @keestux. |
Can you squash the two commits? |
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
be3cb62
to
2b1a1e7
Compare
Squashed. |
ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proxying @keestux's ACK
All green. Merging. Should this one be backported ? |
While looking in cpu/samd21 I found a small bug. See commit.
Moreover, I've noticed another bug but I don't know how to fix it. I opened an issue because it also related to Atmel CMSIS see #6874
Cheers !