mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-15 06:26:49 +00:00
spi_flash: fix stale read issue for memory mapped partition
On flash program operation (either erase or write), if corresponding address has cache mapping present then cache is explicitly flushed (for both pro and app cpu) Closes https://github.com/espressif/esp-idf/issues/2146
This commit is contained in:
@@ -48,12 +48,10 @@ void spi_flash_disable_interrupts_caches_and_other_cpu_no_os();
|
||||
// This function is implied to be called when other CPU is not running or running code from IRAM.
|
||||
void spi_flash_enable_interrupts_caches_no_os();
|
||||
|
||||
// Mark the pages containing a flash region as having been
|
||||
// erased or written to. This means the flash cache needs
|
||||
// to be evicted before these pages can be flash_mmap()ed again,
|
||||
// as they may contain stale data
|
||||
//
|
||||
// Flushes cache if address range has corresponding valid cache mappings
|
||||
// Recommended to use post flash program operation (erase or write)
|
||||
// Only call this while holding spi_flash_op_lock()
|
||||
void spi_flash_mark_modified_region(uint32_t start_addr, uint32_t length);
|
||||
// Returns true if cache was flushed, false otherwise
|
||||
bool spi_flash_check_and_flush_cache(uint32_t start_addr, uint32_t length);
|
||||
|
||||
#endif //ESP_SPI_FLASH_CACHE_UTILS_H
|
||||
|
Reference in New Issue
Block a user