Add flash caching reasons.
Flash is read using a memory-mapped data cache that uses MIPS. The cache's validity is usually determined by its address. if the same address is accessed and the CPU considers the data unchanged, the cache is hit.
In this BUG, from the first block of rootfs_data JFFS read 4 byte of data, the data will be written in the data cache of MIPS, then JFFS will erase the first block, and then to read the data check whether erase success, success is written JFFS file system identifier, or marked as bad block, because use SPI command to erase flash, the CPU does not know the data has been changed, therefore, to check and fetch the data from the data cache, cause the failure of check, because is the first block rootfs_data,Therefore, a restart rebuilds the file system, causing configuration files to be lost.
In the case of 9331 and 9531, the MIPS cache line is 32byte, so any data read beyond 32byte will not be cached
1 Like