AnsweredAssumed Answered

What is the best way to store, retrieve, change program configuration data?

Question asked by Mike Hooper on Aug 31, 2017
Latest reply on Sep 15, 2017 by Mike Hooper

I need to store approximately 128 bytes of "factory default" configuration data in FLASH when the program is initially loaded into my STM32F7xx custom board during production. Then, when the program boots, I need to load this data into ram-based variables for manipulation during program execution. At any time during program execution the values of these variables can be changed by the program. If/when they are changed, I would like to update their stored values in FLASH.


I have implemented this previously in a TI processor by defining a special section of FLASH memory for this purpose. The TI processor permitted erase/write of small segments (128 bytes). But apparently the STM32F7xx minimum erase size is a segment. The smallest segment in an STM32F7xx is 32KB, which is much larger than my config data. And the smaller segments are located in low memory where the linker normally loads the beginning of the program data. So it seems like I need to store my small amount (128 bytes) of config data in the upper 256k bytes of FLASH. Seems like a bit of a waste to me.


Is there a better way to implement this config data storage? Guidance appreciated.