AnsweredAssumed Answered

S32K144: Cache enable/disable question

Question asked by 伟伟 刘 on Apr 23, 2019
Latest reply on May 15, 2019 by 伟伟 刘

Hello, all

 

I use the following statement for cache enable.
Q1: The following statement is ok? Does this statement can enable both instructions cache and data cache? And don't need other configuration for cache enable?
LMEM->PCCCR = LMEM_PCCCR_INVW0(1) | LMEM_PCCCR_INVW1(1) | LMEM_PCCCR_GO(1) | LMEM_PCCCR_ENCACHE(1);

 

when i want to disable PFLASH cache temporarily before modifying PFLASH,
Q2: The following statement is ok? And don't need to flush data(in cache) to destination before PFLASH cache disable? If needed, how to flush?
MSCM->OCMDR[0u] |= MSCM_OCMDR_OCM1(0x3u);

 

when i want to disable cache temporarily,
Q3: The following statement is ok? And don't need to flush data(in cache) to destination before cache disable? If needed, how to flush?
LMEM->PCCCR = LMEM_PCCCR_INVW0(1) | LMEM_PCCCR_INVW1(1) | LMEM_PCCCR_GO(1);

 

Regards,
Liu

Outcomes