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.

SIMPLELINK-CC2640R2-SDK: Host_Test firmware on a LAUNCHXL-CC2640R2 - GAP_LinkTerminated with unknown reason

Part Number: SIMPLELINK-CC2640R2-SDK

Hi,

Very occasionally I get and random GAP_LinkTerminated message from the Host_Test setup. I'm not sure if it's our application or the HOST_TEST firmware which is causing the issue there, but the issue I'm really writing about is that the GAP_LinkTerminated message I get from the Host_Test is: 0x04ff0606060000003e.

Which we decode as:

04: Event

FF: HCI_LE_ExtEvent

06: Length = 6

0606: GAP_LinkTerminated

00: SUCCESS

0000: Connection Handle

3E: UNKNOWN REASON

The 0x3E "Reason" parameter is undefined in the TI_BLE_Vendor_Specific_HCI_Guide, please could you let me know what this reason actually is, and ideally update the documentation/TI_BLE_Vendor_Specific_HCI_Guide with that information as well,

Thanks,

Daniel

  • Hi Daniel,

    The reason 0x3E is connectioned failed to be established.

    See hci.h:
    #define HCI_ERROR_CODE_CONN_FAILED_TO_ESTABLISH 0x3E //!< Connection Failued to Establish

    This happens when the central device sends a connect indication, but the slave for some reason didn't see it or is otherwise prevented from joining the connection. After 6 connection events (per the spec) from the start without any packets exchanged, the connection drops with this reason.

    If you want to decode the HCI messages, you can also use BTool (find it in the sdk under tools), it will typically show you what the packet content means.

    Best regards,
    Aslak
  • Hi Aslak,
    The problem is, this is actually after I've had confirmation from the Host Test setup that I've got a connection correctly established (I've received a GAP_LinkEstablished event with a status code of SUCCESS). It therefore can't really be that the connection has failed to be established,

    Thanks,
    Dan
  • Daniel,

    When do you get this event? How long after the first success message does it happen?

    For reference, here's what it looks like in BTool when the slave does not join the connection request:

    In the above it didn't connect because the slave was set up to use whitelist, not including that central.

    I should add that it works this way because the CONN_IND is not acknowledged, so as far as the central is concerned the connection is established the moment it has sent the connection request to the slave.

    Best regards,
    Aslak

  • Hi Aslak,
    Thanks for getting back to me so quickly, I really appreciate it,
    I get it after I send GAP_Bond.
    It doesn't happen every time, but basically it's:
    1. Successfully Connect
    2. Successfully Bond
    3. Receive GAP_LinkTerminated

    There's a matter of milliseconds between these, maximum,

    Could you please confirm whether or not the documentation in the TI_BLE_Vendor_Specific_HCI_Guide will be updated to include the 3E reason and any others which have been missed,

    Thanks,
    Daniel
  • Hi Daniel,

    But you don't get it if you don't send GAP Bond? Also, does this happen all the time?

    It's odd that bonding is successful if you get 0x3E, because well, it should indicate that no communication took place. You're sure the bonding is actually successful and it's not just the reply that the command that is received ok?

    Are you able to get a sniffer trace of the connection?

    I've added a ticket to get the remaining reasons into that document.

    Best regards,
    Aslak