I thought this problem was fixed, but it has come back.
We are using the s32k146 processor.
When I erase and write new data to the data flash memory, after the write, when reading from address 0x10000000, I get the old data and not the newly written data. Power cycling will fix this, but we don't want to have this limitation.
I asked this question before and got a response which led me to the OCM1 field of the OCMDR[1] register. I used this to disable and renable the cache, and tested and got good results. But I guess I was just lucky, because now I am back to having this problem.
Below is the code where we write to the flash memory, beginning and ending with the code to disable/enable the cache. Is something missing?
On this device apparently there is no invalidate operation for flash pre-fetch buffer.
So you would apparently need to read from different address (out of the pre-fetched line) in order to load different line and then you should read new data you programmed before.