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 UHCI-based HCI UART transport is now provided by the controller instead of the application. The new option CONFIG_BT_CTRL_HCI_UART_INIT_BY_CONTROLLER makes esp_bt_controller_init() install the transport and fill in esp_bt_controller_config_t::hci_tl_funcs using the settings configured under the HCI UART(H4) Options menu, including CONFIG_BT_CTRL_HCI_UART_PORT, CONFIG_BT_CTRL_HCI_UART_BAUDRATE, CONFIG_BT_CTRL_HCI_UART_FLOW_CTRL_EN, and the TX, RX, RTS, and CTS pins.

Applications derived from controller_hci_uart_esp32c3_and_esp32s3 previously implemented this transport using LL and register access in their own source files. Remove this code and enable CONFIG_BT_CTRL_HCI_UART_INIT_BY_CONTROLLER instead.

When CONFIG_BT_CTRL_HCI_MODE_UART_H4 is selected, esp_bt_controller_init() requires either esp_bt_controller_config_t::hci_tl_funcs to be provided or CONFIG_BT_CTRL_HCI_UART_INIT_BY_CONTROLLER to be enabled. Otherwise, it reports the missing transport and returns ESP_ERR_INVALID_ARG.

For Direct Test Mode, CONFIG_BT_CTRL_HCI_UART_DTM_MODE configures the HCI UART without hardware flow control. The new function esp_bt_hci_uart_reconfig_pin(), declared in /bt/include/esp32c3/include/esp_bt.h, can be used to change the TX and RX pins at runtime.


Was this page helpful?