µTasker Forum
µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: jackking on March 13, 2024, 01:09:16 AM
-
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
-
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
-
Awesome, that's seems to have worked for me as well.
Thanks!
-
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.