Merge branch 'fix/fix_sleep_exception_in_spi_flash_rom_impl_v6.0' into 'release/v6.0'

fix(esp_hw_support): fix sleep exception in spi flash rom impl (v6.0)

See merge request espressif/esp-idf!46445
This commit is contained in:
Jiang Jiang Jian
2026-03-20 10:16:57 +08:00
13 changed files with 48 additions and 20 deletions
+3 -2
View File
@@ -555,6 +555,7 @@ static void s_do_deep_sleep_phy_callback(void)
#endif
static int s_cache_suspend_cnt = 0;
static uint32_t s_cache_state = 0;
// Must be called from critical sections.
static void FORCE_IRAM_ATTR suspend_cache(void) {
@@ -566,7 +567,7 @@ static void FORCE_IRAM_ATTR suspend_cache(void) {
// fully check the access to external memory, writeback & invalidate is needed here.
Cache_WriteBack_Invalidate_All(CACHE_MAP_MASK);
#endif
spi_flash_disable_cache(esp_cpu_get_core_id(), NULL);
spi_flash_disable_cache(esp_cpu_get_core_id(), &s_cache_state);
}
}
@@ -575,7 +576,7 @@ static void FORCE_IRAM_ATTR resume_cache(void) {
s_cache_suspend_cnt--;
assert(s_cache_suspend_cnt >= 0 && DRAM_STR("cache resume doesn't match suspend ops"));
if (s_cache_suspend_cnt == 0) {
spi_flash_restore_cache(esp_cpu_get_core_id(), 0);
spi_flash_restore_cache(esp_cpu_get_core_id(), s_cache_state);
}
}