I am seeing a problem identical to what's described in this question. I'm using SDK version 10.
My timers work fine for a while, but then suddenly and seemingly at random all timers expire the instant they are started. Sometimes it goes away and the timers work again, but sometimes the only fix seems to be a restart.
I've seen two suggested solutions. One is to add a delay or a call to rtc1_compare0_set in compare_reg_update; I'm on SDK 10 and both solutions are already there:
rtc1_compare0_set(rtc1_counter_get()); // this should prevent CC to fire again in the background while the code is in RTC-ISR
The only other solution I've found on the forum is to have a dummy timer that is always running. It's recommended in this answer.
Sadly, I do already have a dummy timer always running—I've been using it to force the RTC to stay on so I can use it for timekeeping.
Are there any other known problems or solutions with app_timer? I'm running out of ideas. Thanks!
When the RTC jumps like that and a timer gets scheduled, the timer's ticks_to_expire gets set to 0 in list_insertions_handler because the counter is so far ahead of m_ticks_latest.
Then, in timer…
Here I'm checking to see if p_timer is NULL, which signifies that we've processed the whole list of timers. If we've done so, we add ticks_elapsed to ticks_expired so that the new total ti…
I think there may also be something incorrect happening in list_insertions_handler. If no timer has expired for more than half of the RTC duration then m_ticks_latest won't have been updated during this…
Actually I don't understand your problem, but again - why do you already use dummy timer? I also use RTC to keep the time, but I don't use any tricks to keep it alive... Also, are you using scheduler? Maybe scheduler queue is too small?
I'm just using a dummy timer for now. I'm not using a scheduler.
is it possible for me to get the project and see it ? It would be easier for me to debug it.
It's proprietary software and it's running on a custom board. I'm not sure if I can send it to you, sadly, and I also don't know how you'd be able to run it. Is there anything else I could look at? Have you heard of this before?
i havent heard of this on SDK10, that is why it interests me so much. If you open a support ticket on my page, then i can assign it to myself and then i am bound to NDA, in that case you can send your project and custom board and I am bound to NDA automatically. I would like to help you, but first I need to see it myself.