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.

LP-EM-CC2340R5: Issue in connecting peer devices when host test program sdk v8.40 is done in CC2340R5

Part Number: LP-EM-CC2340R5
Other Parts Discussed in Thread: CC2340R5, SYSCONFIG, UNIFLASH

Tool/software:

Issue Description:
When we perform a scan using BTool and our scanning device initiates a connection, the connection is immediately dropped within a second, without any explicit disconnection event. This occurs even with the default BTool settings.

We have tested this behavior across multiple SDK versions: 7.10, 7.40, 8.10, and the latest 8.40.

Note: The same device connects seamlessly with a mobile app and does not exhibit this auto-disconnection behavior. This issue is currently a showstopper for us.


Questions:

Q1: What could be causing this automatic disconnection when using BTool, and how can we resolve it?See Log for your reference

Q2: Is there any way to detect the RSSI value, MAC address, and Tx Power of a scanning central device that sends a scan request without initiating a connection?
(Example: Device A is acting as a Central and scanning my device B, which is in peripheral mode. I want to obtain the RSSI, MAC address, and Tx Power of Device A based on the scan request.)

Logs  for your reference
Dump(Rx):
0000:04 FF 3E 13 06 00 00 00 40 00
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x14 (20) bytes(s)
Event : 0x0605 (1541) (GAP_EstablishLink)
Status : 0x00 (0) (SUCCESS)
DevAddrType : 0x00 (0) (ADDRTYPE_PUBLIC)
DevAddr : 0C:AF:5A:00:00:FE
ConnHandle : 0x0000 (0)
ConnRole : 0x08 (8) (
Central)
ConnInterval : 0x0050 (80)
ConnLatency : 0x0000 (0)
ConnTimeout : 0x07D0 (2000)
ClockAccuracy : 0x00 (0)
Dump(Rx):
04 FF 14 05 06 00 00 FE 00 00 5A AF 0C 00 00 08
50 00 00 00 D0 07 00

-Type : 0x01 (Command)
-OpCode : 0x2022 (HCI_LE_SetDataLength)
-Data Length : 0x06 (6) byte(s)
Handle : 0x0000 (0)
TxOctets : 0x00FB (251)
TxTime : 0x0848 (2120)
Dump(Tx):
01 22 20 06 00 00 FB 00 48 08
--------------------------------------------------------------------
-Type : 0x04 (Event)
-EventCode : 0x000E (HCI_CommandCompleteEvent)
-Data Length : 0x06 (6) bytes(s)
Packets : 0x01 (1)
OpCode : 0x2022 (HCI_LE_SetDataLength)
Status : 0x00 (0) (SUCCESS)
Handle : 0x0000 (0)
Dump(Rx):
04 0E 06 01 22 20 00 00 00
--------------------------------------------------------------------
Device Connected
Handle = 0x0000
Addr Type = 0x00 (ADDRTYPE_PUBLIC)
BDAddr = 0C:AF:5A:00:00:FE
--------------------------------------------------------------------
Device Disconnected
Handle = 0x0000
Addr Type = 0x00 (ADDRTYPE_PUBLIC)
BDAddr = 0C:AF:5A:26:35:3E
--------------------------------------------------------------------
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x0606 (1542) (GAP_TerminateLink)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
Reason : 0x3E (62) (FAILED_TO_ESTABLISH)-
Dump(Rx):
0000:04 FF 06 06 06 00 00 00 3E

  • Hello,

    Thanks for reaching out! 

    Q1: What could be causing this automatic disconnection when using BTool, and how can we resolve it?See Log for your reference

    Even though this isn't the expected behavior, this could be happening due to a number of reasons. Please answer the questions below to help me in pinpointing the issue:

    1. Could you possibly provide a packet sniffer log?
    2. What time of device are you attempting to connect to?
    3. Is your device running the host_test hex file that is provided in the SDK?
    Q2: Is there any way to detect the RSSI value, MAC address, and Tx Power of a scanning central device that sends a scan request without initiating a connection?

    Unfortunately, the ble spec does not allow any information regarding this matter. According to the BLE v5.4 core specification (Vol 6, Part B, Section 2.3.2.1):

    "The Payload consists of ScanA and AdvA fields. The ScanA field shall contain the scanner’s public or random device address as indicated by TxAdd. The AdvA field is the address of the device to which this PDU is addressed. The AdvA field shall contain the advertiser’s public or random device address as indicated by RxAdd. Note: These PDUs do not contain any Host Data."

    I hope this answers your second question! As for the first question, I'll be waiting for you to provide some more info. We'll get this resolved soon!

    Best Regards,

    Tarek

  • Thanks for your response :- 

    1. Could you possibly provide a packet sniffer log?     --We do not have sniffer ,although i am attaching BTool log and Error 0x3E is there[some update our device does not have any 32kHz external crystal, so it might see like sleep accuracy]
    2. What time of device are you attempting to connect to? --> When we have scanned for 10 sec and then initiate Gap connection
    3. Is your device running the host_test hex file that is provided in the SDK? --> Yes ,no change by our end [Check with Version 7.4,8.10,8.40]

    Some Question : -

    Q1 :Can you please comment how scan window, and scan interval can be increased and can it help to sync sleep inaccuracy because of Internal RC clock? 

    Q2:Can you please explain ,in how much time connection should be completed after initiation of connection and on what factors this connection time depends.

    This is problem is more visible with CC2340R5 LP board and I have tried to connect with different -2 board .[When using Launch xl-cc2640r2 Rev 1.0 and HCIExt_SetSCA cmd [opcode 0xFC0D] is set with 400 ppm our board are able to connect, it seems because of this relaxation  there is more room to connect even without external crystal of 32kHz -->If this is true please explain it in depth or any document that provide detailed information will be helpful]

    Here is Time wise stamp log are there 

    [1] : <Tx> - 01:51:58.065
    -Type : 0x01 (Command)
    -OpCode : 0xFE62 (GapInit_connect)
    -Data Length : 0x0A (10) byte(s)
    PeerAddrType : 0x00 (0) (PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID)
    PeerAddr : 0C:AF:5A:00:00:46
    InitiatingPhy : 0x01 (1) (
    INIT_PHY_1M)
    Timeout : 0x0000 (0)
    Dump(Tx):
    0000:01 62 FE 0A 00 46 00 00 5A AF 0C 01 00 00 .b...F..Z.....
    --------------------------------------------------------------------
    [2] : <Rx> - 01:51:58.081
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x06 (6) bytes(s)
    Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
    Status : 0x00 (0) (SUCCESS)
    OpCode : 0xFE62 (GapInit_connect)
    DataLength : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 62 FE 00 ......b..
    --------------------------------------------------------------------
    [3] : <Rx> - 01:51:59.597
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x14 (20) bytes(s)
    Event : 0x0605 (1541) (GAP_EstablishLink)
    Status : 0x00 (0) (SUCCESS)
    DevAddrType : 0x00 (0) (ADDRTYPE_PUBLIC)
    DevAddr : 0C:AF:5A:00:00:46
    ConnHandle : 0x0000 (0)
    ConnRole : 0x08 (8) (
    Central)
    ConnInterval : 0x0050 (80)
    ConnLatency : 0x0000 (0)
    ConnTimeout : 0x07D0 (2000)
    ClockAccuracy : 0x00 (0)
    Dump(Rx):
    0000:04 FF 14 05 06 00 00 46 00 00 5A AF 0C 00 00 08 .......F..Z.....
    0010:50 00 00 00 D0 07 00 P......
    --------------------------------------------------------------------
    [4] : <Tx> - 01:51:59.597
    -Type : 0x01 (Command)
    -OpCode : 0x2022 (HCI_LE_SetDataLength)
    -Data Length : 0x06 (6) byte(s)
    Handle : 0x0000 (0)
    TxOctets : 0x00FB (251)
    TxTime : 0x0848 (2120)
    Dump(Tx):
    0000:01 22 20 06 00 00 FB 00 48 08 ." .....H.
    --------------------------------------------------------------------
    [5] : <Info> - 01:51:59.659
    Device Connected
    Handle = 0x0000
    Addr Type = 0x00 (ADDRTYPE_PUBLIC)
    BDAddr = 0C:AF:5A:00:00:46
    --------------------------------------------------------------------
    [6] : <Rx> - 01:51:59.643
    -Type : 0x04 (Event)
    -EventCode : 0x000E (HCI_CommandCompleteEvent)
    -Data Length : 0x06 (6) bytes(s)
    Packets : 0x01 (1)
    OpCode : 0x2022 (HCI_LE_SetDataLength)
    Status : 0x00 (0) (SUCCESS)
    Handle : 0x0000 (0)
    Dump(Rx):
    0000:04 0E 06 01 22 20 00 00 00 ...." ...
    --------------------------------------------------------------------
    [7] : <Info> - 01:52:00.175
    Device Disconnected
    Handle = 0x0000
    Addr Type = 0x00 (ADDRTYPE_PUBLIC)
    BDAddr = 0C:AF:5A:00:00:46
    --------------------------------------------------------------------
    [8] : <Rx> - 01:52:00.175  --->
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x06 (6) bytes(s)
    Event : 0x0606 (1542) (GAP_TerminateLink)
    Status : 0x00 (0) (SUCCESS)
    ConnHandle : 0x0000 (0)
    Reason : 0x3E (62) (FAILED_TO_ESTABLISH)
    Dump(Rx):
    0000:04 FF 06 06 06 00 00 00 3E ........>
    --------------------------------------------------------------------

  • Hello,

    Thank you for providing this information! Since your device does not have the external crystal, you would need to modify the host_test project, as it won't be fully operational with it's default settings. To modify it:

    1. Go to the sysconfig file of the project
    2. Select Device Configuration on the left side menu
    3. Go to "Low Frequency Clock Source"
    4. Select "LF RCOSC"

    This will make the program use the internal low-frequency RC oscillator rather than the external crystal. I have attached a hex file of the host_test with these modified settings, and I suspect this should fix the issue. For more info on using the device in crystal-less mode, please refer to our user guide:

    https://dev.ti.com/tirex/content/simplelink_lowpower_f3_sdk_8_40_02_01/docs/ble5stack/ble_user_guide/html/cc23xx/custom-hardware-cc23xx.html#using-32-khz-crystal-less-mode-lf-rcosc

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/538/host_5F00_test_5F00_LP_5F00_EM_5F00_CC2340R5_5F00_freertos_5F00_ticlang.hex

    If this doesn't work, can you please provide the connection parameters that you're using for both devices?

    Best Regards,

    Tarek

  • sorry but it does not solve my issue although  my setting are default one provided by BTOOL exe . Also I tried to increase connection interval and latency to maximum still same issue(0x3E) i think these setting play roles after connection establishment. Could be find out any other reason Note :- When i am using  Launch CC2640R2 board and setting ppm value using  HCI_EXT_SetSCACmd(). to 400 ppm then it is connecting and same setting done in cc2340r5 Lp board then same issue as mention above 

  • Hello,

    Just to confirm, did you flash the hex file I provided onto your board and it still did not work?

    Also, what type of device are you attempting to connect to?

    Best Regards,

    Tarek

  • Yes i did flash that file using uniflash and same result

    I am trying to connect cc2340r5 4by4 chip that does not have have external crystal, this device connect  easily with phone app and Cc2640R2 Launch board when I set ppm value with  HCI_EXT_SetSCACmd() to 400 ppm

    Same I tried doing with Lp board of cc2340r5 which has been flash with your file too but it give 0x3E error

  • Hello,

    Can the CC2340R5 connect to other devices?

    Best Regards,

    Tarek

  • Yes it can connect with Launch pad of cc2340r5 when programmed with simple peripheral hex file file retrieved from sdk

  • Hello,

    Sorry for the delay! Can you please provide the connection parameters for both devices?

    Best Regards,

    Tarek

  • <Rx> - 01:51:59.597

    -Type : 0x04 (Event)

    -EventCode : 0x00FF (HCI_LE_ExtEvent)

    -Data Length : 0x14 (20) bytes(s)

    Event : 0x0605 (1541) (GAP_EstablishLink)

    Status : 0x00 (0) (SUCCESS)

    DevAddrType : 0x00 (0) (ADDRTYPE_PUBLIC)

    DevAddr : 0C:AF:5A:00:00:46

    ConnHandle : 0x0000 (0)

    ConnRole : 0x08 (8) (

    Central)

    ConnInterval : 0x0050 (80)

    ConnLatency : 0x0000 (0)

    ConnTimeout : 0x07D0 (2000)

    ClockAccuracy : 0x00 (0)

    Dump(Rx):

    0000:04 FF 14 05 06 00 00 46 00 00 5A AF 0C 00 00 08

  • Hello,

    I have been trying to recreate the issue on my end but I haven't been able to. Could you attempt to increase the Tx power and see if that results in a successful connection?

    Best Regards,

    Tarek

  • Dear, both board are very near to each other, and it fails when HCI set length Is sent after connection establishment,my board is 4x4 and without any outer crystal 

  • Let's move this thread to email, so that we can speed up the debug process. Please provide this thread to the FAE in charge of your account so that we can continue the debug process.

    Best Regards,

    Tarek