zephyr software timer cannot trigger periodically.

I am using the NRF54L05.When I was using the timer function of the Zephyr software, I created a timer with a 10ms cycle. After my system had been running for a long time (for example, 12 hours), after executing sys_reboot(SYS_REBOOT_COLD);, there was a probability of encountering a timer anomaly. It did not trigger as I expected; it only triggered once, and the next trigger time was much later;
相关代码使用:   
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 ));

I obtained the trigger count and the next time from the delay_timer through k_timer_status_get(&delay_timer) and k_timer_remaining_get(&delay_timer) respectively.The results I got were 1 and 11814496;

I can confirm that my clocks are all functioning properly, and my delay_work and threads are also running normally. I have no idea how to proceed to identify the problem;

Thank you very much for your help;
Parents
  • Hi,

    I have some follow up questions before we proceed:

    there was a probability

    What would you estimate this probability to be? How many times have you encountered this issue?

    Does this happen only when your system has run for 12h + and then right after sys_reboot(SYS_REBOOT_COLD) ?

    Have you encountered the issue using the timer with a different period?

    What is going on in your expiration function?

    Best regards,
    Benjamin

  • HI,

    Yesterday, I conducted a control experiment. Each group consisted of 5 devices. The periodic timer was initialized and started at the beginning of the main function. Then, a comparison was made with the previous usage method. After one day, all the devices in the control group failed, while all the devices in the experimental group were normal. Could this be related to the channel allocation of GRTC?

  • Hi,
    Sorry for the delay. That’s interesting, but I’m not sure I fully understand the differences. So in one group, the timer worked as expected? Could you share a clear list of what you did differently between the devices that failed and those that didn’t?

    Regards,
    Benjamin

Reply Children
Related