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

BLE_GATTS_EVT_HVX_TX_COMPLETE triggered too late

Hi,

In our current project we use nordic NRF52832 ble to send some data(~200 Byte / packet) to host, we expect each transmission to be done within 10ms, but results from experiment shows non-deterministic delay varies from 10ms to 60ms, how can we achieve more stable result?

Here is the configuration parameters used:

`MIN_CONNECTION_INTERVAL`: MSEC_TO_UNITS(8, UNIT_1_25_MS)

`MAX_CONNECTION_INTERVAL`: MSEC_TO_UNITS(8, UNIT_1_25_MS)

`NRF_SDH_BLE_GATTS_MAX_MTU_SIZE`: 247

`NRF_SDH_BLE_GAP_EVENT_LENGTH`: 6

delay time is measured using `app_timer_cnt_get()`, started from `ble_nus_data_send()` and stopped when `BLE_GATTS_EVT_HVX_TX_COMPLETE` was received


the following shows our experiment's result:

delay

delay_dist

regards,

chxt

Parents
  • Hi,

    What device are you sending the packets to ? Note that the master could have set the conneciton interval to something else than 8ms. The master is the one that decides what that connection interval will be. A sniffer log should help you see what is happening on-air. See this link.

    Note that the BLE_GATTS_EVT_HVN_TX_COMPLETE event, and other SoftDevice events are asynchronous. Also note that this event has a count field. See this link.

  • Hi, Sigurd,

    I'm using a dwm1001-dev board which has a nordic NRF52832 MCU, and a NRF52840 USB Dongle was plugged on host computer for receiving(with pc-ble-driver), both side was using the same BLE parameters.

    Today I also did another experiment using only 2 dwm1001-dev boards (NRF52832), with example ble_app_uart / ble_app_uart_c from nRF5_SDK_15.3.0, the results seems much better (20 - 40 ms). Besides, I didn't find any significant difference in the sdk_config.h used for NRF52832 central and NRF52840 central.

Reply
  • Hi, Sigurd,

    I'm using a dwm1001-dev board which has a nordic NRF52832 MCU, and a NRF52840 USB Dongle was plugged on host computer for receiving(with pc-ble-driver), both side was using the same BLE parameters.

    Today I also did another experiment using only 2 dwm1001-dev boards (NRF52832), with example ble_app_uart / ble_app_uart_c from nRF5_SDK_15.3.0, the results seems much better (20 - 40 ms). Besides, I didn't find any significant difference in the sdk_config.h used for NRF52832 central and NRF52840 central.

Children
Related