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

Running out of scheduler's queue size with app_timer

I've been experiencing this bug for a while now. What happens is that a app_timer's overflow handler can't put any more messages into the queue because the queue is full, which is surprising considering my queue size is 15.

I run two userspace timers using the app_timer module.

This is the function call order:

timeout_handler_exec() -> app_timer_evt_schedule() -> app_sched_event_put() -> app_sched_queue_full() == true -> next_index(index) == m_queue_size == 15

My APP_TIMER_OP_QUEUE_SIZE is 5 (not sure if this one matters), SCHED_QUEUE_SIZE is 15.

Now I'm just hoping that someone has run into this issue and solved it because I know that my explanation is lacking.

Parents
  • Hi Andrey,

    This is likely because you have some normal level code that is taking to much run time before getting back to app_sched_execute();

    For me this happened when I had long sequences of printf() strings.

    Also, it's not uncommon to need a schedule queue size of 30-40 when there is a lot of activity.

    In my case I added another call to app_sched_execute() in fputc() when the UART buffer was full.

    Simon.

  • i has run into this problem,i not use app_shedue_excute. APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false); . do you resolve this better way? tell me! thanks

Reply
  • i has run into this problem,i not use app_shedue_excute. APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false); . do you resolve this better way? tell me! thanks

Children
No Data