Bluetooth Common

[δΈ­ζ–‡]

Example

The target-specific HCI-over-UART controller examples have been replaced by a single example, bluetooth/hci/controller_hci_uart, which supports all targets that provide HCI over UART:

Removed example

Targets it used to cover

examples/bluetooth/hci/controller_hci_uart_esp32

ESP32

examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3

ESP32-C3, ESP32-S3

examples/bluetooth/nimble/hci

ESP32-C2, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2, ESP32-H21, ESP32-H4, ESP32-S31

Each removed directory keeps only a README.md that points to the new example. Select the target with idf.py set-target <target>. The HCI UART pins, baud rate, and hardware flow control settings default to the values used by the removed examples, so no rewiring is required.

The unified example relies on the Bluetooth controller to provide the HCI UART transport. Applications derived from the removed examples must therefore be updated accordingly:

The HCI UART pins are now routed by the controller instead of the application. The new option CONFIG_BTDM_CTRL_HCI_UART_INIT_BY_CONTROLLER makes esp_bt_controller_init() enable the HCI UART and UHCI bus clocks and apply CONFIG_BTDM_CTRL_HCI_UART_TX_PIN, CONFIG_BTDM_CTRL_HCI_UART_RX_PIN, and, when CONFIG_BTDM_CTRL_HCI_UART_FLOW_CTRL_EN is enabled, CONFIG_BTDM_CTRL_HCI_UART_RTS_PIN and CONFIG_BTDM_CTRL_HCI_UART_CTS_PIN.

Applications derived from controller_hci_uart_esp32 previously enabled these clocks and configured the UART pins themselves using uart_ll_enable_bus_clock(), uhci_ll_enable_bus_clock(), and uart_set_pin() before calling esp_bt_controller_init(). Remove this code and enable CONFIG_BTDM_CTRL_HCI_UART_INIT_BY_CONTROLLER instead. If the application needs to manage the HCI UART itself, keep the option disabled. When the option is enabled, the controller overrides any HCI UART pins configured by the application.


Was this page helpful?