zephyr/samples/bluetooth/central_multilink
Gudipudi Ramana Kumar 44ed0c60ba 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>
2025-05-05 10:57:33 +02:00
..
src samples: bluetooth: Fix scan stop error in central_multilink sample 2025-01-29 07:08:15 +01:00
CMakeLists.txt
Kconfig
prj.conf samples: bluetooth: Increase number of buffers for avoiding deadlocks 2025-05-05 10:57:33 +02:00
README.rst samples: Bluetooth: Rename BLE to Bluetooth (LE) where applicable 2025-02-12 12:24:18 +01:00
sample.yaml hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00

.. zephyr:code-sample:: ble_central_multilink
   :name: Central Multilink
   :relevant-api: bluetooth

   Scan, connect and establish connection to up to 62 peripherals.

Overview
********

Application demonstrating Bluetooth LE Central role functionality by scanning for other
Bluetooth LE devices and establishing connection to up to 62 peripherals with a strong
enough signal.

Requirements
************

* BlueZ running on the host, or
* A board with Bluetooth LE support

Building and Running
********************
This sample can be found under :zephyr_file:`samples/bluetooth/central_multilink`
in the Zephyr tree.

See :zephyr:code-sample-category:`bluetooth` samples for details.