Skip to main content
junmar77
Associate
April 30, 2010
Question

Loading Boot code via RAM

  • April 30, 2010
  • 4 replies
  • 1299 views
Posted on April 30, 2010 at 05:50

Loading Boot code via RAM

    This topic has been closed for replies.

    4 replies

    chikos332
    Visitor II
    May 17, 2011
    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?

    domen23
    Associate II
    May 17, 2011
    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.

    mcuisp2
    Visitor II
    May 17, 2011
    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.

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

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