Hello Liu,
Regarding your questions please see my comments below.
Q1: The following statement is ok? Can this statement enable both instructions cache and data cache? And don't need other configuration for cache enable?
Your statement's correct, you only need that to enable the cache.
Q2: The following statement is ok? And don't need to flush data(in cache) to a destination before PFLASH cache disable? If needed, how to flush?
This statement is correct. Noticed that when you do this the buffer is cleared automatically.

Q3: The following statement is ok? And don't need to flush data(in cache) to a destination before cache disable? If needed, how to flush?
Your statement is correct. However, I recommend you to add the following statements.
base->PCCCR |= LMEM_PCCCR_INVW0_MASK | LMEM_PCCCR_INVW1_MASK | LMEM_PCCCR_GO_MASK;
while (base->PCCCR & LMEM_PCCCR_GO_MASK)
{
}
base->PCCCR &= ~(LMEM_PCCCR_INVW0_MASK | LMEM_PCCCR_INVW1_MASK);
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------