cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 power loss during write to flash bricks device

CKnez.1
Associate II

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 ?

3 REPLIES 3
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
CKnez.1
Associate II

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 ?