This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

timer timeout issues

I'm using an NRF51822 with soft device s110 version 7.1.0 and I'm having timer-related issues.

I create 1 periodic timer and 6 non-periodic (single shot) timers with app_timer_create. The periodic timer handler starts the other timers at different moments and each non-periodic timer's handler triggers it to restart with a different period and does that a certain number of times.

The problem is that some time, one non-periodic timer times out too soon (around 1 or 2 ms instead of 180 ms) and I have no clue why.

APP_TIMER_MAX_TIMERS is set to 15 and APP_TIMER_OP_QUEUE_SIZE to 20. I tried to increase both of them without any result. I checked app_timer_start and timer_start_op_schedule and everything looks in order (timeout_ticks, timeout_periodic, ticks_at_start, ticks_first_interval etc. are set up properly for that timer's period). I tried creating only the periodic timer and this specific non-periodic timer, and in that case the non-periodic timer times out correctly. So the problem only happens when the other timers are also running.

Thank you.

Related