Hi,
we are trying to send data (a packet of 54 bytes) at 100Hz but our data is not always transmitting regularly.
Much of the time the TX is perfect but every so often there is a 20ms delay (see picture of trace).
Our code seems to get stuck with the error NRF_ERROR_RESOURCES for about 20ms:
do
{
debug_error_code = ble_nus_data_send(&m_nus, test_buffer, &test_buffer_len, m_conn_handle);
if ((debug_error_code != NRF_ERROR_INVALID_STATE) &&
(debug_error_code != NRF_ERROR_RESOURCES) &&
(debug_error_code != NRF_ERROR_NOT_FOUND))
{
APP_ERROR_CHECK(debug_error_code);
}
} while (debug_error_code == NRF_ERROR_RESOURCES);
The transmission is is triggered by an app timer:
err_code = app_timer_create( &m_ble_send_poll_timer_id,
APP_TIMER_MODE_REPEATED,
ble_send_timeout_handler );
And because the BLE tx timer is 10ms the 20ms delay backs up the transmissions.
Here are our timing settings:
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(10, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS)
Our project is based on BLE_uart.
How can we stop this 20ms delay and get it transmitting regularly?
Thanks
