WICED SDK 6.6.0: Bluetooth GATT time out and disconnected

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HyKi_4229111
Level 1
Level 1
25 sign-ins 10 sign-ins 5 questions asked

The bluetooth low energy stack calls connection down with a reason of timeout (HCI_ERR_CONNECTION_TOUT) after around 40 seconds to its starting communication. I wonder why it happens and how I disable the timeout.

The callstack when it stops at the breakpoint of connection down would be helpful. The used BTE library was from the old SDK (3.3.1) and the name is "BTE.FreeRTOS.LwIP.ARM_CM4.release.a", size of 1,231,264 bytes.

(gdb) bt
#0 ble_config_gatts_connection_down (p_status=0x2001e7b8)
at ../../third_party/connectedhomeip/src/platform/WI2/wi2_bluetooth.c:534
#1 0x080c217e in ble_config_gatts_conn_status_cb (p_status=0x2001e7b8)
at ../../third_party/connectedhomeip/src/platform/WI2/wi2_bluetooth.c:556
#2 0x080c2336 in ble_config_gatts_callback (event=GATT_CONNECTION_STATUS_EVT, p_data=0x2001e7b8)
at ../../third_party/connectedhomeip/src/platform/WI2/wi2_bluetooth.c:696
#3 0x080d459c in gatt_cleanup_upon_disc ()
#4 0x080d169e in l2cu_process_fixed_disc_cback ()
#5 0x080d18fa in l2cu_release_lcb ()
#6 0x080cf3d6 in l2c_link_hci_disc_comp ()
#7 0x080cc5e2 in btu_hcif_process_event ()
#8 0x080cd048 in btu_task ()
#9 0x08024de8 in pxPortInitialiseStack (pxTopOfStack=0xa5a5a5a5, pxCode=0xa5a5a5a5, pvParameters=0xa5a5a5a5)
at ../../third_party/connectedhomeip/third_party/wiced_sdk/repo/WICED/RTOS/FreeRTOS/ver9.0.0/Source/portable/GCC/ARM_CM3/port.c:231

 

0 Likes
1 Solution
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

The log didn't give much information here. We can only know that the device received a connection down event when it's processing HCI events. The connection was lost unexpectedly.

You can try to print the event data of the event GATT_CONNECTION_STATUS_EVT, to see what reason the stack had captured.

And you can output the Bluetooth protocol trace via UART by the function wiced_bt_dev_register_hci_trace(). This should give you enough information on what's happening in the stack. See the manual:
https://github.com/Infineon/CypressAcademy_BT101_Files/blob/master/PDFs/WBT101-05-Debugging.pdf

Best regards

View solution in original post

0 Likes
2 Replies
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

The log didn't give much information here. We can only know that the device received a connection down event when it's processing HCI events. The connection was lost unexpectedly.

You can try to print the event data of the event GATT_CONNECTION_STATUS_EVT, to see what reason the stack had captured.

And you can output the Bluetooth protocol trace via UART by the function wiced_bt_dev_register_hci_trace(). This should give you enough information on what's happening in the stack. See the manual:
https://github.com/Infineon/CypressAcademy_BT101_Files/blob/master/PDFs/WBT101-05-Debugging.pdf

Best regards

0 Likes
HyKi_4229111
Level 1
Level 1
25 sign-ins 10 sign-ins 5 questions asked

As I typed in the original message, the reason code is 8 (= HCI_ERR_CONNECTION_TOUT). It seems that HCI controller on the radio chip (4343WA1) created  a timeout message. The BLE stack library I'm using has no function wiced_bt_dev_register_hci_trace(), so it's not helpful to trace uart.

I just wonder what would generate such a timeout. The device has run almost 40 seconds since it was connected and exchanges lots of messages to the client (mainly send_indication/receive_read/receive_indication_confirmed/receive_write), then suddenly disconnected. Please check what is 40 sec disconnection.

0 Likes