Merge branch 'bugfix/controller_hci_uart_esp32c3_readme' into 'master'

Added support for ESP32-S3 chip in controller_hci_uart_esp32c3_and_esp32s3's README

Closes BT-1906

See merge request espressif/esp-idf!16583
This commit is contained in:
Wang Meng Yang 2022-02-09 11:17:28 +00:00
commit e640060e2d
8 changed files with 27 additions and 19 deletions

View File

@ -12,11 +12,11 @@ Demonstrates interaction with controller through HCI over UART on ESP32.
See the [README.md](./controller_hci_uart_esp32/README.md) file in the example [controller_hci_uart](./controller_hci_uart_esp32).
## controller_hci_uart_esp32c3
## controller_hci_uart_esp32c3_and_esp32s3
Demonstrates interaction with controller through HCI over UART on ESP32-C3.
Demonstrates interaction with controller through HCI over UART on ESP32-C3/ESP32-S3.
See the [README.md](./controller_hci_uart_esp32c3/README.md) file in the example [controller_hci_uart](./controller_hci_uart_esp32c3).
See the [README.md](./controller_hci_uart_esp32c3_and_esp32s3/README.md) file in the example [controller_hci_uart_esp32c3_and_esp32s3](./controller_hci_uart_esp32c3_and_esp32s3).
## controller_vhci_ble_adv

View File

@ -1,2 +0,0 @@
idf_component_register(SRCS "uhci_uart_demo.c"
INCLUDE_DIRS "")

View File

@ -1,5 +1,5 @@
| Supported Targets | ESP32-C3 |
| ----------------- | -------- |
| Supported Targets | ESP32-C3 | ESP32-S3 |
| ----------------- | -------- | -------- |
ESP-IDF UART HCI Controller
=================================
@ -60,20 +60,19 @@ See the Getting Started Guide for full steps to configure and use ESP-IDF to bui
The example sets up the HCI UART transport and enable Bluetooth Controller, after started. UART1 PIN and baudrate settings is printed at serial output:
```
I (296) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (296) gpio: GPIO[6]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (306) gpio: GPIO[4]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (316) gpio: GPIO[6]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (326) BTDM_INIT: BT controller compile version [6ab3130]
I (336) coexist: coexist rom version 8459080
I (336) phy_init: phy_version 500,985899c,Apr 19 2021,16:05:08
I (466) system_api: Base MAC address is not set
I (466) system_api: read default base MAC address from EFUSE
I (476) BTDM_INIT: Bluetooth MAC: 7c:df:a1:40:3f:16
I (306) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (306) gpio: GPIO[6]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (316) gpio: GPIO[5]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (326) gpio: GPIO[7]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (336) BTDM_INIT: BT controller compile version [33175c8]
I (346) phy_init: phy_version 907,3369105-dirty,Dec 3 2021,14:55:12
I (406) system_api: Base MAC address is not set
I (406) system_api: read default base MAC address from EFUSE
I (406) BTDM_INIT: Bluetooth MAC: 7c:df:a1:61:e5:36
I (476) UHCI: HCI messages can be communicated over UART1:
I (406) UHCI: HCI messages can be communicated over UART1:
--PINs: TxD 4, RxD 5, RTS 6, CTS 7
--Baudrate: 921600
--Baudrate: 115200
```
After these output occurs, HCI messages can be commnunicated over UART1.

View File

@ -0,0 +1,2 @@
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "")

View File

@ -11,6 +11,7 @@
#include "soc/lldesc.h"
#include "esp_private/gdma.h"
#include "hal/uhci_ll.h"
#include "nvs_flash.h"
#include "esp_bt.h"
#include "esp_log.h"
@ -253,6 +254,14 @@ void app_main(void)
{
esp_err_t ret;
/* Initialize NVS — it is used to store PHY calibration data */
ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK( ret );
uhci_uart_install();
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();