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.

CC2541: How many back to back Notification packets can be transmitted in single Connection Interval

Part Number: CC2541
Other Parts Discussed in Thread: CC2540,

Hello,

I am using CC2541 SimpleBLEPeripheral application. I have queries on Back to back Notifications within Connection Interval.

1) In Notification mode, how many max packets are transmitted back-to-back. Is there any indication whether stack level buffer is full. Assume Connection Interval is 100ms and if I want to Notify every 10ms, whether can I send 10 Notifications back-to-back in same Connection Interval.

2) Assume from application I will read 80 bytes at a time from Flash and call SimpleProfile_SetParameter().

a) Whether stack will take care of sending Notifications back-to-back within Connection interval.

b) If all are not able to send within same Connection interval, whether stack will send in next Connection Interval.

 

              When I try 80 bytes I am getting status as 0x1B (MTU size is out of range) in gattServApp_SendNotiInd(). But below statements inside gattServApp_SendNotiInd() is misleading.

// If the attribute value is longer than (ATT_MTU - 3) octets, then

// only the first (ATT_MTU - 3) octets of this attributes value can

// be sent in a notification.

             

              c) Also in BLE Core_v4.2 standards, LLID is 01b there can be “Continuation fragment of an L2CAP message”. But if I send more than 20 bytes into SimpleProfile_SetParameter() I am getting status as 0x1B (MTU size is out of range). Please correct my understanding, if I am wrong.

 

3) Whether can I send 12 (LL_MAX_NUM_DATA_BUFFERS) back-to-back Notifications within same Connection interval because of below macros.

 

In hci.h

 

#define HCI_MAX_NUM_CMD_BUFFERS                       LL_MAX_NUM_CMD_BUFFERS

#if defined(CC2540) || defined(CC2541) || defined(CC2541S)

#define HCI_MAX_NUM_DATA_BUFFERS                       LL_MAX_NUM_DATA_BUFFERS

#endif // CC2540 | CC2541 | CC2541S

 

In ll.h

/*

** LL Buffers Supported

*/

#define LL_MAX_NUM_DATA_BUFFERS                       12

#define LL_MAX_NUM_CMD_BUFFERS                         1

 

Thanks & Regards

Vishnu Beema

  • Hey Vishnu,

    Vishnu Beema said:
    1) In Notification mode, how many max packets are transmitted back-to-back. Is there any indication whether stack level buffer is full. Assume Connection Interval is 100ms and if I want to Notify every 10ms, whether can I send 10 Notifications back-to-back in same Connection Interval.

    If you use overlapped processing, you will be able to send more than 4 packets per connection event;

    // Enable Overlap Processing
    HCI_EXT_OverlappedProcessingCmd(HCI_EXT_ENABLE_OVERLAPPED_PROCESSING);
    HCI_EXT_HaltDuringRfCmd(HCI_EXT_HALT_DURING_RF_DISABLE);

    However, you cannot define the latency of how fast of slow the packets are sent within a connection event. It's going to be back to back. If you need to send every 10ms, I suggest you use connection interval of 10ms instead.

    Vishnu Beema said:
    a) Whether stack will take care of sending Notifications back-to-back within Connection interval.

    Yes.

    On a more general note, I see that you are posting a lot of questions on E2E regarding CC2541. This is an old device that was released 2011 and I strongly recommend that you migrate to one of the newer platforms, CC2640R2 and CC2642 for a richer feature set with an quarterly SDK update cadency. 

    Vishnu Beema said:
    b) If all are not able to send within same Connection interval, whether stack will send in next Connection Interval.

    Yes. Note that you can only send 20 bytes per notification.

    Vishnu Beema said:
                  c) Also in BLE Core_v4.2 standards, LLID is 01b there can be “Continuation fragment of an L2CAP message”. But if I send more than 20 bytes into SimpleProfile_SetParameter() I am getting status as 0x1B (MTU size is out of range). Please correct my understanding, if I am wrong.

    It's better if you fragment on application level before updating the characteristic with 20 Byte chunks.

  • Hello Joakim,

    Thank you for your quick response. Yes, now a days there are lot of posts on CC2541 :).

    1) The only reason behind going to CC2540/41 is Cost and in-built USB variant with pin compatible between CC2540 & CC2541. Is there any other TI chipset with BLE + USB, please suggest.

    2) Sometimes I am getting blePending as status. What is the reason behind this and how to avoid.

    3) Whether can I send 12 (LL_MAX_NUM_DATA_BUFFERS) back-to-back Notifications within same Connection interval because of macros in hci.h and ll.h.

    4) How about HCI_EXT_NumComplPktsLimitCmd(HCI_MAX_NUM_DATA_BUFFERS, HCI_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT); Do I need to add this.

    5) Whether connecting IAR workbench will decrease code execution speed. Even with Connection interval Min as 7.5ms and Max as 25ms, I am able to Connect. But once I click on "Notify", connection is lost. Without IAR I am able to receive all notifications.

    6) For HCI_EXT_OverlappedProcessingCmd(), in BLE Software Development guide, its mentioned to refer to wiki page. But in below link I am not able to find details. Please share correct link.

    http://processors.wiki.ti.com/index.php/Category:BluetoothLE

    Thanks & Regards

    Vishnu Beema

  • Vishnu Beema said:
    1) The only reason behind going to CC2540/41 is Cost and in-built USB variant with pin compatible between CC2540 & CC2541. Is there any other TI chipset with BLE + USB, please suggest.

    I understand, we do not have any other BLE+USB solutions in our current offering

    Vishnu Beema said:
    2) Sometimes I am getting blePending as status. What is the reason behind this and how to avoid.

    blePending means "No HCI buffer was available.". I suppose you hit this after queueing 4 packets?

    Vishnu Beema said:
    3) Whether can I send 12 (LL_MAX_NUM_DATA_BUFFERS) back-to-back Notifications within same Connection interval because of macros in hci.h and ll.h.

    I am not sure this define is even related to back-to-back transmissions.

    Vishnu Beema said:
    4) How about HCI_EXT_NumComplPktsLimitCmd(HCI_MAX_NUM_DATA_BUFFERS, HCI_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT); Do I need to add this.

    I am not familiar with this API, seems to be more related to "when" confirmation should be sent back from controller. Not sure you really have use for it in this case.

    Vishnu Beema said:
    5) Whether connecting IAR workbench will decrease code execution speed. Even with Connection interval Min as 7.5ms and Max as 25ms, I am able to Connect. But once I click on "Notify", connection is lost. Without IAR I am able to receive all notifications.

    Are you referring to during debug vs running free?

    Vishnu Beema said:
    6) For HCI_EXT_OverlappedProcessingCmd(), in BLE Software Development guide, its mentioned to refer to wiki page. But in below link I am not able to find details. Please share correct link.

    That wiki does not exist anymore, unfortunately. This is one of the reasons I suggest using a maintained platform instead, such as CC2640R2 or CC2642. 

  • Thank you for your inputs