Things to mention in this post:
- Memory types
- Cache Mechanism
- Pitfalls and Trade-Offs
- Other solutions
Below sections are all cited from Wikipedia for now.
Cache on STM32H7
Memory Protection Unit (MPU)
A memory protection unit (MPU), is a computer hardware unit that provides memory protection. It is usually implemented as part of the central processing unit (CPU). MPU is a trimmed down version of memory management unit (MMU) providing only memory protection support. It is usually implemented in low power processors that require only memory protection and do not need the full fledged feature of a memory management unit like virtual memory management.
MPU costs and benefits
FreeRTOS MPU ports enable microcontroller applications to be more robust and more secure by first enabling tasks to run in either privileged or unprivileged mode, and second restricting access to resources such as RAM, executable code, peripherals, and memory beyond the limit of a task’s stack. Huge benefit is gained from, for example, preventing code from ever executing from RAM as doing so will protect against many attack vectors such as buffer overflow exploits or the execution of malicious code loaded into RAM.
Use of an MPU necessarily makes application design more complex because first the MPU’s memory region restrictions must be determined and described to the RTOS, and second the MPU restricts what application tasks can and cannot do.