From cb139b4386732d3184394a92522db94bdfbeb1d2 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Mon, 19 Jun 2023 19:06:44 +0800 Subject: [PATCH] change(esp_hw_support): improve ESP_SLEEP_PSRAM/FLASH_LEAKAGE_WORKAROUND help doc in Kconfig --- components/esp_hw_support/Kconfig | 70 ++++++++++++++++++------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/components/esp_hw_support/Kconfig b/components/esp_hw_support/Kconfig index 8bb5af2592..f314e4f694 100644 --- a/components/esp_hw_support/Kconfig +++ b/components/esp_hw_support/Kconfig @@ -49,6 +49,48 @@ menu "Hardware Settings" to ESP_PD_OPTION_OFF. It should be noted that there is a risk in powering down flash, you can refer `ESP-IDF Programming Guide/API Reference/System API/Sleep Modes/Power-down of Flash` for more details. + config ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND + bool "Pull-up Flash CS pin in light sleep" + depends on !ESP_SLEEP_POWER_DOWN_FLASH + default y + help + All IOs will be set to isolate(floating) state by default during sleep. + Since the power supply of SPI Flash is not lost during lightsleep, if its CS pin is recognized as + low level(selected state) in the floating state, there will be a large current leakage, and the + data in Flash may be corrupted by random signals on other SPI pins. + Select this option will set the CS pin of Flash to PULL-UP state during sleep, but this will + increase the sleep current about 10 uA. + If you are developing with esp32xx modules, you must select this option, but if you are developing + with chips, you can also pull up the CS pin of SPI Flash in the external circuit to save power + consumption caused by internal pull-up during sleep. + (!!! Don't deselect this option if you don't have external SPI Flash CS pin pullups.) + + config ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND + bool "Pull-up PSRAM CS pin in light sleep" + depends on SPIRAM + default y + help + All IOs will be set to isolate(floating) state by default during sleep. + Since the power supply of PSRAM is not lost during lightsleep, if its CS pin is recognized as + low level(selected state) in the floating state, there will be a large current leakage, and the + data in PSRAM may be corrupted by random signals on other SPI pins. + Select this option will set the CS pin of PSRAM to PULL-UP state during sleep, but this will + increase the sleep current about 10 uA. + If you are developing with esp32xx modules, you must select this option, but if you are developing + with chips, you can also pull up the CS pin of PSRAM in the external circuit to save power + consumption caused by internal pull-up during sleep. + (!!! Don't deselect this option if you don't have external PSRAM CS pin pullups.) + + config ESP_SLEEP_MSPI_NEED_ALL_IO_PU + bool "Pull-up all SPI pins in light sleep" + depends on !ESP_SLEEP_POWER_DOWN_FLASH \ + && (ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND || ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND) + default y if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32S3 + help + To reduce leakage current, some types of SPI Flash/RAM only need to pull up the CS pin + during light sleep. But there are also some kinds of SPI Flash/RAM that need to pull up + all pins. It depends on the SPI Flash/RAM chip used. + config ESP_SLEEP_RTC_BUS_ISO_WORKAROUND bool default y if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 @@ -72,34 +114,6 @@ menu "Hardware Settings" This option provides a software workaround for this issue. Configure to isolate all GPIO pins in sleep state. - config ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND - bool "PSRAM leakage current workaround in light sleep" - depends on SPIRAM - default y - help - When the CS pin of SPIRAM is not pulled up, the sleep current will - increase during light sleep. If the CS pin of SPIRAM has an external - pull-up, you do not need to select this option, otherwise, you - should enable this option. - - config ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND - bool "Flash leakage current workaround in light sleep" - default y - help - When the CS pin of Flash is not pulled up, the sleep current will - increase during light sleep. If the CS pin of Flash has an external - pull-up, you do not need to select this option, otherwise, you - should enable this option. - - config ESP_SLEEP_MSPI_NEED_ALL_IO_PU - bool "All pins of mspi need pull up" - depends on ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND || ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND - default y if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32S3 - help - To reduce leakage current, some types of SPI Flash/RAM only need to pull up the CS pin - during light sleep. But there are also some kinds of SPI Flash/RAM that need to pull up - all pins. It depends on the SPI Flash/RAM chip used. - config ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY int "Extra delay in deep sleep wake stub (in us)" depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3