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

SD GATT procedure (%d) failed

Background: SDK 16.0.0, SoftDevice 7.0.1, 1 ble_central connected 6 ble_peripheral, Send an instruction to 6 ble_peripherals every 50 milliseconds, at the same time, the ble_peripheral returns the response data to the ble_central . An error will be reported after running for a period of time, the error code is as follows. The screenshot below is the error generated within 15 hours, 11times / 15 hours.

Operation flow chart

NRF_LOG_ERROR("SD GATT procedure (%d) failed on connection handle %d with error: 0x%08X.", p_req->type, conn_handle, err_code);

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

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

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

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

Error Code as below.

/**@brief Function handles error codes returned by GATT requests.
 *
 * @param[in] p_req       Pointer to GATT request.
 * @param[in] err_code    Error code returned by SoftDevice.
 * @param[in] conn_handle Connection handle.
 */
__STATIC_INLINE void request_err_code_handle(nrf_ble_gq_req_t const * const p_req,
                                             uint16_t                       conn_handle,
                                             ret_code_t                     err_code)
{
    if (err_code == NRF_SUCCESS)
    {
        NRF_LOG_DEBUG("SD GATT procedure (%d) succeeded on connection handle: %d.",
                       p_req->type,
                       conn_handle);
    }
    else
    {
        NRF_LOG_ERROR("SD GATT procedure (%d) failed on connection handle %d with error: 0x%08X.",
                      p_req->type, conn_handle, err_code);
        if (p_req->error_handler.cb != NULL)
        {
             p_req->error_handler.cb(err_code, p_req->error_handler.p_ctx, conn_handle);
        }
    }
}

The length of a command or response is 11 bytes. sdk_config.h as below.

Thanks and Best regards!

John

Related