-
Notifications
You must be signed in to change notification settings - Fork 7.4k
system clock problem on NRF52 boards #11694
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
More information that may be relevant:
|
I have been trying to get OpenThread working on an nRF52840 dongle in the last days (I actually have a few pending patches to submit for it), and I have encountered this issue. Basically the network stops working after some time, but a few things like USB, and shell keep running. The other hand a simple thread toggling a led like in the blinky sample also stops executing at the same time the network stops working. I have first thought the problem was more or less random, but I have just checked the logs, and they always stop around 8:32:00. I guess PR #11627 might be (at least partially) a workaround for the same issue. |
I don't think #11627 is due to the same issue, though there may be another clock issue that causes it (I'm not at all convinced k_busy_wait() being wildly inaccurate is isolated to Nordic hardware; that's just what I use). Before reporting I tried reverting that patch and there was no change. There's no direct evidence that the system clock is running at the wrong rate, just that it doesn't handle overflow of the underlying timer correctly. (NB: Original report and comment edited to replace |
Yes, in confirm that in my case, the problem happens in around 8 minutes, not 8 hours. |
In my case |
Two subtractions failed to account for the possibility that a calculated time exceeded the counter resolution, allowing a comparison to improperly indicate that a minimum delay was satisfied. Use the subtraction helper to avoid the problem. (The subtraction in z_clock_set_timeout was the cause of issue zephyrproject-rtos#11694; the one in rtc1_nrf5_isr was replaced based on inspection rather than testing.) Closes zephyrproject-rtos#11694 Signed-off-by: Peter A. Bigot <[email protected]>
Two subtractions failed to account for the possibility that a calculated time exceeded the counter resolution, allowing a comparison to improperly indicate that a minimum delay was satisfied. Use the subtraction helper to avoid the problem. (The subtraction in z_clock_set_timeout was the cause of issue zephyrproject-rtos#11694; the one in rtc1_nrf5_isr was replaced based on inspection rather than testing.) Closes zephyrproject-rtos#11694 Signed-off-by: Peter A. Bigot <[email protected]>
I'm running a multi-sensor application on the pca20020 (Thingy:52), with a periodic display of data to UART. I've driven the display both in a loop with a k_sleep, and with a k_timer. In both cases, the display stops after eight and a half minutes. This happens to correspond to the 24-bit wraparound of a Nordic RTC running at 32 KiHz (8:32.000 = 512 s = 2^24 ticks) . Which is suspicious.
Display of the sensor data, driven by interrupts, continues.
May be related to #9904 and/or PR #10556.
The text was updated successfully, but these errors were encountered: