-
Notifications
You must be signed in to change notification settings - Fork 7.4k
nrf timers unstable with ticks faster than 100 Hz #12542
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
Comments
FYI: @carlescufi |
The test application referenced has a timer in the main thread that wakes at 1 Hz, captures some clock information, and queues a Some of the instability and unexpected behavior appears to be due to This is an unreported issue with timeslicing (@andyross), and can eliminating by turning that feature off. The rest of the instability is due to edge conditions in the nrf_rtc_timer code, in particular that the minimum delay required to guarantee a compare event is not met when ticks-per-sec is greater than 1024. Those issues are addressed in #12605. With that patch applied |
These issues appear to be resolved after various timer improvements in the last couple months. pca10028 running my test application uses 32 KiHz ticks and no longer displays bursts of interrupts that do not correlated to application demands. |
Uh oh!
There was an error while loading. Please reload this page.
I have a test application that uses
k_timer
to wake every 10 seconds and display information about elapsed time differences betweenk_uptime_get()
andk_cycle_get()
. It operates correctly with the default 100 ticks per second.Increasing to 1000 ticks per second the system appears to work, but instrumentation shows that the timer ISR is actually firing every 5.855 ms. Other values greater than 200 show the same behavior, with different intervals that are ticks-per-second dependent but generally on the order of 5-12 ms.
Increasing to 32768 ticks per second (supposedly the workaround to enable high-resolution alarms) the
k_timer
handler is never called and the ISR shows a burst of about 8 wakeups at 11 ms intervals followed by silence. Presumably the counter got set to an offset too small to guarantee a wakeup and the first callback will be in 512 s when the counter wraps.The text was updated successfully, but these errors were encountered: