Hi,
We are attempting to send data via BLE every 100 ms using an app_timer. The app_timer sets a flag and in the while loop in main.c we call
ret_code_t err_code;
do
{
uint16_t length = (uint16_t)len;
err_code = ble_nus_data_send(&m_nus, msg, &length, m_conn_handle);
//SEGGER_RTT_WriteString(0, "Sending data\n");
if ( (err_code != NRF_ERROR_INVALID_STATE) && (err_code != NRF_ERROR_BUSY) &&
(err_code != NRF_ERROR_NOT_FOUND) )
{
APP_ERROR_CHECK(err_code);
}
} while (err_code == NRF_ERROR_BUSY);
and set the flag back to 0 for the next send.
When we use nrf toolbox, we received data for some time and then get a GATT Timeout error and it disconnects. On RTT we get the following errors after setting nrf_log to debug mode
0> Debug logging for UART over RTT started.
0> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.
0> <debug> nrf_ble_gatt: Updating data length to 251 on connection 0x0.
0> <info> app: Connected
0> <debug> nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
0> <info> app: Data len is set to 0xF4(244)
0> <debug> app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7
0> <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x0.
0> <debug> nrf_ble_gatt: max_rx_octets: 27
0> <debug> nrf_ble_gatt: max_tx_octets: 251
0> <debug> nrf_ble_gatt: max_rx_time: 328
0> <debug> nrf_ble_gatt: max_tx_time: 2120
0> <debug> app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7
0> <debug> app: PHY update request.
0> <error> app: Fatal error