Adding a 3rd BLE characteristic to BLE service causes fatal error in Release mode

Hello,

I'm trying to add a third characteristic to my BLE service and when I add it, my device "fatally" crashes in Release mode with no meaningful error information (because it's in release mode). The device works perfectly in DEBUG mode.

In debug mode: Enter a static passkey, bond, and connect with no problems

In release mode: enter a static passkey, bond, connect, and crash

Here is a short log from my latest attempt:

<info> app_timer: RTC: initialized.
<info> app: startup event = 0
<info> app: started.
<info> app: DELETE BONDS
<info> app: Erase bonds!
<info> app: pm_evt_handler: 12
<info> app: Fast advertising.
<info> app: ble_evt_handler: 16
<info> app: Attempting Connection...
<info> app: ble_evt_handler: 85
<info> app: ble_evt_handler: 35
<info> app: pm_evt_handler: 1
<info> app: pm_evt_handler: 5
<info> app: ble_evt_handler: 19
<info> app: ble_evt_handler: 36
<info> app: ble_evt_handler: 21
<info> app: on_write: called
<info> app: ble_evt_handler: 80
<info> app: ble_evt_handler: 18
<info> app: ble_evt_handler: 26
<info> app: pm_evt_handler: 2
<info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1.
<info> app: ble_evt_handler: 25
<info> app: Connected.
<error> app: Fatal error
<warning> app: System reset
<info> app_timer: RTC: initialized.
<info> app: startup event = 0
<info> app: started.
<info> app: DELETE BONDS
<info> app: Erase bonds!
<info> app: pm_evt_handler: 12
<info> app: Fast advertising.

So, it seems to fail somewhere in here:

case BLE_GAP_EVT_AUTH_STATUS:
if(p_ble_evt->evt.gap_evt.params.auth_status.auth_status == BLE_GAP_SEC_STATUS_SUCCESS)
{
NRF_LOG_INFO("Connected.");
err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
APP_ERROR_CHECK(err_code);
err_code = nrf_ble_qwr_conn_handle_assign(&m_qwr, m_conn_handle);
APP_ERROR_CHECK(err_code);
}

Any help would be appreciated.

Thank you!

Nick

Parents
  • Very odd. Have you tried to simply modify app_error_fault_handler() such that you can get the actual file name, line number and error code causing the assert instead of NRF_LOG_ERROR("Fatal error"); 

    To swap the logging output behavior simply replace: #ifndef DEBUG with #ifdef DEBUG two places in app_error_fault_handler().

    Best regards,
    Kenneth

Reply Children
Related