Data rate

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

 

Parents
  • I do not think BLE transmission will be disrupted, as these time sensitive operations are running on the highest priority. It is more likely that the application doesn't have time to place data in the TX buffers before the next connection event. As an experiment you could try to increase the interval to see if that helps.

    Do you know how much time is needed by the app to have everything in place for the next ble transmission? Do you prepare the data right before the next event or right after the previous event? Have you tried using the radio notification api to update the data?

Reply
  • I do not think BLE transmission will be disrupted, as these time sensitive operations are running on the highest priority. It is more likely that the application doesn't have time to place data in the TX buffers before the next connection event. As an experiment you could try to increase the interval to see if that helps.

    Do you know how much time is needed by the app to have everything in place for the next ble transmission? Do you prepare the data right before the next event or right after the previous event? Have you tried using the radio notification api to update the data?

Children
No Data
Related