How to enable and disable icache and dcache for MPC5744P?

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

How to enable and disable icache and dcache for MPC5744P?

1,477 Views
ruoxuanluan
Contributor II

Hi everyone,

I am using MPC5744P, I need to enable icache and dcache when application is running, and disable icache and dcache when writing data into flash memory.

I wish someone could help me, its Better to provide me an example.Thank you!

Best Regards

luan

Labels (1)
Tags (3)
1 Reply

1,063 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, I could recommend to see following example code, file Optimizations.c where you can see ICache_init and DCache_init routine. Although written for different MCU, these initializations are the same. However, MPC5644P use MPU instead of MMU.

https://community.nxp.com/docs/DOC-102744

 

Or you can see following application note, section 3.6:

https://www.nxp.com/docs/en/application-note/AN4939.pdf

 

Section 3.5 then describes MPU setup.

 

The easiest way how to temporarily disable cache is to change MPU attribute of particular region to “cache inhibited”.