diff --git a/components/esp_system/Kconfig b/components/esp_system/Kconfig index 16171815e8..e82335d2d3 100644 --- a/components/esp_system/Kconfig +++ b/components/esp_system/Kconfig @@ -88,7 +88,9 @@ menu "ESP System Settings" default y help If enabled, chip will try to power down flash at light sleep, which costs more time when chip wakes up. - Only can be enabled if there is no SPIRAM configured. + Can only be enabled if there is no SPIRAM configured. This option will in fact consider VDD_SDIO auto power + value (ESP_PD_OPTION_AUTO) as OFF. Also, it is possible to force a power domain to stay ON during light + sleep by using esp_sleep_pd_config() function. config ESP_SYSTEM_PM_POWER_DOWN_CPU bool "Power down CPU in light sleep" diff --git a/components/esp_system/sleep_modes.c b/components/esp_system/sleep_modes.c index 97e41475e6..a1786682fe 100644 --- a/components/esp_system/sleep_modes.c +++ b/components/esp_system/sleep_modes.c @@ -719,7 +719,7 @@ esp_err_t esp_light_sleep_start(void) * If VDD_SDIO power domain is requested to be turned off, bit `RTC_SLEEP_PD_VDDSDIO` * will be set in `pd_flags`. */ - if ((pd_flags & RTC_SLEEP_PD_VDDSDIO) != 0) { + if (pd_flags & RTC_SLEEP_PD_VDDSDIO) { /* * When VDD_SDIO power domain has to be turned off, the minimum sleep time of the * system needs to meet the sum below: diff --git a/docs/en/api-reference/system/sleep_modes.rst b/docs/en/api-reference/system/sleep_modes.rst index b6db0636ac..15bd3d6854 100644 --- a/docs/en/api-reference/system/sleep_modes.rst +++ b/docs/en/api-reference/system/sleep_modes.rst @@ -1,6 +1,8 @@ Sleep Modes =========== +{IDF_TARGET_SPI_POWER_DOMAIN:default="VDD_SPI", esp32="VDD_SDIO"} + Overview -------- @@ -132,6 +134,15 @@ This wakeup mode doesn't require RTC peripherals or RTC memories to be powered o :cpp:func:`esp_sleep_enable_gpio_wakeup` function can be used to enable this wakeup source. + .. warning:: + Before entering light sleep mode, check if any GPIO pin to be driven is part of the {IDF_TARGET_SPI_POWER_DOMAIN} power domain. If so, this power domain must be configured to remain ON during sleep. + + For example, on ESP32-WROOM-32 board, GPIO16 and GPIO17 are linked to {IDF_TARGET_SPI_POWER_DOMAIN} power domain. If they are configured to remain high during + light sleep, the power domain should be configured to remain powered ON. This can be done with :cpp:func:`esp_sleep_pd_config()`:: + + esp_sleep_pd_config(ESP_PD_DOMAIN_VDDSDIO, ESP_PD_OPTION_ON); + + UART wakeup (light sleep only) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^