Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

APP_TIMER_KEEPS_RTC_ACTIVE SDK15.0 rtc does not start unless at least 1(one) timer is active

APP_TIMER_KEEPS_RTC_ACTIVE SDK15.0 rtc does not start unless  at least 1(one) timer is active

I have set APP_TIMER_KEEPS_RTC_ACTIVE=1

And I want to use the app_timer module for some basic timestamping.

app_timer_init();
...
// failure here
uint32_t cnt = app_timer_cnt_get(); // cnt is always 0(zero) as RTC is not running

...
// WORKAROUND
app_timer_resume(); // starts RTC regardles not calling app_timer_pause()
// expected behaviour then
cnt = app_timer_cnt_get(); // cnt is is filled by some expected nonzero values
   

Above code shows the bug in the current SDK 15.0.

The workaround is to call app_timer_resume(); that will start RTC regardlesly.

I don't know the situation in other SDK version.

I use the option to have a monotonic upcounter like systick but without many interrupts and without wasting other timer.

@nordic please fix the bug.

regards, Adib.

--

Related