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.

CC2650: simplePeripheral BLE latency

Part Number: CC2650
Other Parts Discussed in Thread: PACKET-SNIFFER

Hi,

I'm developing an application using the CC2650MODA (will eventually move to CC2640R2) and I'm seeing large (250ms) latency between a sensor event being detected by the SCIF and receiving a BLE notify on my Android app.

I looked at the SimpleBLEPeripheral_createTask function but can't see how often the SimpleBLEPeripheral_taskFxn is run.

void SimpleBLEPeripheral_createTask(void)
{
  Task_Params taskParams;

  // Configure task
  Task_Params_init(&taskParams);
  taskParams.stack = sbpTaskStack;
  taskParams.stackSize = SBP_TASK_STACK_SIZE;
  taskParams.priority = SBP_TASK_PRIORITY;

  Task_construct(&sbpTask, SimpleBLEPeripheral_taskFxn, &taskParams, NULL);
}

For low latency response, I'd like it to run every 1ms or so to process the notify.  Without specifying the task period, what will it default to?  Or is it always running unless blocked by something of higher priority?

Thanks,

Jim

  • Hi Jim,

    The task SimpleBLEPeripheral_taskFxn is event driven - it means code will be executed every time the BLE stack posts an event.

    The latency you are experiencing is not due to the latency of the SimpleBLEPeripheral_taskFxn task. The latency is coming from the Bluetooth LE protocol itself. 

    When in a connection, devices only exchange data during connection events. The "connection interval" is the time between two connection events, it is negotiated between the two devices. The minimum time for the connection interval is 7.5 ms - Android may not allow to select such a small connection interval.

    The simple_peripheral defines the minimum and maximum connection interval acceptable with the following code:

    // Minimum connection interval (units of 1.25ms, 80=100ms) if automatic
    // parameter update request is enabled
    #define DEFAULT_DESIRED_MIN_CONN_INTERVAL     80
    
    // Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic
    // parameter update request is enabled
    #define DEFAULT_DESIRED_MAX_CONN_INTERVAL     800

    I hope this will help,

    Best regards,

  • Thanks Clement.

    I've already set the min and max desired connection interval values to 6 (7.5ms) and 16 (20ms).  (I've read that iOS devices won't support less than 20ms.)  When debugging my app, I can see that the negotiated connection interval is 10ms but my end-to-end delay is 250ms so I'm at a loss to find where it's coming from.  Of course, it could be in the app...

    Any further suggestions greatly appreciated.  Does TI have a packet analyzer that will show the timing of messages?

    Thanks,

    Jim

  • Hi,

    You may want to review our PACKET-SNIFFER (https://www.ti.com/tool/download/PACKET-SNIFFER-2).

    You will find some documentation here.

    Best regards,

  • Hi,

    I am closing this thread due to inactivity.

    If needed, please open a new thread.

    Best regards,