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

ble_nus_data_send error

Hi, 

Recently, I've found a reset issue with my device by ble_nus_data_send error when ble is working.

But the error code is 0x3401(Please, refer the picture). What does that mean? Is there any other header with the definitions than nrf_error.h?

Before handling the error, I need to understand why that error happened and what kind of errors it is.

Thank you.

[code for ble_nus_data_send]

    if(m_conn_handle != BLE_CONN_HANDLE_INVALID)
    {
        // uint32_t err_code;
        do
        {
            err_code_test = ble_nus_data_send(&m_nusdata_array, &lengthm_conn_handle);
            if((err_code_test != NRF_ERROR_INVALID_STATE) &&
               (err_code_test != NRF_ERROR_RESOURCES) &&
               (err_code_test != NRF_ERROR_NOT_FOUND))
            {
                APP_ERROR_CHECK(err_code_test);
            }
        } while(err_code_test == NRF_ERROR_RESOURCES && block);
    }
[exception call stack captured]
Parents Reply Children
  • Hi,

    eleven-x_devteam said:
    But You mean putting sd_ble_gatts_sys_attr_set in the  BLE_GAP_EVT_CONNECTED case of ble evt handler like the code below?

    Yes. This is just to set it as early as possible.

    eleven-x_devteam said:
    I found these 2 posts below about the errors and I filtered out the errors so that the device will not be reset by app error check and it seems the issues were fixed. Does it also make sense?

    I am not sure how this is relevant, but this post provided a viable solution, as long as you are happy with the ble_nus_data_send() call failing silently and you set the system attributes later. The key is that this will fail until the system attributes is set, and you can handle it in several different ways.

Related