2013-01-26 05:13 AM
I want to add some features to my program where it remembers some settings, i want to do this by storing the values in the sram.
But when i upload the firmware to the stm32 i need these values to be preset to a certain value. is this possible? (upload is done by dfu on my project)When you upload the firmware to a fresh stm32 micro-controller is all the sram already set to 0x0 by default?(from the factory). If i do a simple check to see if its 0x0 and if it is just set my default value. but if not 0x0 leave it alone (already been set by previous init). would this work?Any advice would be appreciated.Thanks :)2013-01-26 05:22 AM
Well the zeroing is more likely a function of the compiler's run time library start up code, the initial state at processor start is not guaranteed.
It you have critical data you need some way to confirm it's integrity (ie structure with checksum), and a way to reset it to default values if it's uninitialized or corrupted.