FRAME_INTVAL_UINT 10 // 毫秒 k_timer_init (& delay_timer ,delay_timer_handler ,NULL ); k_timer_start (& delay_timer ,K_MSEC ((uint32_t )FRAME_INTVAL_UINT ), K_MSEC ((uint32_t )FRAME_INTVAL_UINT ));
FRAME_INTVAL_UINT 10 // 毫秒 k_timer_init (& delay_timer ,delay_timer_handler ,NULL ); k_timer_start (& delay_timer ,K_MSEC ((uint32_t )FRAME_INTVAL_UINT ), K_MSEC ((uint32_t )FRAME_INTVAL_UINT ));
Thanks. Do you have to wait exactly 12 hours? Try doing the soft reset sooner to see if it changes anything. Also, a soft reset doesn’t clear the GRTC register, but a watchdog timer reset does. Can you check if the issue still occurs after a watchdog timer reset? It would also be helpful if you print the timer values right before and after the resets.
Thanks. Do you have to wait exactly 12 hours? Try doing the soft reset sooner to see if it changes anything. Also, a soft reset doesn’t clear the GRTC register, but a watchdog timer reset does. Can you check if the issue still occurs after a watchdog timer reset? It would also be helpful if you print the timer values right before and after the resets.
HI,
This duration might not be exactly 12 hours; it could be shorter. However, I haven't attempted it yet.
Thaks for the heads up,I tried to clear the GRTC register before the soft reset, and this problem no longer occurred.
So, can you roughly figure out what caused this problem of mine?
Is there any other better way to solve the problem during the program initialization?
bool app_device_researt(void) {
nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_STOP);
nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_CLEAR);
NVIC_SystemReset();
return true;
}
That is good new! There was a bug in drivers/timer/nrf_grtc_timer.c, and it looks like this PR fixed the issue you are seeing. You may want to upgrade to a newer NCS version, or keep your current solution if it is working for you.
Regards,
Benjamin
To be honest, I also want to upgrade to the new NCS version. However, I need to use ANT+, and for now I can only develop it in version 2.9.2. I'm looking forward to future updates from Garmin.