cancel
Showing results for 
Search instead for 
Did you mean: 

Loading Boot code via RAM

junmar77
Associate II
Posted on April 30, 2010 at 05:50

Loading Boot code via RAM

4 REPLIES 4
domen23
Associate II
Posted on May 17, 2011 at 13:49

What if MCU reboots (power failure or whatever) during firmware upgrade?

What if upgrade fails somehow (corrupted firmware)?

What if someone sends an invalid firmware?

What we did here was:

- fixed bootloader at 0x8000000

- application at 0x8008000

Now, bootloader here is NEVER changed, which might not fit in your workflow, but it works for us.

We transfer application via wireless and flash it. In the end we calculate the checksum, and write the ''firmware is ok'' flag.

Our bootloader sets up a watchdog, then checks if there's a new firmware waiting, otherwise it transfers control to the application.

Application must ping that watchdog, or device will reboot into bootloader (we don't have a way to reboot the device physically), so that takes care of invalid applications. Well, at least some, you still need to take care to not ping the watchdog, if application is not functioning ok (ie. not able to detect firmware upgrade request and reboot).

Hope this gave you some hints.

chikos332
Associate II
Posted on May 17, 2011 at 13:49

Hi,

You didn't think about using the implemented STM32 Bootloader (in system memory) in this case? it may be much easier?

junmar77
Associate II
Posted on May 17, 2011 at 13:49

It seems using system memory is the best solution for my problem. Thanks.

mcuisp2
Associate II
Posted on May 17, 2011 at 13:49

I think this must need a external MCU to control BOOT0/nSYSRST. I had got a patent at china, for this issue.