Request for explanations regarding the ICACHE of H5
Using an STM32H5 I recently came across a problem: triggering a hard fault when accessing data in FLASH (read FLASHSIZE_BASE).
It turns out in this thread that the ICACHE being validated, it is necessary to configure the MPU to make “uncacheable” the part of the flash to which we want to access. This seems to contradict the fact that ICACHE is made precisely to serve as a flash cache...
This leads to a host of questions…
How does the ICACHE (Instruction CACHE) intervene in access to data?
It is not clear to me why read-only data should not be cacheable.
If my application places data in FLASH and I need to access it, will it also be necessary to use the MPU?
Is there a list of areas of the address space that need to be made “non-cacheable” to be able to access them securely?
Does this apply to all families using the Cortex-M33: L5, U5, H5?
What are the differences regarding ICACHE and data access between these families?
It seems that Icaching is not just about instructions, but also about data.
This cache is also active on internal SRAM areas.
How does this work when using DMA? Should we do cache management as with MPUs having a data cache (the H7 for example)?
While the M33 does not have a data cache. And that ICACHE has only one maintenance instruction: total cache invalidation.
Or use the MPU to define a non-cacheable region containing all RAM?
I would like ST to write an extensive article in the knowledge base to answer these questions (and those that others will think of…).
Thanks.
