hello, when I want to handle the flash (such as reading ,writing and erasing) , I should disable D -cache and flash controller buffer .
If I don't enable the D-cache and flash controller buffer after manipulating the flash, will it make a big difference on the performance of the MCU ?
What effect would the MCU have without d-cache and flash controller buffer enable ?
Regards,
Meng
Hi Meng,
this is not about performance, it's about data coherency.
Example: let's assume that some data from a flash block are already cached. When you erase the block now, cache memory is not informed about that, it still contains previous cached data, so you will read incorrect data now. It would be necessary to invalidate the cache after each flash operation or you can set that area as cache inhibited.
Regards,
Lukas
Hi, Lukas,
I am afraid that you misunderstood the meaning of my words.
When I don't manipulate the flash , I disable the D-cache and flash controller cache .Which means in the normal instruction execution , the D-cache and flash controller cache are disable. Will it effect the MCU ?
I think that in the normal instruction execution , the disabled cache will have some influence on the MCU , maybe the efficiency of instruction execution will go down. Am I right ?
Regards,
Meng
I'm sorry, too fast reading...
Yes, sure, the performance can go down. I don't want to give you an estimation. It is highly dependent on application. I usually recommend to test it - for example, use a timer to measure some critical sections of your code or toggle GPIO before/after...
Regards,
Lukas