2018-02-21 08:27 AM
Hey, I am facing a specific task and I could really need some help with that.
So I have many stm32L073 µC which all run the same programm. The programm has a stored list of constants in them which are used while the programm is executed. Now it should be possible to extend/upgrade this list of constants from extern. The µC is connected with UART to a XBee wireless module.
Is it possible ot write to values received from the UART to a specific place in the flash storage? Or is it better to reload the whole programm, which is updated with the new constants.
For example:
old programm has list of those IDs:
uint8_t ID[13] = {0,32,41,23,124,53,123,123,43,0};
new programm:
uint8_t ID[13] = {0,32,41,23,124,53,123,123,43,0,11,22,45};
these variables are fixed and should be available all the time by the programm and they do not change.
any help/advice is helpfull.
Thanks,
Benjamin
2018-02-21 09:53 AM
Normally you'd place constants (calibration data, serialization, etc) in a separate area of flash that you manage, can erase, replace, or set to defaults.
If this is a final programming stage you could modify (patch) the image you are writing to each unit. Programming code recognizes a specific signature in memory, or via symbols exported in .MAP or .ELF and substitutes values.
2018-02-21 10:12 AM
The STM32L0x3 line offers ... up to 6 Kbytes of embedded EEPROM
So why not use that?
2018-02-22 12:54 AM
Well, it should also be possible to use Controllers which do not have a EEPROM. But it would be best to use EEPROM in this case, as you suggested. I was just wondering if it is possbile to update the Flash storage via the UART.