We are trying to retain the state of system after system reset/restart/crash. The plan was to use the last chunk of RAM and explicitly access it via a pointer. So far this seems worked fine, over the course of weeks of test and thousands of restet, we only observed once that section of RAM got corrupted.
We are using STM32F767, there are about 300KB free RAM in the heap, so it is probably safe to assume the last 32KB will never be touched unless explicitly accessed by address. My question is, do we need to do anything else to make sure other parts of code won’t touch that chunk of RAM?
The good thing about this method is you’re not restricted to a position/size, and you have compiler/linker checking for correct sizes and accesses.
Disclaimer; I haven’t actually tried this on an M7, so given the apparent issue also reported in the post, you may need to either disable caching, or configure the MPU to prevent caching the assigned area.
I never tried to do something with this, but there seems to be documented how to add region in RAM via linker (correctly sugested by Tom) and so on. You can found how to add your own codes dictly to exiscting system maybe. But as minimum you can use it for inspiration.
Here is probably defined a region for mbed crash for F767 probably