Issues on D-cache and Flash Control buffer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issues on D-cache and Flash Control buffer

846 Views
qm1013
Contributor III

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 ?

TIM截图20190722095523.jpg

Regards,

Meng

Labels (1)
Tags (3)
0 Kudos
3 Replies

743 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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

0 Kudos

743 Views
qm1013
Contributor III

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

0 Kudos

743 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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

0 Kudos