mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 09:09:10 -04:00
fix(esp_hw_support): fix esp32c5 and esp32c61 wakeup failed when TOP rejects PD
This commit is contained in:
parent
6540208f5a
commit
0f20fcb8f2
@ -61,19 +61,6 @@ void esp_sleep_config_gpio_isolate(void)
|
||||
gpio_sleep_set_pull_mode(gpio_num, GPIO_FLOATING);
|
||||
}
|
||||
}
|
||||
#if CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND && CONFIG_SPIRAM
|
||||
int32_t mspi_io_cs1_io_num = esp_mspi_get_io(ESP_MSPI_IO_CS1);
|
||||
if (GPIO_IS_VALID_GPIO(mspi_io_cs1_io_num)) {
|
||||
gpio_sleep_set_pull_mode(mspi_io_cs1_io_num, GPIO_PULLUP_ONLY);
|
||||
}
|
||||
#endif // CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND && CONFIG_SPIRAM
|
||||
|
||||
#if CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
|
||||
int32_t mspi_io_cs0_io_num = esp_mspi_get_io(ESP_MSPI_IO_CS0);
|
||||
if (GPIO_IS_VALID_GPIO(mspi_io_cs0_io_num)) {
|
||||
gpio_sleep_set_pull_mode(esp_mspi_get_io(ESP_MSPI_IO_CS0), GPIO_PULLUP_ONLY);
|
||||
}
|
||||
#endif // CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
|
||||
|
||||
#if CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU
|
||||
gpio_sleep_set_pull_mode(esp_mspi_get_io(ESP_MSPI_IO_CLK), GPIO_PULLUP_ONLY);
|
||||
@ -102,6 +89,21 @@ void esp_sleep_enable_gpio_switch(bool enable)
|
||||
ESP_EARLY_LOGI(TAG, "%s automatic switching of GPIO sleep configuration", enable ? "Enable" : "Disable");
|
||||
for (gpio_num_t gpio_num = GPIO_NUM_0; gpio_num < GPIO_NUM_MAX; gpio_num++) {
|
||||
if (GPIO_IS_VALID_GPIO(gpio_num)) {
|
||||
/* If the PSRAM is disable in ESP32xx chips equipped with PSRAM, there will be a large current leakage. */
|
||||
#if CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND && CONFIG_SPIRAM
|
||||
if (gpio_num == esp_mspi_get_io(ESP_MSPI_IO_CS1)) {
|
||||
gpio_sleep_sel_dis(gpio_num);
|
||||
continue;
|
||||
}
|
||||
#endif // CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND && CONFIG_SPIRAM
|
||||
|
||||
#if CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
|
||||
if (gpio_num == esp_mspi_get_io(ESP_MSPI_IO_CS0)) {
|
||||
gpio_sleep_sel_dis(gpio_num);
|
||||
continue;
|
||||
}
|
||||
#endif // CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
|
||||
|
||||
if (enable) {
|
||||
gpio_sleep_sel_en(gpio_num);
|
||||
} else {
|
||||
@ -190,13 +192,9 @@ void esp_deep_sleep_wakeup_io_reset(void)
|
||||
#if CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND || CONFIG_PM_SLP_DISABLE_GPIO
|
||||
ESP_SYSTEM_INIT_FN(esp_sleep_startup_init, SECONDARY, BIT(0), 105)
|
||||
{
|
||||
/* If the TOP domain is powered off, the GPIO will also be powered off during sleep,
|
||||
and all configurations in the sleep state of GPIO will not take effect.*/
|
||||
#if !CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// Configure to isolate (disable the Input/Output/Pullup/Pulldown
|
||||
// function of the pin) all GPIO pins in sleep state
|
||||
esp_sleep_config_gpio_isolate();
|
||||
#endif
|
||||
// Enable automatic switching of GPIO configuration
|
||||
esp_sleep_enable_gpio_switch(true);
|
||||
return ESP_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user