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

ble stack overflow

I'm using SDK v 12.2 project ble_central/ble_app_uart_c using GCC

After running the project for awhile a stack overflow in the ble_stack_thread() is detected which eventually crashes the scheduler (using FreeRTOS)

Is there anything I can do to resolved this?

static void ble_stack_thread(void * arg){
uint32_t err_code;

UNUSED_PARAMETER(arg);
timers_init();
application_timers_start();

// uart_init();
db_discovery_init();
ble_stack_init();
nus_c_init();

// Start scanning for peripherals and initiate connection
// with devices that advertise NUS UUID.
scan_start();

while (1)
{
    /* Wait for event from SoftDevice */
    while (pdFALSE == xSemaphoreTake(m_ble_event_ready, portMAX_DELAY))
    {
        // Just wait again in the case when INCLUDE_vTaskSuspend is not enabled
    }

    // This function gets events from the SoftDevice and processes them by calling the function
    // registered by softdevice_ble_evt_handler_set during stack initialization.
    // In this code ble_evt_dispatch would be called for every event found.
    intern_softdevice_events_execute();
}

}

Related