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.

CC2652R: Sending L2CAP data larger than 256 bytes via SPI/NPI via BTOOL

Part Number: CC2652R

I have upgraded SPI from NPI to UNPI so that the SPI frame can be now greater than 256.

Nevertheless BTOOL does not allow me to send these long frames because internally it expects length to be 1 byte. below I want to send 400bytes but the command length is truncated to 1 byte. (146)

[8] : <Tx> - 03:17:07.550
-Type           : 0x01 (Command)
-OpCode         : 0xFCF0 (L2CAP_SendData)
-Data Length    : 0x92 (146) byte(s)
 CID            : 0x0040 (64)
 SDU            : 00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:
                  12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:
                  34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:
                  56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:
                  78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:
                  00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:
                  12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:
                  34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:
                  56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:
                  78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:
                  00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:
                  12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:
                  34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:
                  56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:
                  78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:
                  00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:
                  12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:
                  34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:
                  56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:
                  78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:
                  00:12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:
                  12:34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:
                  34:56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:
                  56:78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:
                  78:00:12:34:56:78:00:12:34:56:78:00:12:34:56:78
Dump(Tx):
0000:01 F0 FC 92 40 00 00 12 34 56 78 00 12 34 56 78 ....@...4Vx..4Vx
0010:00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 ..4Vx..4Vx..4Vx.
0020:12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 .4Vx..4Vx..4Vx..
0030:34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 4Vx..4Vx..4Vx..4
0040:56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 Vx..4Vx..4Vx..4V
0050:78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 x..4Vx..4Vx..4Vx
0060:00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 ..4Vx..4Vx..4Vx.
0070:12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 .4Vx..4Vx..4Vx..
0080:34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 4Vx..4Vx..4Vx..4
0090:56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 Vx..4Vx..4Vx..4V
00A0:78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 x..4Vx..4Vx..4Vx
00B0:00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 ..4Vx..4Vx..4Vx.
00C0:12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 .4Vx..4Vx..4Vx..
00D0:34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 4Vx..4Vx..4Vx..4
00E0:56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 Vx..4Vx..4Vx..4V
00F0:78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 x..4Vx..4Vx..4Vx
0100:00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 ..4Vx..4Vx..4Vx.
0110:12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 .4Vx..4Vx..4Vx..
0120:34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 4Vx..4Vx..4Vx..4
0130:56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 Vx..4Vx..4Vx..4V
0140:78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 x..4Vx..4Vx..4Vx
0150:00 12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 ..4Vx..4Vx..4Vx.
0160:12 34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 .4Vx..4Vx..4Vx..
0170:34 56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 4Vx..4Vx..4Vx..4
0180:56 78 00 12 34 56 78 00 12 34 56 78 00 12 34 56 Vx..4Vx..4Vx..4V
0190:78 00 12 34 56 78                               x..4Vx
--------------------------------------------------------------------

I am using simplelink_cc13x2_26x2_sdk_5_20_00_52.

  • Hi,

    Let me assign your post to the expert who has helped you last time.

    Best regards,

  • Hi,

    In the embedded example, then length for L2CAP SDU is 2 bytes. I will take a look at the BTool, but for you to continue evaluation, I would recommend you to do it using embedded example.

    How to use COC feature to send data over L2CAP, you can find the code snippet here:

    dev.ti.com/.../l2cap.html

  • short explanation on what we want to achieve:

    In our setup we are sending SPI commands to the BLE chip using Host_test app (unmodified except the UNPI part). And we liked that we did not have to modify any of the embedded code and the best solution for us would be to keep it that way :).

    So up to now we were sending all commands with: Type: 0x01 (Command).

    From the code below my understanding is that if I send a command with Type: 0x09 (HCI_EXTENDED_CMD_PACKET) a 2 byte length will be expected. And this will not require any other modification in the code. Is this correct?

    static uint8_t processExtMsg(hciPacket_t *pMsg)
    {
      uint8_t deallocateIncoming;
      bStatus_t stat = SUCCESS;
      uint8_t rspDataLen = 0;
      hciExtCmd_t msg;
      uint8_t *pBuf = pMsg->pData;
    
      // Parse the header
      msg.pktType = *pBuf++;
      msg.opCode = BUILD_UINT16(pBuf[0], pBuf[1]);
      pBuf += 2;
    
      if (msg.pktType == HCI_EXTENDED_CMD_PACKET)
      {
        msg.len = BUILD_UINT16(*pBuf,*(pBuf+1)) ;
        pBuf+=2;
      }
      else
      {
        msg.len = *pBuf++;
      }
      msg.pData = pBuf;

  • Hi,

    Sorry for the delayed response.

    Yes, your understanding is correct. By using HCI_EXTENDED_CMD_PACKET, the payload length can be extended to 2 bytes. The detail of the payload is as below

    For more information regarding HCI, you can go to:

    SIMPLELINK SDK INSTALL/docs/ble5stack/vendor_specific_guide/BLE_Vendor_Specific_HCI_Guide/hci_interface.html