µTasker Forum > NXPTM M522XX, KINETIS and i.MX RT
Caching of (XiP) Flash?
(1/1)
jackking:
I am having a situation where immediately after clearing flash in the SerialLoader, reading back from flash returns the old value before the erase. Is there a cache for the external Flash that needs to be flushed?
I tried fnCommandCache(INSTRUCTION_CACHE_INVALIDATE | DATA_CACHE_INVALIDATE); But that seems to only be for the TCM memories.
thanks
mark:
The FlexSpi has a cache.
Try
FLEX_SPI_AHBCR = FLEX_SPI_AHBCR_READADDROPT; // disable FlexSPI caching
since that worked for me when I had a similar issue.
It completely disables it but, seeing as the serial loader is running in RAM, there will be no performance disadvantage just turning it off.
Regards
Mark
jackking:
Awesome, that's seems to have worked for me as well.
Thanks!
mark:
Note also that using the fnGetParsFile() method to read to a buffer also bypasses any caching. Only the XiP (memory mapped) accesses can be cached.
Navigation
[0] Message Index
Go to full version