forked from espressif/esp-idf
resolve WIFI-5150
bugfix: Don't hold CS pin when VDDSDIO is power down to reduce the base current
This commit is contained in:
@@ -592,8 +592,10 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t mo
|
|||||||
|
|
||||||
/* On esp32c6, only the lp_aon pad hold function can only hold the GPIO state in the active mode.
|
/* On esp32c6, only the lp_aon pad hold function can only hold the GPIO state in the active mode.
|
||||||
In order to avoid the leakage of the SPI cs pin, hold it here */
|
In order to avoid the leakage of the SPI cs pin, hold it here */
|
||||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
|
#if (CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND)
|
||||||
|
if(!(pd_flags & PMU_SLEEP_PD_VDDSDIO)) {
|
||||||
rtcio_ll_force_hold_enable(SPI_CS0_GPIO_NUM);
|
rtcio_ll_force_hold_enable(SPI_CS0_GPIO_NUM);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOC_PM_CPU_RETENTION_BY_SW
|
#if SOC_PM_CPU_RETENTION_BY_SW
|
||||||
@@ -607,8 +609,10 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t mo
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Unhold the SPI CS pin */
|
/* Unhold the SPI CS pin */
|
||||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
|
#if (CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND)
|
||||||
|
if(!(pd_flags & PMU_SLEEP_PD_VDDSDIO)) {
|
||||||
rtcio_ll_force_hold_disable(SPI_CS0_GPIO_NUM);
|
rtcio_ll_force_hold_disable(SPI_CS0_GPIO_NUM);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -246,13 +246,7 @@ void app_main(void)
|
|||||||
ret = nvs_flash_init();
|
ret = nvs_flash_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: WIFI-5150
|
#if CONFIG_PM_ENABLE
|
||||||
#if CONFIG_PM_ENABLE && 0
|
|
||||||
sleep_clock_system_retention_init();
|
|
||||||
sleep_clock_modem_retention_init();
|
|
||||||
sleep_sys_periph_retention_init();
|
|
||||||
sleep_modem_wifi_modem_state_init();
|
|
||||||
|
|
||||||
// Configure dynamic frequency scaling:
|
// Configure dynamic frequency scaling:
|
||||||
// maximum and minimum frequencies are set in sdkconfig,
|
// maximum and minimum frequencies are set in sdkconfig,
|
||||||
// automatic light sleep is enabled if tickless idle support is enabled.
|
// automatic light sleep is enabled if tickless idle support is enabled.
|
||||||
|
Reference in New Issue
Block a user