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

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 Reply Children
  • Thank you Kenneth for your help but I solved my problem. So, I have my files service.c and service.h inside of my project directory. After compilation, these files got copied over into my Output directory and Segger Studio actually changed the reference directory of service.h to the file in the output directory. So, whenever I compiled in Release mode, it would take the files directly in the Output directory (the edited service.h would get replaced with the original unedited file in my main project directory) and provide me with no bluetooth characteristic handle for my 3rd characteristic.

    I was able to come to this conclusion by having my service.h file up, and I right-clicked and opened something in my main that references the service.h file. After opening the reference, I found that Segger Studio opened another service.h next to the preexisting service.h file I had open in the application.

Related