This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R: Maximize BLE throughput

Part Number: CC2642R

Hi,

I am using simpleperipheral code of sdk simplelink_cc26x2_sdk_2_30_00_34 with MAX_BLE_CONN=3. As per my application, all connected master devices will get the continuous data through notifications.

I am setting below parameters in my applications:
-DMAX_NUM_BLE_CONNS=3

-DMAX_PDU_SIZE=27

// Minimum connection interval (units of 1.25ms, 24=30ms) for parameter update request
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL     24

// Maximum connection interval (units of 1.25ms, 80=100ms) for  parameter update request
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL     80

// Slave latency to use for parameter update request
#define DEFAULT_DESIRED_SLAVE_LATENCY         0

// Supervision timeout value (units of 10ms, 300=3s) for parameter update request
#define DEFAULT_DESIRED_CONN_TIMEOUT          300

// Pass parameter updates to the app for it to decide.
#define DEFAULT_PARAM_UPDATE_REQ_DECISION     GAP_UPDATE_REQ_DENY_ALL

// Delay (in ms) after connection establishment before sending a parameter update requst
#define SP_SEND_PARAM_UPDATE_DELAY           6000

with DLE disabled and using GATT_Notification(connHandle, pNoti, false)  function in loop for sending notification to connected devices.

If i connect 3 master devices with my devices, each packet is being sent after 50ms (with most time failure) which decreasing the throughput of my devices. As i need to increase the MAX_BLE_CONN of my devices. I am retrying 10 times if notification return fail, but some it always returns failure and that packet got lost.

Below the Code snippet of my notification code.
while(1)
{
  .......
  for (index = 0; index < MAX_NUM_BLE_CONNS; index++)
  {
     status = Data_Notification(conn[index].connHandle, &NotiDataBuffer[FifoRdIndex][5], DataLen, SIMPLEPROFILE_CHAR1);

      if(status != SUCCESS)
     {
       status   = SUCCESS;
       SendFail = true;
       break;
     }
  }

  if(SendFail)
  {
    NotiFailRetry++;
    Task_sleep(MS_DELAY(10));
  }
  .......
 } 

How can i reduce this delay and increase my device throughput?

  • Can you provide sniffer logs? This way we can determine why you are receiving so many packet failures.

    Have you tried this setup with only 1 device connected? 2? How reliable are you receiving the data in each case?
  • Hi Ammar,

    // Minimum connection interval (units of 1.25ms, 24=30ms) for parameter update request

    #define DEFAULT_DESIRED_MIN_CONN_INTERVAL     24

    // Maximum connection interval (units of 1.25ms, 80=100ms) for  parameter update request

    #define DEFAULT_DESIRED_MAX_CONN_INTERVAL     80

    // Slave latency to use for parameter update request

    #define DEFAULT_DESIRED_SLAVE_LATENCY         0

    // Supervision timeout value (units of 10ms, 300=3s) for parameter update request

    #define DEFAULT_DESIRED_CONN_TIMEOUT          300

    // Pass parameter updates to the app for it to decide.

    #define DEFAULT_PARAM_UPDATE_REQ_DECISION     GAP_UPDATE_REQ_DENY_ALL

    // Delay (in ms) after connection establishment before sending a parameter update requst

    #define SP_SEND_PARAM_UPDATE_DELAY           6000

    Yes, we have tried with only 1 connection and with 2 connections also with above connection parameters.

    With 1 connection, i am getting 1000 packets in 15-20 seconds. with 10-15 packets failure .

    With 2 connections, i am getting 1000 packets in 40-45 seconds. with 50-70 packets failure .

    With 3 connections, i am getting 1000 packets in 80-100 seconds. with 200-250 packets failure.

    With increased connection, transmission delay and packet loss is increasing frequently. Please check below sniffer logs with 3 connections.

    3_Connections_logs.txt

  • Hey Aditya,

    I'm thinking the connection interval is too large, and that we need to send data more often to reduce packet failures. Try reducing DEFAULT_DESIRED_MAX_CONN_INTERVAL to something smaller. The smallest connection interval that BLE supports is 7.5ms.

    We haven't tested this use case, so making the connection interval this small may lead to collisions with data (especially given the fact that you have 3 connections all receiving data every 7.5 ms).

    One way to ensure there isn't packets lost is to use indications and wait for the acknowledgement on the central side. This however, will reduce throughput.
  • Hi Ammar,

    My issue is resolved i changed the MAX_NUM_PDU from default value 5 to 10 in ble_user_config.h and reduce the connection interval also. Now my device throughput increased double.

    But i have one query regarding this,
    1. how much we can increase this value and how to calculate what value should be set for MAX_NUM_PDU ?
    2. Increasing this value will effect something in stack?
  • Hey Aditya,

    Thanks for sharing the fix for others.

    aditya jadoun said:
    how much we can increase this value and how to calculate what value should be set for MAX_NUM_PDU ?

    The MAX_NUM_PDU x MAX_PDU_SIZE is the size of the TX buffers in the linked layer. So, the answer to this question depends on how much memory you have available. Increasing this size too much can lead to system halts if all the memory is used up. I would suggest to use our debugging tools and turn on HEAPMGR_METRICS to see how high you can make the TX buffers.

    aditya jadoun said:
    Increasing this value will effect something in stack?

    Correct. Increasing the MAX_NUM_PDU uses up more memory for the LL to accept more HCI PDUs.