Skip to content

Commit 44ed0c6

Browse files
gudipudiramanakumarkartben
authored andcommitted
samples: bluetooth: Increase number of buffers for avoiding deadlocks
The central_multilink sample issues various API calls (in particular because it does some from the bt_workq("BT RX WQ")) this results in a deadlock since there are not enough HCI command buffers available, this is causing deadlocks on hardware that do not support BT_HCI_ACL_FLOW_CONTROL. Below is the flow where assert is observed: bt_hci_le_enh_conn_complete() -> bt_conn_connected() -> connected() callback -> start_scan() -> bt_le_scan_start() -> set_random_address() -> bt_hci_cmd_send_sync: opcode 0x2005 -> Controller unresponsive, command opcode 0x2005 timeout with err -11 Since the start_scan is called from the callback and BT RX WQ thread, the command buffers are still not available for the system work queue to process the hci commands it has to send out for starting the scan. By adding additional buffers this deadlock can be avoided. Signed-off-by: Gudipudi Ramana Kumar <ragudipu@silabs.com>
1 parent f7280fa commit 44ed0c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

samples/bluetooth/central_multilink/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ CONFIG_BT_PRIVACY=y
55

66
CONFIG_BT_MAX_CONN=62
77

8+
# Increase the number of buffers to avoid deadlock when running out of buffers
9+
CONFIG_BT_BUF_CMD_TX_COUNT=2
10+
811
# CONFIG_BT_GATT_CLIENT=y
912

1013
# CONFIG_BT_SMP=y

0 commit comments

Comments
 (0)