I'm running a BLE Free rtos example code with the UART service example code.
I noticed that after 3-5 minutues of advertising the BLE service it stop advertising...I'm guessing a crash. Any ideas why ? How would one debug this kind of issue. thanks,
Below is the ble thread, pretty much just stock code from the SDK.
static void ble_stack_thread(void * arg)
{
uint32_t err_code;
bool erase_bonds;
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
ble_stack_init();
gap_params_init();
services_init();
advertising_init();
conn_params_init();
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
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();
}
}
static uint32_t ble_new_event_handler(void)
{
BaseType_t yield_req = pdFALSE;
// The returned value may be safely ignored, if error is returned it only means that
// the semaphore is already given (raised).
UNUSED_VARIABLE(xSemaphoreGiveFromISR(m_ble_event_ready, &yield_req));
portYIELD_FROM_ISR(yield_req);
return NRF_SUCCESS;
}