diff --git a/components/bt/porting_btdm/Kconfig.in b/components/bt/porting_btdm/Kconfig.in index bb1f346c8e7..896800d20ab 100644 --- a/components/bt/porting_btdm/Kconfig.in +++ b/components/bt/porting_btdm/Kconfig.in @@ -33,6 +33,28 @@ config BT_CTRL_SLEEP_ENABLE help Enable Bluetooth Controller sleep +choice BT_CTRL_LP_CLK_SRC + prompt "Bluetooth low power clock source" + default BT_CTRL_LP_CLK_SRC_MAIN_XTAL + depends on BT_CTRL_SLEEP_ENABLE + config BT_CTRL_LP_CLK_SRC_MAIN_XTAL + bool "Use main XTAL as RTC clock source" + help + User main XTAL as RTC clock source. + This option is recommended if external 32.768k XTAL is not available. + Using the external 32.768 kHz XTAL will have lower current consumption + in light sleep compared to using the main XTAL. + + config BT_CTRL_LP_CLK_SRC_DEFAULT + depends on (RTC_CLK_SRC_EXT_CRYS || !BT_CTRL_BREDR_ENABLE) + bool "Use system RTC slow clock source" + help + Use the same slow clock source as system RTC + Using any clock source other than external 32.768 kHz XTAL supports only + legacy ADV and SCAN due to low clock accuracy. + +endchoice + config BT_DUAL_MODE_ARCH bool default y diff --git a/components/bt/porting_btdm/controller/ble/Kconfig.in b/components/bt/porting_btdm/controller/ble/Kconfig.in index 74f6aaf843d..973cff7b7c5 100644 --- a/components/bt/porting_btdm/controller/ble/Kconfig.in +++ b/components/bt/porting_btdm/controller/ble/Kconfig.in @@ -433,27 +433,6 @@ config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF default 1 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN default 0 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS -choice BT_LE_LP_CLK_SRC - prompt "BLE low power clock source" - default BT_LE_LP_CLK_SRC_MAIN_XTAL - depends on BT_CTRL_SLEEP_ENABLE - config BT_LE_LP_CLK_SRC_MAIN_XTAL - bool "Use main XTAL as RTC clock source" - help - User main XTAL as RTC clock source. - This option is recommended if external 32.768k XTAL is not available. - Using the external 32.768 kHz XTAL will have lower current consumption - in light sleep compared to using the main XTAL. - - config BT_LE_LP_CLK_SRC_DEFAULT - bool "Use system RTC slow clock source" - help - Use the same slow clock source as system RTC - Using any clock source other than external 32.768 kHz XTAL supports only - legacy ADV and SCAN due to low clock accuracy. - -endchoice - config BT_LE_USE_ESP_TIMER bool "Enable Esp Timer for Callout" depends on !BT_NIMBLE_ENABLED diff --git a/components/bt/porting_btdm/controller/btdm_common/src/btdm_lp.c b/components/bt/porting_btdm/controller/btdm_common/src/btdm_lp.c index 51cb9efa3cd..5c76d348221 100644 --- a/components/bt/porting_btdm/controller/btdm_common/src/btdm_lp.c +++ b/components/bt/porting_btdm/controller/btdm_common/src/btdm_lp.c @@ -112,7 +112,7 @@ static void btdm_lp_timer_clk_init(esp_btdm_controller_config_t *cfg) { if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) { -#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL +#if CONFIG_BT_CTRL_LP_CLK_SRC_MAIN_XTAL s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL; s_bt_lpclk_freq = s_bt_xtal_lpclk_freq; #else @@ -141,7 +141,7 @@ btdm_lp_timer_clk_init(esp_btdm_controller_config_t *cfg) ESP_LOGE(BTDM_LOG_TAG, "Unsupported clock source"); assert(0); #endif -#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */ +#endif /* CONFIG_BT_CTRL_LP_CLK_SRC_MAIN_XTAL */ } btdm_lp_rtc_slow_clk_select(s_bt_lpclk_src); @@ -277,7 +277,6 @@ btdm_lp_modem_state_deinit(void) * Public Function Definitions *************************************************************************************************** */ -#include "modem/modem_syscon_reg.h" void btdm_lp_enable_clock(esp_btdm_controller_config_t *cfg) { @@ -319,7 +318,7 @@ btdm_lp_init(void) rc = btdm_lp_modem_state_init(); assert(rc == 0); esp_sleep_enable_bt_wakeup(); - ESP_LOGW(BTDM_LOG_TAG, "Enable light sleep, the wake up source is BLE timer"); + ESP_LOGW(BTDM_LOG_TAG, "Enable light sleep, the wake up source is modem lp timer"); rc = esp_pm_register_inform_out_light_sleep_overhead_callback(r_btdm_sleep_wake_up_overhead_set); if (rc != ESP_OK) { diff --git a/examples/bluetooth/nimble/power_save/sdkconfig.32m.esp32h4 b/examples/bluetooth/nimble/power_save/sdkconfig.32m.esp32h4 index 2b80206b234..d0b6997e04d 100644 --- a/examples/bluetooth/nimble/power_save/sdkconfig.32m.esp32h4 +++ b/examples/bluetooth/nimble/power_save/sdkconfig.32m.esp32h4 @@ -2,7 +2,7 @@ CONFIG_IDF_TARGET="esp32h4" # Bluetooth Low Power Config CONFIG_BT_CTRL_SLEEP_ENABLE=y -CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL=y +CONFIG_BT_CTRL_LP_CLK_SRC_MAIN_XTAL=y # # Power Management diff --git a/examples/bluetooth/nimble/power_save/sdkconfig.40m.esp32s31 b/examples/bluetooth/nimble/power_save/sdkconfig.40m.esp32s31 index 04ec97e7476..c14fc0f2238 100644 --- a/examples/bluetooth/nimble/power_save/sdkconfig.40m.esp32s31 +++ b/examples/bluetooth/nimble/power_save/sdkconfig.40m.esp32s31 @@ -2,7 +2,7 @@ CONFIG_IDF_TARGET="esp32s31" # Bluetooth Low Power Config CONFIG_BT_CTRL_SLEEP_ENABLE=y -CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL=y +CONFIG_BT_CTRL_LP_CLK_SRC_MAIN_XTAL=y # # Power Management diff --git a/examples/bluetooth/nimble/power_save/sdkconfig.defaults.esp32h4 b/examples/bluetooth/nimble/power_save/sdkconfig.defaults.esp32h4 index 9ae22dda16e..81ae8488cf5 100644 --- a/examples/bluetooth/nimble/power_save/sdkconfig.defaults.esp32h4 +++ b/examples/bluetooth/nimble/power_save/sdkconfig.defaults.esp32h4 @@ -2,7 +2,7 @@ CONFIG_IDF_TARGET="esp32h4" # Bluetooth Low Power Config CONFIG_BT_CTRL_SLEEP_ENABLE=y -CONFIG_BT_LE_LP_CLK_SRC_DEFAULT=y +CONFIG_BT_CTRL_LP_CLK_SRC_DEFAULT=y # # Power Management diff --git a/examples/bluetooth/nimble/power_save/sdkconfig.defaults.esp32s31 b/examples/bluetooth/nimble/power_save/sdkconfig.defaults.esp32s31 index f177cb44ca6..8ec249419c3 100644 --- a/examples/bluetooth/nimble/power_save/sdkconfig.defaults.esp32s31 +++ b/examples/bluetooth/nimble/power_save/sdkconfig.defaults.esp32s31 @@ -2,7 +2,7 @@ CONFIG_IDF_TARGET="esp32s31" # Bluetooth Low Power Config CONFIG_BT_CTRL_SLEEP_ENABLE=y -CONFIG_BT_LE_LP_CLK_SRC_DEFAULT=y +CONFIG_BT_CTRL_LP_CLK_SRC_DEFAULT=y # # Power Management