I am building a system with STM32 that uses a device that needs to be calibrated (the data can be stored in one 32 bit register). Since I am still building and updating the code, I ideally would like the region to stay in the same place so every time I build and power on it doesn’t have to recalibrate. Obviously its a given that the MCU doesn’t initialize the values in that region given it’s calibration data.
Right now I’ve just picked a far flung address inside the flash region, and am hoping the compiler doesn’t write over it. It works perfectly, but it feels like there is a proper way to block out memory from the compiler side.