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: Unable to scan and find again a peripheral after its succesfull bonding and first disconnection

Part Number: CC2642R
Other Parts Discussed in Thread: CC2640

Hi to everybody,
I have a strange behaviour of my application (based on TI multi_role examples) and I'm not able to understand why it happen. I hope you can give me an advice.

I'm working with CC2642 and simplelink_cc13x2_26x2_sdk_2_40_00_81. My "multi_role" application can accept a connection from one or more Master, through the passkey process. I'm using the following set up

--------------------------------------------------------

uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;

uint8_t mitm = TRUE;

uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY; 

uint8_t bonding = TRUE; 

GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode); 
GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm); 
GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);     

--------------------------------------------------------

CASE1

Using a SPhone(huwawei Mate 20 Pro, but also other kind of SPhone brand) as Master, I have no issue to scan for the multi_role, to found it, to create a BT link, to send the required Password and make a succesfull Bonding. At the end of the bonding process, I can disconnect my SPhone, and at the next scan for my multi_role, i can found it again and make a link with it with no more password requested.

CASE2 

Using BTOOL and CC2640R2 launchpad kit (replacing the BT chip with a CC2642) and Blestack/Host_test from  SDK_1_35_00_ 33 I can succesfull use it as Master and I have no issue to scan for the multi_role, to found it, to create a BT link, to send the required Password and make a succesfull Bonding.

The problem in this case is that after the bonding process, If I disconnect the Launchpad and start again to scan for my multi_role, the multi_role itself doesn't reply anymore at any of my scan request. I can just receive the Mac Address from BTool but not the scan Response. If I try to make a link, this is not possible!  I also can't see any connection_event in my multi_role side...

If I disable the Bonding, I can see the scan response reply from multi_role even after the first pairing with password, so I guess there is something wrong with the bonding process  

Because my multi_role application in the future has to work not only with SPhone but also with telemathic units, I'm worry if this behaviour can happen in the second scenario: after a succesfull bonding, the telematics units will not be able to link it anymore...

I have two log from packet sniffer, were the link,pairing and bonding are made. One for CAS1 and one for CASE2. I hope you can give me some suggestion.CASE1 SPhone & multi_role.psdCASE2 LP & multi_role.psd

Thanks in advance for your support!

Federico    

 

 

  • Hi Federico,

    Are you using the same board (CC2640R2 LP with CC2642R chip) in both cases?

    For case 2, did you double check that the multi role device is still advertising?

    Can you run a debug session and pause when this happens, then post a screen shot of the call stack?

  • Hi Marie,

    many thanks for your help. 

    Regarding the first question: 

    in both case 1 and 2, my custom multi_role application is running through my custom board (with CC2642). But, as I wrote, on case 1, the Master is a SPhone and in case 2 the Master is a CC2640R2 LP with CC2642R chip.

    Regarding the second question:

    yes, I always check if my multi_role still advertising, I can see the correct advertising through the SPhone scan while I'm scanning with the LP already bonded. The scan result from the LP however, report only the MAC Address, but not the scan response.

    More informations:

    If I start to scan for my multi_role with another identical LP (CC2640R2 LP with CC2642R chip)  BUT not bonded yet, I can scan correctly, getting from my multi_role the scan response (and this untill I'm not bonding also this LP too). It seems once I bond an LP that my multi_role doesn't reply to any future  scan request from that LP Mac. The only way to make it possible is to erase the bonding information from my multi_role side. 

    I'm attaching (together with the call stack you've asked me) the multi_role Log during the paring process on both case with SPhone and LP(if can be helpfull): the only difference I can see is that SPhone pairing ask to multi_role an HCI LE GENERATE DHKEY, while the LP doesn't..

    I'm attaching also a Log from Btool made with the CC2640R2 LP with CC2642R chip as master where the first step is Scanning-Pairing-Bonding-Disconnect my multi_role correctly: as I said , the first time everything is ok.The mac address is 18:04:ED:C7:14:51. You can quickly find the correct scan response looking for "Defcom", which is the name of my  product. After that, I'm scanning again (after the bonding success and the disconnection done), but the new scan request cannot get scan response, and if I force any connection (because the MAC is still visible on air) the result is always 0x3E (62) (Failed To Establish)    Note that in this case, I'm not receiving any kind of "Connection Event" from multi_role side 


    Thanks again for your support

    Regards, Federico

    1537.Btool Log.txt

  • Hi Federico,

    Which silicon revision are you using? Also, when developing the custom board did you follow the guidelines in this application note? 

    Have you made any modifications to the multi_role project?

    If yes, can you perform the same tests with the latest SDK (available for download here: https://www.ti.com/tool/SIMPLELINK-CC13X2-26X2-SDK) and see if you experience the same issue? 

    If no, did you experience these issues with the default project from the SDK? 

    Thanks, 
    Elin 

  • Hi Federico,

    Thank you for providing the sniffer logs. I would like to summarize your issue first before we get to more direct feedback. Your main concern is that when you switch your master device, to a TI device, that you no longer see a scan response reply from the multi-role device after you've connected and bonded with a TI master running host test using SDK 1.30, correct?

    A few questions/concerns.

    Sniffer log for CASE1 seems to be a very incomplete sniffer log. It's not actually capturing the start of the BLE connection or any events you've described, so i have a hard time trusting it. 

    Sniffer log for CASE2, this seems to be a more complete log and i do see that the device is scan requesting and the peripheral is sending a scan response before the connection, but after the connection, I do not see any scan requests coming from the master device. Therefore, this would indicate that the master device is actually at fault here, because the peripheral device will not send a scan response if no scan request is seen. Have you confirmed if the master device is even scanning?

    Federico Bocconi said:
    Using BTOOL and CC2640R2 launchpad kit (replacing the BT chip with a CC2642) and Blestack/Host_test from  SDK_1_35_00_ 33

    A quick comment, this quote above is concerning to me as well. Are you saying that you used the CC2640R2 LaunchPad, replaced the R2 on the R2 LaunchPad with a CC2642 and then took the CC2640R2 host test project from CC2640R2 SDK 1.35 and ran it on the CC2642? Can you expand on your test setup here and the purpose of running this test? Why not use a CC26x2 LaunchPad with the latest SDK? This would be greatly helpful. 

    Lastly, what is triggering you to run this test if you feel that you see no issues when working with phones? Are you trying to do something extra in your application or are you running tests of some sort?

  •  Hi Evan,

    thanks for your response. Yes, you've summarize correctly my issue (host test running is 1_35_00_33).

    Regarding CASE 1

    you can find the relevant sniffer packets between Point number 3005 (ADV_CONNECT_REQ) and Point number 3021 (SM Pairing Confirm) but I'm agree with you that not all the informations seems available. I have others Log with Sphone and all are similar, I can send you a LOG captured with another sniffer device(Frontline) if you need it.

     Regarding CASE2

     yes, you are correct, you can't see any Scan Request because (in both CASE1 & CASE2) the LOG was stopped just after the bonding because I'm thinking the problem happen during this  process so i was highlithing only it. However with both my sniffer(Frontline & TI dongle) is very clear that after bonding succesul with an LP, the scan response is sent ONLY to the SPhone and not to the LP.

    I can verify this behaviours from Btool, where with a scan request before bonding I can receive both EventType     : 0x00 (0) (Connectable Undirect Advertisement) and  EventType     : 0x04 (4) (Scan Response)

    --------------------------------------------------------------------

    [41] : <Rx> - 11:39:04.192

    -Type           : 0x04 (Event)

    -EventCode     : 0x00FF (HCI_LE_ExtEvent)

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

    Event         : 0x060D (1549) (GAP_DeviceInformation)

    Status         : 0x00 (0) (Success)

    EventType     : 0x00 (0) (Connectable Undirect Advertisement)

    AddrType       : 0x00 (0) (Public)

    Addr           : 18:04:ED:C7:14:51

    Rssi           : 0xC8 (200)

    DataLength     : 0x07 (7)

    Data           : 02:01:06:03:02:00:BB

    Dump(Rx):

    0000:04 FF 14 0D 06 00 00 00 51 14 C7 ED 04 18 C8 07 ........Q.......

    0010:02 01 06 03 02 00 BB                           .......

    --------------------------------------------------------------------

    [42] : <Rx> - 11:39:06.292

    -Type           : 0x04 (Event)

    -EventCode     : 0x00FF (HCI_LE_ExtEvent)

    -Data Length   : 0x1E (30) bytes(s)

    Event         : 0x060D (1549) (GAP_DeviceInformation)

    Status         : 0x00 (0) (Success)

    EventType     : 0x04 (4) (Scan Response)

    AddrType       : 0x00 (0) (Public)

    Addr           : 18:04:ED:C7:14:51

    Rssi           : 0xCB (203)

    DataLength     : 0x11 (17)

    Data           : 07:09:44:65:66:63:6F:6D:05:12:50:00:68:00:02:0A:

                     00

    Dump(Rx):

    0000:04 FF 1E 0D 06 00 04 00 51 14 C7 ED 04 18 CB 11 ........Q.......

    0010:07 09 44 65 66 63 6F 6D 05 12 50 00 68 00 02 0A ..Defcom..P.h...

    0020:00                                             .

    --------------------------------------------------------------------

     

    while after bonding I can only receive the 0x00 (0) (Connectable Undirect Advertisement)

    [16] : <Rx> - 11:41:39.226

    -Type           : 0x04 (Event)

    -EventCode     : 0x00FF (HCI_LE_ExtEvent)

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

    Event         : 0x060D (1549) (GAP_DeviceInformation)

    Status         : 0x00 (0) (Success)

    EventType     : 0x00 (0) (Connectable Undirect Advertisement)

    AddrType       : 0x00 (0) (Public)

    Addr           : 18:04:ED:C7:14:51

    Rssi           : 0xC3 (195)

    DataLength     : 0x07 (7)

    Data           : 02:01:06:03:02:00:BB

    Dump(Rx):

    0000:04 FF 14 0D 06 00 00 00 51 14 C7 ED 04 18 C3 07 ........Q.......

    0010:02 01 06 03 02 00 BB                           .......

    --------------------------------------------------------------------

    I'm attaching also a sniffer LOG from dongle TI (taken after an LP bonding), where for example you can find missing response to LP scan request at point number 357,671 etc. and correct scan response to sphone at point 439, 440 etc

    scan req & resp 1804edc71451 after bonding.psd

    Regarding your last two questions

    I'm working with an LP as a Master in order to be able to test my multi_role product. I've built a Labview application which work using btool command and LP hardware. In this way I'm able to emulate what a future custom mobile application will have to do. 

    I've tryied an LP CC26X2 first version silice (so also here I had to replace the original chip with an CC26R2) with many btool version but I wasn't able to run it correctly. It always give me some errors such "device reset timeout - device may not function properly, so I'm using these board with IAR just to debug my code.

    Lastly, I'm worry about this behaviours, because the SPhone is not the only Master who will have to work with my device. Also Telemathic units (which is one of our businness) will have to work with it too: because at this time I can't test if this problem can happen with these units (as it happening with LP), you can understand why I'm a bit worry.

    Thanks for your help

    Regards, Federico 

      

  • Hi Elin,

    I'm using XCC2642R1FRGZR Revision E. Yes, the board should be fine, also because a TI FAE has follow us during the process.

    Of course the multi_role is deeply modified from the default one.

    I didn't try the newest SDK, however I've tried the sdk_2_40_00_81 default multi_role example on CC2642R1 LP(where I have replaced the original chip with the my CC2642 Revision E) but when I try the pairing process through Btool + LP Master, I always get ''timeout error'' during the sending password step 

    Thanks for your help

    Regards, Federico 

  • Hi Evan,

    I'm sorry but I'm wrote a wrong set up about the  LP CC2640R2 used as Host with Btool: I didn't replace the chip on it, its just a standard LP CC2640R2.

    I have changed the chip only in LP CC2642 because when I received it, its arrived with the first chip silice version. But this I guess its not relevant since I used it only to debug my custom board trough IAR

    Sorry again for my mistake

    Federico

  • Federico,

    Quick question, why are you using SDK 1.35 host_test for a test application?

    If you are expecting to use host_test as a master to test the behavior of how it will work with other devices, you should be using at minimum the latest SDK so that you know you don't have any issues that have been resolved already in many of the releases beforehand. That version of the SDK is many years old and since many issues have been fixed in it. 

    And briefly, to confirm, you are currently not seeing any issues with devices that you expect to work with like phones and other units? I think if this is true, you should do a quick test with a standard out of the box host_test with BTool or simple_central on one of the latest SDKs to see if you see any issues. 

  • Federico,

    Another suggestion to eliminate any potential gaps is to test to see that you see a scan response with when simply pairing and bonding two devices together using simple_peripheral and simple_central. You can find instructions in the readme file of each example on how to use the two button menu to do this. 

  • Hi Evan,

    yes I'm using SDK 1.35 host_test for test application. Actually I was able to test my product (with no issue) only with some SPHones. Our telemathics units are not ready to perform pw and bonding yet.

    This morning I have downloaded the lastest 4_10_00_78 sdk host_test.hex and its relative Btool. Trhough an LP CC2642 used as Master I didn't find the issue we are talking about after a succesful bonding with my multi_role, even if i'm still not able to see the scan response from the sniffer

    From Btool scan I receive always (before and after a sucessful bonding) only these two frame: 

    --------------------------------------------------------------------

    [93] : <Rx> - 12:17:48.077

    -Type           : 0x04 (Event)

    -EventCode     : 0x00FF (HCI_LE_ExtEvent)

    -Data Length   : 0x26 (38) bytes(s)

    Event         : 0x0613 (1555) (GAP_AdvertiserScannerEvent)

    Status         : 0x00 (0) (SUCCESS)

    EventId       : 0x00400000 (4194304) (

                     GAP_EVT_ADV_REPORT)

    AdvRptEventType: 0x13 (19) (Legacy_ADV_IND_or_Data_Complete)

    AddressType   : 0x00 (0) (ADDRTYPE_PUBLIC)

    Address       : 18:04:ED:C7:14:51

    PrimaryPHY     : 0x01 (1) (SCANNED_PHY_1M)

    SecondaryPHY   : 0x00 (0) (SCANNED_PHY_NONE)

    AdvSid         : 0xFF (255)

    TxPower       : 0x7F (127)

    RSSI          : 0xD0 (208)

    DirectAddrType : 0xFF (255) (ADDRTYPE_NONE)

    DirectAddr     : 00:00:00:00:00:00

    PeriodicAdvInt : 0x0000 (0)

    DataLength     : 0x0007 (7)

    Data           : 02:01:06:03:02:00:BB

    Dump(Rx):

    0000:04 FF 26 13 06 00 00 00 40 00 13 00 51 14 C7 ED ..&.....@...Q...

    0010:04 18 01 00 FF 7F D0 FF 00 00 00 00 00 00 00 00 ................

    0020:07 00 02 01 06 03 02 00 BB                     .........

    --------------------------------------------------------------------

    [94] : <Rx> - 12:17:48.087

    -Type           : 0x04 (Event)

    -EventCode     : 0x00FF (HCI_LE_ExtEvent)

    -Data Length   : 0x26 (38) bytes(s)

    Event         : 0x0613 (1555) (GAP_AdvertiserScannerEvent)

    Status         : 0x00 (0) (SUCCESS)

    EventId       : 0x00400000 (4194304) (

                      GAP_EVT_ADV_REPORT)

    AdvRptEventType: 0x13 (19) (Legacy_ADV_IND_or_Data_Complete)

    AddressType   : 0x00 (0) (ADDRTYPE_PUBLIC)

    Address       : 18:04:ED:C7:14:51

    PrimaryPHY     : 0x01 (1) (SCANNED_PHY_1M)

    SecondaryPHY   : 0x00 (0) (SCANNED_PHY_NONE)

    AdvSid         : 0xFF (255)

    TxPower       : 0x7F (127)

    RSSI           : 0xD0 (208)

    DirectAddrType : 0xFF (255) (ADDRTYPE_NONE)

    DirectAddr     : 00:00:00:00:00:00

    PeriodicAdvInt : 0x0000 (0)

    DataLength     : 0x0007 (7)

    Data           : 02:01:06:03:02:00:BB

    Dump(Rx):

    0000:04 FF 26 13 06 00 00 00 40 00 13 00 51 14 C7 ED ..&.....@...Q...

    0010:04 18 01 00 FF 7F D0 FF 00 00 00 00 00 00 00 00 ................

    0020:07 00 02 01 06 03 02 00 BB                     .........

    --------------------------------------------------------------------

    where I can't see my product name 'Defcom' (I assume because these frames aren't from a scan response)  as I was able to see with 1_35_00_33 sdk host_test.hex and its relative Btool before the bonding process:

    Am I missing something?

    Thanks, Federico

    From Btool scan I receive Always

  • Hi Federico,

    Great to hear that you no longer see the issue. Sniffers aren't perfect and won't always catch all packets so it may be that the scan response packet is being missed. 

    This post is very likely relevant to why you do not see the scan response data. 

    https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/658600?LAUNCHXL-CC26X2R1-BTool-Scan-Response-Data

  • Hi  Evan,

    thanks again for your great support. Yes, you're right. This was my fault: I've changed in Btool the Scan from passive to Active trhough GapScan_setPhyParams and now I can receive in Btool also the scan response.

    So at the end of this topic, can we also assume the LP CC2640 running with very old Host_test 1_35_00_33 can give some problems debugging a CC2642 board ?

    Thanks and regards, Federico

  • Hi Federico,

    Yes, it's not recommended to use SDK 1.35. There are many years of fixes to various bugs that could have been manifesting as your IOP issue. I will consider this closed