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
use RTC as system clock for CC13X2/CC26X2 #19232
Conversation
Add RTC timer driver for CC13X2/CC26X2, and use it instead of systick as system clock. It is necessary to use this timer for power management support, so that the system can exit from deep sleep upon expiry of timeouts. Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
The RTC on TI CC13X2/CC26X2 is a 32 KHz clock for which the minimum compare delay is 3 ticks. When using it as the system clock, we need to relax the upper bound to ensure the test succeeds. Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Given the RTC is used for system clock, we need to plug its interrupt to avoid an exception that would occur if it is left unhandled. Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
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.
Driver looks pretty good to me. One nitpick about initialization state, which is fine as long as the reset process guarantees the counter value.
@galak Not sure why the checks are not finishing... |
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
Adding @vanti as an owner. Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Thanks for the help! |
The SPI peripheral should be configured using the CPU clock speed and not the system clock speed. This used to be fine because they were the same before zephyrproject-rtos#19232, but now that the system clock is RTC-based (which has a different frequency), we can no longer make that assumption. Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
The SPI peripheral should be configured using the CPU clock speed and not the system clock speed. This used to be fine because they were the same before #19232, but now that the system clock is RTC-based (which has a different frequency), we can no longer make that assumption. Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
The I2C peripheral should be configured using the CPU clock frequency and not the system clock frequency. This used to be fine because they were the same before zephyrproject-rtos#19232, but now that the system clock is RTC-based (which has a different frequency), we can no longer make that assumption. Fixes zephyrproject-rtos#20480 Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
The I2C peripheral should be configured using the CPU clock frequency and not the system clock frequency. This used to be fine because they were the same before #19232, but now that the system clock is RTC-based (which has a different frequency), we can no longer make that assumption. Fixes #20480 Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Add RTC timer driver for CC13X2/CC26X2, and use it instead of systick
as system clock. It is necessary to use this timer for power
management support, so that the system can exit from deep sleep upon
expiry of timeouts.
A couple of tests also need to be adjusted as a result of using this timer.