nrf_ble_gq: SD GATT procedure (1) failed on connection handle 0 with error: 0x00000013.

NRF52840

S140

App based on ble_app_multilink_central.

I have tried to build a bridge between BLE peripheral and PC.

I have spend so many time on PC side app.

The problem is the COM port will close in the middle if there are many packets to send.I didn't think of MCU side problem,after many failure I thought of checking NRF52840,it did trigger the error in the title and reset. That close the com connection,and the com port gets ready soon before I can notice it.

I have browsered the devzone,and found many post mang years ago.

This is the solution:

//From
if (err_code == NRF_ERROR_BUSY) // Softdevice is processing another GATT request.
{
    NRF_LOG_DEBUG("SD is currently busy. The GATT request procedure will be attempted \
                          again later.");
}
//to
if (err_code == NRF_ERROR_BUSY) || (err_code == NRF_ERROR_RESOURCES) // Softdevice is processing another GATT request.
{
    NRF_LOG_DEBUG("SD is currently busy. The GATT request procedure will be attempted \
                again later.");
}

I don't want to change the SD code, it is not easy to maintain.Can I check first and then try to write? or Just not to reset system, ignore the data?

Thank you

  • Hello,

    To eliminate this problem without patching the SDK source file, I'm afraid the only option is to not use the BLE GATT Queue module for these requests and instead handle them in your application. Alternatively you can try to mitigate the problem by increasing the Softdevice queue size for GATT notifications and write commands in ble_stack_init() (write_cmd_tx_queue_size, hvn_tx_queue_size). 

    Best regards,

    Vidar

Related