resolve WIFI-5150

bugfix: Don't hold CS pin when VDDSDIO is power down to reduce the base current
This commit is contained in:
wuzhenghui 2023-02-05 17:18:49 +08:00
parent 7ee1b09433
commit 45c2900ec0
2 changed files with 9 additions and 11 deletions

View File

@ -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.
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
rtcio_ll_force_hold_enable(SPI_CS0_GPIO_NUM);
#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);
}
#endif
#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
/* Unhold the SPI CS pin */
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
rtcio_ll_force_hold_disable(SPI_CS0_GPIO_NUM);
#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);
}
#endif
}

View File

@ -246,13 +246,7 @@ void app_main(void)
ret = nvs_flash_init();
}
// TODO: WIFI-5150
#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();
#if CONFIG_PM_ENABLE
// Configure dynamic frequency scaling:
// maximum and minimum frequencies are set in sdkconfig,
// automatic light sleep is enabled if tickless idle support is enabled.