-
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/sam0: unified rtt configuration #14303
Conversation
I'll trigger a build to see there is some conflict and the fix the changes requested |
Murdock is reasonably happy. |
cpu/sam0_common/periph/rtt.c
Outdated
#define RTC_MODE0_PRESCALER \ | ||
(__builtin_ctz(RTT_CLOCK_FREQUENCY / RTT_FREQUENCY) << \ | ||
RTC_MODE0_CTRLA_PRESCALER_Pos) | ||
#else | ||
#define RTC_MODE0_PRESCALER \ | ||
(__builtin_ctz(RTT_CLOCK_FREQUENCY / RTT_FREQUENCY) << \ | ||
RTC_MODE0_CTRL_PRESCALER_Pos) |
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.
Tested on iotlab for samr30-xpro
and figure out there is a difference between samd21
and saml21
I'll add a patch.
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.
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.
Same applies for the other sub-families with CTRLA
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.
c11dcf7 addresses this
Tested on IOTLAB_NODE=samr30-2.saclay.iot-lab.info BOARD=samr30-xpro make -C tests/periph_rtt flash test --no-print-directory -j3
CFLAGS+=-DRTT_FREQUENCY=1024 IOTLAB_NODE=samr30-3.saclay.iot-lab.info BOARD=samr30-xpro make -C tests/periph_rtt flash test make: Entering directory '/home/francisco/workspace/RIOT/tests/periph_rtt'
|
@benpicco do you think you could test on |
Works as expected same54-xpro
saml10-xpro
Please squash! |
d375f7b
to
ff24aa6
Compare
@benpicco all green here! |
Thanks for reviewing and testing @benpicco! |
Contribution description
This PR is split from #13874. It unifies
rtt
configuration forsam0
and make theRTT_FREQYENCY
configurable.As in #13874 max and min values for the RTT are documented.
I've notices that
RT&DEV
are unused here, but I would rather remove in a follow up. I did removeRTT_IRQ_PRIORITY
since it was unused and misleading.Testing procedure
Test for one board of every subfamily
i don't have any board of the other 3 ATM, maybe @benpicco @dylad can help?
tests/periph_rtt
should still pass onsam0
boards with different frequenciesBOARD=samr21-xpro make -C tests/periph_rtt flash test --no-print-directory -j3
CFLAGS+=-DRTT_FREQUENCY=1024 BOARD=samr21-xpro make -C tests/periph_rtt clean flash test --no-print-directory -j3
Issues/PRs references