Skip to main content
Visitor II
November 27, 2020
Question

STM32F429 power loss during write to flash bricks device

  • November 27, 2020
  • 3 replies
  • 1149 views

Hi

I've implemented the dual boot functionality on my STM32F429 for OTA Updates.

To do so, I always write the new firmware into 0x08100000 and afterwards set oder reset the dual boot bit.

If I cut the power to the MCU during the writing process to the not used part of the flash (that's all before I enable dual boot) the device is completely bricked and does not boot at all anymore.

Any ideas on that behaviour ?

    This topic has been closed for replies.

    3 replies

    Super User
    November 27, 2020

    The answer will depend on the details. Typically you would not boot to the new flash until you verify it was written correctly via a CRC or similar. Cutting power prior to that it should just boot from the same bank it just booted from.

    Part can't be completely bricked as the built-in bootloader is in ROM.

    Graduate II
    November 27, 2020

    Likely failing a check in the ROM loader.

    I would strongly recommend having your own loader in the 16KB block at 0x08000000 and 0x08100000 that has appropriate recovery and integrity checking, and that you don't erase ever. Put the app in the 0x08004000 / 0x08104000 space

    CKnez.1Author
    Visitor II
    November 30, 2020

    I really hoped to get around my own boot loader, but I can't seem to get it working without it.

    Another weird thing I noticed, is that I can't seem to receive any data on SPI ( I used CubeMX to generate the code). Any solution to that ?