From ea6b0ff2da51198dea50a6dfd3bbdfea7095901a Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Mon, 24 Nov 2025 17:49:32 +0800 Subject: [PATCH] fix(esp_hw_support): fix the esp32h2 sleep TG0 watchdog reset issue caused by power down the top domain --- components/esp_hw_support/sleep_modes.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index b7f54b6e1e..f7c21485ab 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -948,6 +948,9 @@ static esp_err_t FORCE_IRAM_ATTR esp_sleep_start_safe(uint32_t sleep_flags, uint #if SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD esp_sleep_mmu_retention(false); #endif +#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA + sleep_retention_do_system_retention(false); +#endif #if CONFIG_IDF_TARGET_ESP32P4 && (CONFIG_ESP_REV_MIN_FULL == 300) sleep_flash_p4_rev3_workaround(); sleep_retention_do_extra_retention(false); @@ -1176,11 +1179,6 @@ static esp_err_t SLEEP_FN_ATTR esp_sleep_start(uint32_t sleep_flags, uint32_t cl cache_ll_invalidate_all(CACHE_LL_LEVEL_ALL, CACHE_TYPE_ALL, CACHE_LL_ID_ALL); #endif s_config.ccount_ticks_record = esp_cpu_get_cycle_count(); -#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA - if (sleep_flags & PMU_SLEEP_PD_TOP) { - sleep_retention_do_system_retention(false); - } -#endif } misc_modules_wake_prepare(sleep_flags); }