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: The CC2642, when it connects to the same device before the connection timeout occurs, does not trigger the connection event.

Part Number: CC2642R

Hi,

The CC2642, when acting as a peripheral, can support up to 3 connections. After a smartphone connects, if the CC2642 actively requests to disconnect, the smartphone will disconnect immediately upon receiving the request and attempt to reconnect (since the CC2642 supports multiple connections, it continuously broadcasts). If the CC2642 does not receive an acknowledgment of disconnection from the smartphone, it will wait for 6 seconds before triggering the GAP_LINK_TERMINATED_EVENT event (the current connection timeout is set to 6 seconds). If, within these 6 seconds, the same smartphone reconnects to the CC2642, the application layer will not receive the GAP_LINK_ESTABLISHED_EVENT event. After 6 seconds, it will receive the GAP_LINK_TERMINATED_EVENT event, but at this point, the smartphone will have remained connected to the CC2642. However, the application layer will perceive that there is no connection.

sdk:simplelink_cc13xx_cc26xx_sdk_7_10_01_24

  • Hi,

    Thank you for reaching the support, 

    Could you share more details on how you send the disconnection request, also do you observe the same behavior with 2 connections?

    Finally, if you can collect them easily, it will be helpful if you could provide sniffer logs.

    Regards

    Tanguy

  • Hi,

    I am using the multi_role project, which supports acting as a central role to connect to a peripheral, and as a peripheral role to connect to 3 smartphones. During stress testing, I connect one peripheral and one smartphone, and every minute I call the GAP_TerminateLinkReq interface to disconnect all connections, after which they will automatically reconnect.

    1、This is actively disconnecting peripherals when doing a central role. The GAP_LINK_TERMINATED_EVENT event is received about 300ms after this time.

    2、This is the time to do the central role and actively disconnect the phone. The GAP_LINK_TERMINATED_EVENT event is received about 6000ms after this time.

    3、The phone disconnects for 2 seconds and then reconnects successfully, but this time no GAP_LINK_ESTABLISHED_EVENT event is triggered.

    8836.test.rar

  • Hi,

    Thanks for reaching out and providing the logs. Are you able to reproduce this using SDK examples with minimal modifications? It seems so, but I would like to confirm. If that is the case, then can you try reproducing it on the latest SDK (7.40.00.77)?

    Best Regards,

    Jan

  • HI,

    Connecting with a cell phone requires a lot of authentication-related logic, and the porting engineering workload is high. I want to be able to detect this exception when it occurs and then do a reset. When I added the log print, I found that the linkDB_NumActive interface returns 0 when this problem occurs, and the llDataGetConnPtr and linkDB_State interfaces also return invalid state, so I can't recognize the exception, is there any other way to detect it, and I can add validation in the log.

    Translated with DeepL.com (free version)

  • Hi,

    Understood. Does this happen with both iOS and Android?

    Best Regards,

    Jan

  • Hi,

    Only IOS has this problem

  • Hi,

    Got it. I have a few more questions that I am hoping can point us in the right direction.

    1. Are you using a custom iOS application to perform the connection/disconnection? If so, then what happens if you add a delay before trying to reconnect?

    2. Does the central device perform a scan after disconnecting and then connect using a freshly scanned advertisement?

    3. Is the peripheral device advertising at all times?

    Best Regards,

    Jan

  • Hi,

    Use custom iOS applications. After disconnecting the IOS, increase the delay and wait for CC2642 to timeout before reconnecting without any issues.

    1. Are you using a custom iOS application to perform the connection/disconnection? If so, then what happens if you add a delay before trying to reconnect?

    Yes

    2. Does the central device perform a scan after disconnecting and then connect using a freshly scanned advertisement?

    Yes

    3. Is the peripheral device advertising at all times?

    I have already ported the latest SDK (simplelink_cc13xx_cc26xx_sdk_7_40:00_77), but this issue still occurs during testing.

  • Hi,

    Thank you for providing the requested information and for testing on the latest SDK. I have filed a ticket to get this addressed by R&D. In the meantime, I would like to try to find a workaround. Can you try reducing the supervision timeout to a smaller value to see if that bypasses the behavior you are seeing?

    Best Regards,

    Jan

  • HI,

    I've observed that sometimes the APP connects in just 2 seconds, so the timeout cannot be set too short. Since the APP is a third-party generic APP, it currently does not support modifying its functions.

    I currently need to find a strategy to avoid this issue as soon as possible, it could be resetting or any other method, mainly to be able to avoid this problem.

    I want to add some log detection for this issue within the LL_ConnectionCompleteCallback function, but after adding the hci_event.c file to the project, there are many problems with duplicate function definitions during compilation. Is there a way to solve this?

  • Hi,

    It should be possible to add the hci_event.c file to your project and change the function as desired. However, you may need to remove the include path in your project properties that links to the original file in the SDK. Can you verify that these are not present and you can compile the project?

    Best Regards,

    Jan

  • Hi,

    I am using the IAR environment, and this file should be defined in ble_r2.symbols. Is ble_r2.symbols similar to a library?

  • Hi,

    My apologies, I thought you had meant that the hci_event.c file contained the functions you needed to modify. If the functions are located in the symbols file, then I believe these are provided pre-compiled with the SDK.

    I am investigating if this behavior may be linked to a resolved known issue in the SDK: https://sir.ext.ti.com/jira/browse/EXT_EP-10326

    Can you set the number of max connections to 1 and attempt to reproduce the behavior?

    Best Regards,

    Jan

  • Hi,

    This problem did not occur after configuring a maximum of one device to be connected.

    Can you set the number of max connections to 1 and attempt to reproduce the behavior?
  • Hi,

    Got it. I think this issue may be related the ticket I linked earlier. I have shared this information with R&D and hope to get a response in the coming days. In the meantime, I want us to try to find a workaround. What happens if the central device performs a GATT write or read on the CC2642R after the behavior occurs? Does the CC2642R receive any GATT callbacks or app messages?

    Best Regards,

    Jan

  • HI,

    When this issue occurs, the phone does not detect the service successfully, and therefore cannot send data.

    I have also found the following problem on the same phone:

    1. The first connection is successful, triggering the GAP_LINK_ESTABLISHED_EVENT with a connection handle of 0.
    2. The CC2642 actively requests a disconnection.
    3. The phone receives the connection request, immediately disconnects, and then rescans for devices before initiating a connection.
    4. The CC2642 may not receive the phone's response and will not disconnect immediately; it only triggers the GAP_LINK_TERMINATED_EVENT in step 6.
    5. The second connection is successful, triggering the GAP_LINK_ESTABLISHED_EVENT with a connection handle of 1, and the MAC address is the same as that of handle 0.
    6. The first connection is disconnected, triggering the GAP_LINK_TERMINATED_EVENT with a connection handle of 0.

  • Hi,

    Understood, I will add this additional information to the ticket for R&D to see if it is helpful. When the service not detected successfully, does that instantly trigger a disconnect?

    Best Regards,

    Jan

  • Hi,

    Will not disconnect immediately

  • Hello Wangrenli,

    I am working on reproducing the issue and trying to spot differences between the sniffer logs when working with IOS vs Android. If you can help me providing the logs screenshots that shows differences in IOS and Android behaviour that would be helpful as well as I understand you are running a costume application. Nonetheless we already have important insights to look into the issue along with the R&D team and I will do my best to update you tomorrow on the next steps.

    BR,

    David.

  • Hi,

    May I ask if there is any update on this?

    I have the LOG printed by a third party app and when the problem occurred, I compared it and found that I could not subscribe to NOTIFY. this is the LOG for an Android phone.

    ble_log(1).rar

  • Hello Wagrenli,

    Then this is also reproducible from Android and not only IOs correct? I assume there is no difference in the software running on the peripheral between the first successful and second (problematic) log correct?

    Can we make sure we have still enabled notifications from the central in both cases? This we need to verify on the mobile app side.

    BR,

    David.