Hi,
I have a customer who likes to download an user application program and program it into the on-chip flash.
Because of the cache the instruction cache needs to be invalidated after the program was written to the flash memory. To be able to access data which is in the new user application also the data cache has to be invalidated, but just invalidating the entire data cache might cause issues as dirty cache lines will get discarded.
So my understanding is that the entire data cache has to be cleaned prior to invalidating it to ensure, that dirty cache lines will be written back to the memories (mainly SRAM).
I found a routine for doing this in the ARM Architecture Reference Manual, in the section B2.2.4 Cache maintenance functionality under Example code for cache maintenance operations. The same routine was also posted in e2e.ti.com/.../1753762.
- Am I right that the data cache has to be explicitly cleaned before invalidating or disabling it to ensure that dirty cache lines are written back to the memories?
- Am I right that a DSB instruction doesn't ensure that dirty cache lines are written back to the memories?
Thanks,
Christian