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

ble_app_uart -> ble_nus_data_send -> error 5

Hi

I'm using example ble_app_uart with minor modified. Only add more log to debug.
Hardware nrf52840 DK. Latest SDK v17.0.2, s140.

Connect to mobile phone using nrf connect app.

nrf Connect can connect and send data to nrf52840 DK.

But from nrf52840 DK can't send back to the app. 
Got error code: 5 which is NRF_ERROR_NOT_FOUND

Can refer pictures below:



I debug further:

my m_conn_handle = 0x0000 , start from the connection.

during call:

err_code = ble_nus_data_send(&m_nus, data_array, &length, m_conn_handle); -> 

err_code = blcm_link_ctx_get(p_nus->p_link_ctx_storage, conn_handle, (void *) &p_client);


it said:

conn_id = BLE_CONN_STATE_MAX_CONNECTIONS


Please help how to solve this.

Thanks & Best Regards,

Rezan

Parents Reply
  • I don't see any obvious reasons for why you would be getting this error. Are you able to send the data if you it work if you comment the call to blcm_link_ctx_get() and ignore the  if(!p_client->is_notification_enabled) check in ble_nus_data_send()?

    Also, have you added any calls to ble_conn_state_init(); in your code? In that case, please remove it.

    Best regards,

    Vidar

Children
Related