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

packet_buffer_reserve() causes fault during long term test

Hi teams,

I am developing with Mesh SDK 4.0.0, and suffers from random fault during long-term test.

The last readable callstack position is the below.

NRF_MESH_ASSERT(m_get_packet(p_buffer, p_buffer->head)->packet_state !=
                    PACKET_BUFFER_MEM_STATE_RESERVED);

The callstack is QDEC_IRQHandler() -> bearer_event_handler() -> flag_event_cb() -> fire_timers() -> iv_update_timer_handler() -> iv_update_timeout_counter_store() -> mesh_config_entry_set() -> entry_store() -> dirty_entries_process() -> mesh_config_backend_store() -> mesh_config_backend_record_write() -> flash_manager_entry_alloc() -> reserve_action_buffer() -> packet_buffer_reserve()

This device is heavily loaded to send some data gathered from mesh network to local ethernet.

I am not sure exactly what kind of exception happens because I am not so familiar to SEGGER embedded studio.

Can someone explain what is the above error, and give some advice how to debug it?

Parents
  • Nordic bug: When a task calls packet_buffer_reserve() then packet_buffer_commit(),
    if a timer ISR fires between those two task calls, and that ISR does the same thing
    i.e. calls packet_buffer_reserve() then packet_buffer_commit(), then the ISR will assert,
    because the main task has not yet advanced p_buffer->head, so the head block is already reserved.

  • For example, if the normal task calls mesh_gatt_packet_alloc(), and then before this
    task calls mesh_gatt_packet_send(), a timer fires and the ISR callback calls proxy.c->
    gatt_evt_handler->beacon_cycle_send->beacon_packet_send->packet_alloc->mesh_gatt_packet_alloc,
    since both mesh_gatt_packet_alloc() instances call packet_buffer_reserve() with the
    same packet buffer, the ISR will assert because the head is still in the reserved state.

Reply
  • For example, if the normal task calls mesh_gatt_packet_alloc(), and then before this
    task calls mesh_gatt_packet_send(), a timer fires and the ISR callback calls proxy.c->
    gatt_evt_handler->beacon_cycle_send->beacon_packet_send->packet_alloc->mesh_gatt_packet_alloc,
    since both mesh_gatt_packet_alloc() instances call packet_buffer_reserve() with the
    same packet buffer, the ISR will assert because the head is still in the reserved state.

Children
No Data
Related