Skip to content

Commit d41cb13

Browse files
committed
Merge branch 'fix/fix_cache_hit_bypass_iram_safe_assertion' into 'master'
fix(esp_hw_support): fix cache hit bypass iram safe assertion on p4 See merge request espressif/esp-idf!38371
2 parents 6dc71c2 + dbec79a commit d41cb13

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/esp_hw_support/sleep_modes.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,12 @@ static int s_cache_suspend_cnt = 0;
519519
static void IRAM_ATTR suspend_cache(void) {
520520
s_cache_suspend_cnt++;
521521
if (s_cache_suspend_cnt == 1) {
522+
#if CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION && CONFIG_IDF_TARGET_ESP32P4
523+
// The implementation of P4 L2 cache suspend is to shut down MSPI AXI instead of shutting down Cache BUS.
524+
// If the access to external memory hits in the cache, it will not trigger a cache error. So in order to
525+
// fully check the access to external memory, writeback & invalidate is needed here.
526+
Cache_WriteBack_Invalidate_All(CACHE_MAP_MASK);
527+
#endif
522528
spi_flash_disable_cache(esp_cpu_get_core_id(), NULL);
523529
}
524530
}

0 commit comments

Comments
 (0)