nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Optimizing BLE connection

Hello, 

I am creating a BLE Rx/Tx connection between two NRF52840-DK's similar to the Nordic UART Service. With the goal to achieve around a 100/100 KB/s connection. Only the connection is limited with a few issues achieving a connection speed of ~60/60 KB/s.

  • The Link Layer splits packages every now and then even if all packages are the same size.
  • The controllers stops sending data long before the next connection event.

The Link Layer issue:

When all GATT packages are 247 bytes long The Link layer seems to split them apart seemingly randomly. What could cause this issue and how to fix it?

The Connection event issue:

I can send as much data as i would like but the connection event will just stop before the connection event is ending or the connection length has passed.

Increasing the connection event interval will send more data but the delay between connection events will be longer.

Used configuration:

#define CONN_INTERVAL_DEFAULT           MSEC_TO_UNITS(15, UNIT_1_25_MS)

#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(10, UNIT_1_25_MS) 
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(20, UNIT_1_25_MS)
#define SLAVE_LATENCY                   0                               
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS) 

// <o> NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length. 
// <i> The time set aside for this connection on every connection interval in 1.25 ms units.
#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
#define NRF_SDH_BLE_GAP_EVENT_LENGTH 400
#endif

// <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. 
#ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
#endif

// <o> NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4. 
#ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE
#define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 900
#endif

ble_opt_t  option;

memset(&option, 0, sizeof(option));
option.common_opt.conn_evt_ext.enable = true;
option.gap_opt.slave_latency_disable.disable = 1;

errorCode = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &option);

using Softdevice S140 and SKD version nRF5 SDK v17.0.2.

Thank you for reading this post.
Please help me resolving the issues

Parents Reply Children
  • Hello,

    Thank you for still looking at this ticket. Sadly this issue has not been resolved yet. 
    The research project has been shelfed until I have more time to look in to this issue.

    Please close this ticket. If I find the time to look into this issue again and I manage to solve it ill use this ticket to post the solution. In case someone else has the same issue.

    Kind regards,

    Nick Assink

Related