cancel
Showing results for 
Search instead for 
Did you mean: 

How to retain calibration data & serial number after software upgrade

qing2
Associate II
Posted on October 15, 2009 at 14:55

How to retain calibration data & serial number after software upgrade

3 REPLIES 3
qing2
Associate II
Posted on May 17, 2011 at 13:26

We design an instrument using STM32F103RBT6. At the moment, calibration data and serial number will be lost if we update the software through instrument. What is the best way to retain the important information. Does this MCU have EEPROM emulation? The 'information block' is not for this purpose, is it?

Thank you in advance for help.

norcio82
Associate II
Posted on May 17, 2011 at 13:26

See AN2594 EEPROM emulation in in STM32F10x microcontrollers

http://www.st.com/stonline/products/literature/an/13718.pdf

http://www.st.com/stonline/products/support/micro/files/an2594.zip

or use external EEPROM

[ This message was edited by: norcio82 on 14-10-2009 16:50 ]

[ This message was edited by: norcio82 on 14-10-2009 16:51 ]

clive2
Associate II
Posted on May 17, 2011 at 13:26

a) Store the data in one page (1K or 2K depending on device density) within the flash memory, and don't erase it. ie Only erase the pages individually and update them as required.

b) Have the update process copy them into RAM during the update.

c) Copy the parameters into the new flash image as you are updating it.

d) If the update process is driven on a PC, send the parameters back to the PC and have it integrate them into the new image.

If the device is performing the update itself it needs to be robust. This means partitioning the flash into multiple pieces, Boot Loader, Recovery, Application, Parameters, etc. For it to be robust you will need to erase/flash in pieces, and never perform a bulk erase.

The STM32 is nice because it can execute from Flash while erasing/writing other pages within the device. Update code can be copied into, and run from, RAM for speed.

Personally I would put a permanent boot loader into the first page, which would check the integrity of other sections. I would put permanent (one-time-programmed) parameters in the back end of the boot page. I would put more temporal stuff in a page or two of there own, perhaps permitting a ping/pong between them to ensure at least one copy was valid.

-Clive