From 119048bb756373cde41cffac49793a0ac4bf6d67 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Sat, 15 Mar 2025 16:16:53 +0800 Subject: [PATCH] fix(bt): Update bt lib for ESP32-C3 and ESP32-S3 (d74042a8) - Remove unused functions in the controller --- components/bt/controller/esp32c3/Kconfig.in | 4 ++-- components/bt/controller/esp32c3/bt.c | 21 +++++++++++++++++++ components/bt/controller/lib_esp32c3_family | 2 +- .../sdkconfig.defaults | 2 ++ .../sdkconfig.defaults | 2 ++ 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/components/bt/controller/esp32c3/Kconfig.in b/components/bt/controller/esp32c3/Kconfig.in index 304295d020..100d66a722 100644 --- a/components/bt/controller/esp32c3/Kconfig.in +++ b/components/bt/controller/esp32c3/Kconfig.in @@ -66,7 +66,7 @@ endchoice config BT_CTRL_HCI_TL int default 0 if BT_CTRL_HCI_MODE_UART_H4 - default 1 if BT_CTRL_HCI_M0DE_VHCI + default 1 if BT_CTRL_HCI_MODE_VHCI default 1 help HCI mode as VHCI or UART(H4) @@ -445,7 +445,7 @@ config BT_CTRL_SLEEP_CLOCK_EFF config BT_CTRL_HCI_TL_EFF int default 0 if BT_CTRL_HCI_MODE_UART_H4 - default 1 if BT_CTRL_HCI_M0DE_VHCI + default 1 if BT_CTRL_HCI_MODE_VHCI default 1 config BT_CTRL_AGC_RECORRECT_EN diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index 2706d4b9e3..fff2a6fca2 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -280,6 +280,13 @@ extern void ets_backup_dma_copy(uint32_t reg, uint32_t mem_addr, uint32_t num, b extern void btdm_cca_feature_enable(void); extern void btdm_aa_check_enhance_enable(void); +#if (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED) +extern void scan_stack_enableAdvFlowCtrlVsCmd(bool en); +extern void adv_stack_enableClearLegacyAdvVsCmd(bool en); +extern void advFilter_stack_enableDupExcListVsCmd(bool en); +extern void chanSel_stack_enableSetCsaVsCmd(bool en); +#endif // (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED) + extern uint32_t _bt_bss_start; extern uint32_t _bt_bss_end; extern uint32_t _bt_controller_bss_start; @@ -1464,6 +1471,13 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) goto error; } +#if (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED) + scan_stack_enableAdvFlowCtrlVsCmd(true); + adv_stack_enableClearLegacyAdvVsCmd(true); + advFilter_stack_enableDupExcListVsCmd(true); + chanSel_stack_enableSetCsaVsCmd(true); +#endif // (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED) + btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED; return ESP_OK; @@ -1485,6 +1499,13 @@ esp_err_t esp_bt_controller_deinit(void) ble_log_spi_out_deinit(); #endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED +#if (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED) + scan_stack_enableAdvFlowCtrlVsCmd(false); + adv_stack_enableClearLegacyAdvVsCmd(false); + advFilter_stack_enableDupExcListVsCmd(false); + chanSel_stack_enableSetCsaVsCmd(false); +#endif // (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED) + btdm_controller_deinit(); bt_controller_deinit_internal(); diff --git a/components/bt/controller/lib_esp32c3_family b/components/bt/controller/lib_esp32c3_family index e668c2d101..aaf54a5f7e 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit e668c2d101ee46ee1950819607694fb852aecae0 +Subproject commit aaf54a5f7e122db70b4a7ff02d2617858d43f649 diff --git a/examples/bluetooth/hci/controller_hci_uart_esp32/sdkconfig.defaults b/examples/bluetooth/hci/controller_hci_uart_esp32/sdkconfig.defaults index f1a0c525ab..4619b9cd54 100644 --- a/examples/bluetooth/hci/controller_hci_uart_esp32/sdkconfig.defaults +++ b/examples/bluetooth/hci/controller_hci_uart_esp32/sdkconfig.defaults @@ -17,3 +17,5 @@ CONFIG_BTDM_CTRL_HCI_MODE_UART_H4=y CONFIG_BTDM_CTRL_HCI_UART_NO=1 CONFIG_BTDM_CTRL_HCI_UART_BAUDRATE=921600 CONFIG_BTDM_CTRL_MODEM_SLEEP=n +CONFIG_BT_CONTROLLER_ONLY=y +CONFIG_BT_CONTROLLER_ENABLED=y diff --git a/examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3/sdkconfig.defaults b/examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3/sdkconfig.defaults index 918faa8a0b..4cb59ea3c3 100644 --- a/examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3/sdkconfig.defaults +++ b/examples/bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3/sdkconfig.defaults @@ -8,4 +8,6 @@ CONFIG_BT_CTRL_HCI_MODE_UART_H4=y CONFIG_BT_CTRL_HCI_TL=0 CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=n CONFIG_BT_CTRL_BLE_SCAN_DUPL=n +CONFIG_BT_CONTROLLER_ONLY=y +CONFIG_BT_CONTROLLER_ENABLED=y # End of deprecated options