mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Merge branch 'feat/feat_enable_h21_light_sleep_v6.1' into 'release/v6.1'
fix(ble): disable flash pd config (6.1) See merge request espressif/esp-idf!49217
This commit is contained in:
@@ -30,6 +30,8 @@ This example contains some build configurations. For each configuration, a few c
|
||||
- `sdkconfig.40m.esp32s31`: ESP32S31 uses main XTAL as low power clock in light sleep enabled.
|
||||
- `sdkconfig.defaults.esp32h4`: ESP32H4 uses 32kHz XTAL as low power clock in light sleep enabled.
|
||||
- `sdkconfig.32m.esp32h4`: ESP32H4 uses main XTAL as low power clock in light sleep enabled.
|
||||
- `sdkconfig.defaults.esp32h21`: ESP32H21 uses 32kHz XTAL as low power clock in light sleep enabled.
|
||||
- `sdkconfig.32m.esp32h21`: ESP32H21 uses main XTAL as low power clock in light sleep enabled.
|
||||
|
||||
## How to use example
|
||||
|
||||
|
||||
@@ -1,97 +1,5 @@
|
||||
menu "Example Configuration"
|
||||
|
||||
choice EXAMPLE_MAX_CPU_FREQ
|
||||
prompt "Maximum CPU frequency"
|
||||
default EXAMPLE_MAX_CPU_FREQ_160 if !IDF_TARGET_ESP32H2 && !IDF_TARGET_ESP32C2 && \
|
||||
!IDF_TARGET_ESP32C5 && !IDF_TARGET_ESP32H4 && !IDF_TARGET_ESP32S31
|
||||
default EXAMPLE_MAX_CPU_FREQ_96 if IDF_TARGET_ESP32H2 || IDF_TARGET_ESP32H4
|
||||
default EXAMPLE_MAX_CPU_FREQ_120 if IDF_TARGET_ESP32C2
|
||||
default EXAMPLE_MAX_CPU_FREQ_240 if IDF_TARGET_ESP32C5
|
||||
default EXAMPLE_MAX_CPU_FREQ_320 if IDF_TARGET_ESP32S31
|
||||
depends on PM_ENABLE
|
||||
help
|
||||
Maximum CPU frequency to use for dynamic frequency scaling.
|
||||
|
||||
config EXAMPLE_MAX_CPU_FREQ_80
|
||||
bool "80 MHz"
|
||||
config EXAMPLE_MAX_CPU_FREQ_96
|
||||
bool "96 MHz"
|
||||
depends on IDF_TARGET_ESP32H2 || IDF_TARGET_ESP32H4
|
||||
config EXAMPLE_MAX_CPU_FREQ_160
|
||||
bool "160 MHz"
|
||||
config EXAMPLE_MAX_CPU_FREQ_120
|
||||
bool "120 MHz"
|
||||
depends on IDF_TARGET_ESP32C2
|
||||
config EXAMPLE_MAX_CPU_FREQ_240
|
||||
bool "240 MHz"
|
||||
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C5
|
||||
config EXAMPLE_MAX_CPU_FREQ_320
|
||||
bool "320 MHz"
|
||||
depends on IDF_TARGET_ESP32S31
|
||||
endchoice
|
||||
|
||||
config EXAMPLE_MAX_CPU_FREQ_MHZ
|
||||
int
|
||||
default 80 if EXAMPLE_MAX_CPU_FREQ_80
|
||||
default 96 if EXAMPLE_MAX_CPU_FREQ_96
|
||||
default 120 if EXAMPLE_MAX_CPU_FREQ_120
|
||||
default 160 if EXAMPLE_MAX_CPU_FREQ_160
|
||||
default 240 if EXAMPLE_MAX_CPU_FREQ_240
|
||||
default 320 if EXAMPLE_MAX_CPU_FREQ_320
|
||||
|
||||
choice EXAMPLE_MIN_CPU_FREQ
|
||||
prompt "Minimum CPU frequency"
|
||||
default EXAMPLE_MIN_CPU_FREQ_40M if !IDF_TARGET_ESP32H2 && !IDF_TARGET_ESP32C2 && \
|
||||
!IDF_TARGET_ESP32C5 && !IDF_TARGET_ESP32H4
|
||||
default EXAMPLE_MIN_CPU_FREQ_48M if IDF_TARGET_ESP32C5
|
||||
default EXAMPLE_MIN_CPU_FREQ_32M if IDF_TARGET_ESP32H2 || IDF_TARGET_ESP32H4
|
||||
default EXAMPLE_MIN_CPU_FREQ_26M if IDF_TARGET_ESP32C2
|
||||
depends on PM_ENABLE
|
||||
help
|
||||
Minimum CPU frequency to use for dynamic frequency scaling.
|
||||
Should be set to XTAL frequency or XTAL frequency divided by integer.
|
||||
|
||||
config EXAMPLE_MIN_CPU_FREQ_80M
|
||||
bool "80 MHz"
|
||||
depends on !(IDF_TARGET_ESP32 && EXAMPLE_MAX_CPU_FREQ_240)
|
||||
help
|
||||
ESP32 does not support switching between 240M and 80M.The root cause
|
||||
is that when switching between 240M and 80M, we need to disable
|
||||
BBPLL and then re-enable it with a different frequency.Since the
|
||||
Bluetooth baseband works from PLL frequency, it will temporarily
|
||||
lose its 80 MHz clock, while the BBPLL is disabled.
|
||||
config EXAMPLE_MIN_CPU_FREQ_48M
|
||||
bool "48 MHz (use with 48MHz XTAL)"
|
||||
depends on XTAL_FREQ_48 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_40M
|
||||
bool "40 MHz (use with 40MHz XTAL)"
|
||||
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_32M
|
||||
bool "32 MHz (use with 32MHz XTAL)"
|
||||
depends on IDF_TARGET_ESP32H2 || IDF_TARGET_ESP32H4
|
||||
depends on XTAL_FREQ_32 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_26M
|
||||
bool "26 MHz (use with 26MHz XTAL)"
|
||||
depends on IDF_TARGET_ESP32C2
|
||||
depends on XTAL_FREQ_26 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_20M
|
||||
bool "20 MHz (use with 40MHz XTAL)"
|
||||
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
|
||||
config EXAMPLE_MIN_CPU_FREQ_10M
|
||||
bool "10 MHz (use with 40MHz XTAL)"
|
||||
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
|
||||
endchoice
|
||||
|
||||
config EXAMPLE_MIN_CPU_FREQ_MHZ
|
||||
int
|
||||
default 80 if EXAMPLE_MIN_CPU_FREQ_80M
|
||||
default 48 if EXAMPLE_MIN_CPU_FREQ_48M
|
||||
default 40 if EXAMPLE_MIN_CPU_FREQ_40M
|
||||
default 32 if EXAMPLE_MIN_CPU_FREQ_32M
|
||||
default 26 if EXAMPLE_MIN_CPU_FREQ_26M
|
||||
default 20 if EXAMPLE_MIN_CPU_FREQ_20M
|
||||
default 10 if EXAMPLE_MIN_CPU_FREQ_10M
|
||||
|
||||
choice EXAMPLE_USE_IO_TYPE
|
||||
prompt "I/O Capability"
|
||||
default BLE_SM_IO_CAP_NO_IO
|
||||
|
||||
@@ -573,8 +573,8 @@ app_main(void)
|
||||
// maximum and minimum frequencies are set in sdkconfig,
|
||||
// automatic light sleep is enabled if tickless idle support is enabled.
|
||||
esp_pm_config_t pm_config = {
|
||||
.max_freq_mhz = CONFIG_EXAMPLE_MAX_CPU_FREQ_MHZ,
|
||||
.min_freq_mhz = CONFIG_EXAMPLE_MIN_CPU_FREQ_MHZ,
|
||||
.max_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ,
|
||||
.min_freq_mhz = CONFIG_XTAL_FREQ,
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
.light_sleep_enable = true
|
||||
#endif
|
||||
|
||||
22
examples/bluetooth/nimble/power_save/sdkconfig.32m.esp32h21
Normal file
22
examples/bluetooth/nimble/power_save/sdkconfig.32m.esp32h21
Normal file
@@ -0,0 +1,22 @@
|
||||
CONFIG_IDF_TARGET="esp32h21"
|
||||
|
||||
# Bluetooth Low Power Config
|
||||
CONFIG_BT_LE_SLEEP_ENABLE=y
|
||||
CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL=y
|
||||
|
||||
#
|
||||
# Power Management
|
||||
#
|
||||
CONFIG_PM_ENABLE=y
|
||||
CONFIG_PM_DFS_INIT_AUTO=y
|
||||
CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
|
||||
CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
|
||||
# end of Power Management
|
||||
|
||||
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
@@ -18,6 +18,5 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
@@ -18,6 +18,5 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
@@ -18,6 +18,5 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
@@ -18,6 +18,5 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
@@ -19,7 +19,6 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
CONFIG_IDF_TARGET="esp32h21"
|
||||
|
||||
# Bluetooth Low Power Config
|
||||
CONFIG_BT_LE_SLEEP_ENABLE=y
|
||||
CONFIG_BT_LE_LP_CLK_SRC_DEFAULT=y
|
||||
@@ -16,7 +18,6 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user