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.

BLE Connection fails with wl1835



Hello,

We are working with hardware simitlar to Beaglebone Black in a BLE GATT server which implements standard services and other custom ones using the Bluetopia stack v.3.9 (TIInit_11.8.32.bts).

There is an issue when establishing an LE connection. Sometimes the connection fails with Error Domain=CBErrorDomain Code=10 "The connection has failed unexpectedly." on the client side and the server isn't aware of that, it does never receive the disconnection event. I saw this question, (https:// e2e.ti.com/support/wireless_connectivity/bluetooth_cc256x/f/660/t/242821) and the answer basically says that there is no way to recover from this until i receive a disconnection event, which i never do anymore.  I've tried cleaning up the GATT profile and unregister every service to restart it all again, which i managed to do successfully, but it doesn't work. When i try to advertise again GAP_LE_Advertising_Enable returns the error BTPS_ERROR_INVALID_DEVICE_ROLE_MODE. I also tried issuing a GAP_LE_Disconnect which fails with the error code -502.

This issue also happens with the LinuxSPPLE Demo provided  with every kind of LE GATT client we tried so far.

Is there any solution for this?

Thank you in advance.

Pedro. 

  • Hi Pedro,

    1. 3.9 is which version? stack or service pack?
    2. Are you using the latest TI BT stack? www.ti.com/.../TI-BT-STACK_LINUX-ADDON
    3. Do you know the exact step to recreate the issue? How frequently does it occur?
    4. As a start, can you please share the snoop log from the TI BT stack side? - processors.wiki.ti.com/.../TI_Bluetooth_Stack_for_WL18xx_-_Demo_Guide

    I might need air sniffer/ logger logs as well...

    Regards,
    Gigi Joseph.
  • Hello Joseph,

    1. The service pack version.
    2. We are using stack version is the 4.0.1.4.
    3. Yes but it happens only around 20% of the time.
    4. Ok i can provide you that.

    Thank you.
    Regards,
    Pedro.
  • Hello Joseph.

    I have a new question, we found out that the LinuxSPPLE sample that uses the PM (LinuxSPPLE_PM) works just fine, and it's running the same stack version with the same drivers. However, the sample without the PM doesn't work well as mentioned. So it doesn't seem to be a problem with the stack version or the wilink driver version but rather some bug on the sample code itself. Do you have any clues on what may be causing it?

    Thank you.

    Regars,

    Pedro.

  • Hi Pedro,

    Thanks for this update.
    You should actually be using the LinuxSPPLE_PM sample application on Linux (BeagleBone/AM335x).
    The demo instructions are available at: processors.wiki.ti.com/index.php

    Please also see the Bluetopia/Bluetopia PM overview at: processors.wiki.ti.com/.../TI_Bluetooth_Stack_for_WL18xx_-_Getting_Started_Guide


    Regards,
    Gigi Joseph,
  • Hello Gigi,

    Just to make sure I understand, I should not use the sample in the profile_gatt of the stack version 4.0.1.4. Actually this sample is not present in the current version of the stack. 

    Thank you,

    Regards,

    Pedro.

  • Hi Pedro,

    You should be using the sample apps from : "\BluetopiaPM\bin\".
    Anyway, thanks for the confirmation, I will mark this as "Answered".

    Regards,
    Gigi Joseph.
  • Hello Gigi,

    But we would like to use the stack without using the PM. That's why we used the sample code without it, I'm referring to the code in BluetopiaPM/Bluetopia/profiles_gatt/sample/LinuxSPPLE/. (stack version 4.0.1.4)
    Isn't that possible? Can you help me on that?

    Thank you.
    Regards,
    Pedro.
  • Hi Pedro,

    "But we would like to use the stack without using the PM"
    >>> can you please explain why?
    It would be possible, but please note that you'd be "limited because only one application has access to the Bluetooth Controller at a time. This can make development difficult and complicated if multiple profiles are using the Bluetooth Controller concurrently."

    Regards,
    Gigi Joseph.
  • Hello Gigi.

    We have multiple profiles but only one application implements all of them so we don't need the PM. The reason for this is to achieve the minimum latency.

    UPDATE on the original question.

    We activated the BSC_RegisterDebugCallback to get the HCI packets hoping to find some clues on whats causing the connection to hang. And actually there is a difference. The prints from the LinuxLE Demo with the packets prints for both the success connection and the failed one are as follows:

    SUCCESS:

    Client>AdvertiseLE 1

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 35 | Data: 0x8 0x20 0x20 0x3 0x2 0x1 0x2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0x8 0x20 0

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 35 | Data: 0x9 0x20 0x20 0xb 0xa 0x9 0x53 0x50 0x50 0x4c 0x45 0x44 0x65 0x6d 0x6f 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0x9 0x20 0

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 18 | Data: 0x6 0x20 0xf 0xa0 0 0x40 0x1 0 0 0 0 0 0 0 0 0 0x7 0

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0x6 0x20 0

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 4 | Data: 0xa 0x20 0x1 0x1

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0xa 0x20 0

      GAP_LE_Advertising_Enable success.

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 21 | Data: 0x3e 0x13 0x1 0 0x1 0x4 0x1 0 0x4 0x71 0xda 0x7d 0x1a 0 0x38 0 0 0 0x2a 0 0x1

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 4 | Data: 0xa 0x20 0x1 0

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0xa 0x20 0xc

    etLE_Connection_Complete with size 20.

      Status:       0x00.

      Role:         Slave.

      Address Type: Public.

      BD_ADDR:      0x001A7DDA7104.

    LE>

    etGATT_Connection_Device_Connection with size 16:

      Connection ID:   1.

      Connection Type: LE.

      Remote Device:   0x001A7DDA7104.

      Connection MTU:  23.

    FAIL:

    Client>AdvertiseLE 1

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 35 | Data: 0x8 0x20 0x20 0x3 0x2 0x1 0x2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0x8 0x20 0

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 35 | Data: 0x9 0x20 0x20 0xb 0xa 0x9 0x53 0x50 0x50 0x4c 0x45 0x44 0x65 0x6d 0x6f 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0x9 0x20 0

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 18 | Data: 0x6 0x20 0xf 0xa0 0 0x40 0x1 0 0 0 0 0 0 0 0 0 0x7 0

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0x6 0x20 0

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 4 | Data: 0xa 0x20 0x1 0x1

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0xa 0x20 0

      GAP_LE_Advertising_Enable success.

    Client>

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 21 | Data: 0x3e 0x13 0x1 0 0x1 0x4 0x1 0 0x4 0x71 0xda 0x7d 0x1a 0 0x38 0 0 0 0x2a 0 0x1

    HCI-Packet Sent

    Type: ptHCICommandPacket

    Size: 4 | Data: 0xa 0x20 0x1 0

    HCI-Packet Received

    Type: ptHCIEventPacket

    Size: 6 | Data: 0xe 0x4 0x1 0xa 0x20 0

    etLE_Connection_Complete with size 20.

      Status:       0x00.

      Role:         Slave.

      Address Type: Public.

      BD_ADDR:      0x001A7DDA7104.

    LE>

    etGATT_Connection_Device_Connection with size 16:

      Connection ID:   2.

      Connection Type: LE.

      Remote Device:   0x001A7DDA7104.

      Connection MTU:  23.

    On the las HCI-Packet received there is a difference on the last byte. On the success case it is 0x0c and on failed it is 0x00.

    Could this help?

    Thank you Gigi.

    Regards,

    Pedro.

  • Hi Pedro,

    If possible, please share the full snoop logs in btsnoop (FTS) format - processors.wiki.ti.com/.../TI_Bluetooth_Stack_for_WL18xx_-_Demo_Guide

    Anyway,

    0e 04 01 0a 20 0c => "Command Disallowed" for HCI_LE_Set_Advertising_Enable command (most likely because advertising is already enabled)
    0e 04 01 0a 20 00=> "Success for HCI_LE_Set_Advertising_Enable command.

    Please try to share additional logs (logger/air sniffer/) to further isolate the issue.
    Please also try with the latest release.

    Regards,
    Gigi Joseph.
  • Hi,

    Any update?

    Regards,
    Gigi Joseph.
  • Hello Gigi,

    Sorry for the delay in response. In fact the new Bluetopia stack seems to solve the problem we had.

    Thank you for your support.
    Pedro.
  • Hi Pedro,

    Thanks for the update, I will mark this as closed.

    Regards,
    Gigi Joseph.