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

Light Switch Client stop due to ++m_scheduler.event_count < 0?

I am working on nrf5_SDK_for_Mesh_v2.2.0 with nRF5_SDK_15.0.0 and softdevice 6.0.0. I run code on PCA10040 dev boards. I am trying use a timer to send onoff message from a client to two servers. but the client stopped after 2 hrs, it returns an error "Mesh assert at 0x0002C860". I use addr2line tool to check where it happened, and found it happened in mesh/core/src/timmer_scheduler.c:91 which calls NRF_MESH_ASSERT(++m.scheduler.event_count > 0)

in this case, the client sends the message every 50ms, and I set the APP_CONFIG_ONOFF_DELAY_MS and APP_CONFIG_ONOFF_TRANSITION_TIME_MS to 0.

is there any limitation on the sending speed side? if not what may cause this problem?

Parents
  • I just discovered this issue myself, and out of curiosity, I searched to see if anyone else has reported it.

    I can add a clarification to the provided solution: since the count is incremented when an event is added to the queue, so too must the count be decremented when an event is removed from the queue. There are 2 places that events can be removed from the scheduler queue: in fire_timers and in remove_evt. I copied the decrement instruction from fire_timers and inserted it in remove_evt before line 108:

    if (p_it->p_next == p_evt)
    {
        NRF_MESH_ASSERT(m_scheduler.event_count-- > 0); //ATTENTION: unofficial modification
        p_it->p_next = p_evt->p_next;
        break;
    }

Reply
  • I just discovered this issue myself, and out of curiosity, I searched to see if anyone else has reported it.

    I can add a clarification to the provided solution: since the count is incremented when an event is added to the queue, so too must the count be decremented when an event is removed from the queue. There are 2 places that events can be removed from the scheduler queue: in fire_timers and in remove_evt. I copied the decrement instruction from fire_timers and inserted it in remove_evt before line 108:

    if (p_it->p_next == p_evt)
    {
        NRF_MESH_ASSERT(m_scheduler.event_count-- > 0); //ATTENTION: unofficial modification
        p_it->p_next = p_evt->p_next;
        break;
    }

Children
No Data
Related