2015-04-12 12:22 PM
Hi,
I have a page to use as data in the flash programme memory. I can read, write values and all this task works find.But I need to write an initial value at programming time. I mean, to write for exemple 0x00 when the MCU is flashed. This value can't rewrite at MCU reset.It can be done in the options -- Linker, (IAR project oconfiguration) because if I put that in code every time that the MCU restart will be rewritten.I'm sure that must be easy but I can't find how to do it.Thanks in advance.Regards. #stm32-flash-data2015-04-12 01:34 PM
Create a small section of .HEX file with your specific data and merge it with that of the application code?
Alternatively code your app so that it recognizes that the initial is set, or not, and only set it when required.2015-04-13 02:53 AM
2015-04-13 06:23 AM
Ok, and you can't do that with ''static const'' data and direct it into a FLASH section assigned to the ''EEPROM''. Via linker script, or .ICF file.
If you want it to be maintainable out of the linker put the appropriate functionality in the source code. Our process is to package and sign firmware images in post link steps, and that seems maintainable for us. Is the data actually zero, or serial number or calibration data? Are there known defaults? Can the application have a test/config mode run during final test that can write default/specific data? Can the application recognize the erased state (0xFFFFFFFF), or a checksum on the configuration data, and write default settings?