2018-01-10 03:16 AM
Hello,
I changed my linker file for flashing some initial values to the internal EEPROM of my stm32l0.
MEMORY
{...EEPROM (rw) : ORIGIN = 0x80803E8, LENGTH = 1044 }/* Define output sections */SECTIONS{ .eepromAPN : { /*. = ALIGN(4);*/ KEEP(*(.eepromAPN.number)) /* numberofApns */ KEEP(*(.eepromAPN*)) /* APNs */ /*. = ALIGN(4);*/ } >EEPROM...
}
this is implemented and working nicely. but:
whenever I reflash the controller, all other EEPROM parts (between 0x8080000 and 0x80803E8) are erased.
they were not reset before these changes to the linker file.
how can I prevent this? I have some important calibration data in the EEPROM, which MUST be unchanged when flashing.
Thanks,
Michael
#stm32l0 #linker2018-01-10 04:27 AM
apart from this, also the st-link utility can't flash the .bin anymore, because it is 'bigger than flash memory size'. With segger j-link it flashes perfectly... what is the difference?
2018-01-10 08:30 AM
Does it work with a .HEX file? Those at least can be sparse, so that the .BIN in fact doesn't look bigger than the FLASH when considered without regard to the EEPROM size.
2018-01-12 03:43 AM
Thank you. using .hex format, it flashes successfully.
Still I have the problem with erased EEPROM Memory.
in the .hex file, 0x8080000 to 0x80803E8 are not defined, I checked that. still they are erase when I flash.
If I check the 'skip erase' option in st-link Utility, it does not erase anything (which is not the best way to do it as well).
Also other flashing tools like Segger J-link seem to erase the whole memory before flashing th .hex
Are there some linker file commands which can tell the flashing tool not to erase certain parts of EEPROM?
2018-01-12 05:49 AM
I changed the adresses of my linker file to the second EEPROM bank and it is not erasing the unused part in bank1 anymore.