fix(cache): fixed cache sync ops concurrent call issue

Closes https://github.com/espressif/esp-idf/issues/18023
This commit is contained in:
armando
2025-12-25 09:59:09 +08:00
parent bc3cff98df
commit b539532a31
4 changed files with 25 additions and 0 deletions
+3
View File
@@ -21,6 +21,7 @@
#endif
#include "esp_private/esp_mmu_map_private.h"
#include "esp_private/esp_cache_private.h"
#include "esp_mmu_map.h"
#include "esp_rom_spiflash.h"
#if CONFIG_SPIRAM
@@ -312,7 +313,9 @@ IRAM_ATTR bool spi_flash_check_and_flush_cache(size_t start_addr, size_t length)
return true;
#else // CONFIG_IDF_TARGET_ESP32
if (vaddr != NULL) {
esp_cache_sync_ops_enter_critical_section();
cache_hal_invalidate_addr((uint32_t)vaddr, SPI_FLASH_MMU_PAGE_SIZE);
esp_cache_sync_ops_exit_critical_section();
ret = true;
}
#endif // CONFIG_IDF_TARGET_ESP32