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

Got NRF_FAULT_ID_SD_ASSERT on S130 while doing sd_ble_gatts_hvx

When I repeatedly (>290 times) send the same notification to the connected host via sd_ble_gatts_hvx, I get a sd_assertion:

Fault identifier:  0x1
Program counter:   0x104FA
Fault information: 0x0
Fault identifier:  0x1
Program counter:   0x14D98
Fault information: 0x0

The payload is 10 bytes long, using S130 with SDK 12.1 on the PCA10028. sd_ble_tx_packet_count_get always returns 7 and the event BLE_EVT_TX_COMPLETE comes after every notification. I am trying to notify repeatedly a sensor reading to a connected host. The assertion sometimes comes after less readings or more. Can anybody give me a hint on that?

Here is the EmBlitz project: notifytest.zip

Here the Android host project: bluenodes.apk

The oscillogram showing disable_irq/enable_irq activities: image description

  • Are you checking the returned error of sd_ble_gatts_hvx() with APP_ERROR_CHECK()? Have you defined DEBUG as a preprocessor symbol? Try putting a breakpoint in app_error_handler() and see what the line number, file name and error code is.

  • Yes I check errors and everything works fine until the assert. After these faults, the sd_ble_gatts_hvk starts to complain too:

    Fault identifier:  0x4001
    Program counter:   0x0
    Fault information: 0x20007E2C
    Line Number: 178
    File Name:   Src\rbc_mesh\src\mesh_gatt.c
    Error Code:  0x4
    

    This is the line where I check the return code:

    err_code = sd_ble_gatts_hvx(m_active_conn_handle, &hvx_params);
    APP_ERROR_CHECK(err_code);
    
  • So you are working with nRF OpenMesh? Could you explain a bit more about what you are doing with it? Do you always get the SoftDevice assert after 290 notifications? It seems you have printed two different SoftDevice asserts? Why? Are you continuing after you get the assert?

  • Yes you are right with OpenMesh. For the test the mesh only consists of 1 node. A host is connected for testing purposes, I dump adc measurements every second to the host using a notification. The mesh doesn't play a role while doing this. The sd assert comes via the app_error_fault_handler and not via sd_assert_handler which I expected. The app_error_fault_handler doesn't go into the error_loop, so other errors may occur. The value is sent via

     err_code = rbc_mesh_value_set(characteristic, tx_buffer, length);
    ...
    mesh_gatt_evt_push(mesh_gatt_evt_t* p_gatt_evt)
    {
    ...
    sd_ble_gatts_hvx(m_active_conn_handle, &hvx_params);
    }
    

    The assert comes at undefined times of sent packages. 290 times was a good sequence, it also occurs much earlier.

  • Could you try the following code for me:

    err_code = sd_ble_gatts_hvx(m_active_conn_handle, &hvx_params);
    if(err_code == BLE_ERROR_NO_TX_PACKETS)
    {
        APP_ERROR_CHECK(err_code); //Breakpoint here.
    }
    APP_ERROR_CHECK(err_code);
    

    Put a breakpoint in the if, and see if you hit it.

Related