cancel
Showing results for 
Search instead for 
Did you mean: 

How to TIMEOUT within DFU bootloader?

Goof Ball
Associate III
Posted on April 23, 2018 at 18:55

My STM32F405 widget uses the DFU bootloader to reflash:  the user holds down several buttons in a super-secret pattern, and my firmware jumps to the bootloader.....  at which time DeFUse software can a) reflash over USB otg, and then, b) issue 'Exit DFU mode'.

Trouble is, if the bootloader is entered mistakenly (ie. a user happens to stumble on the super-secret button pattern by accident) - it'll stay in the bootloader forever.

How can I have it exit the bootloader after, say 60 seconds?

- powercycling is NOT an option, the widget has an internal battery.

- Reference manual says bootloader conveniently refreshes the IWDG - so that won't work.

- I tried using the WWDG... but it appears the bootloader conveniently disables WWDG - so that doesn't work either.

Any help is welcome!

1 REPLY 1
Benjamin Rockwell
Associate II
Posted on May 06, 2018 at 00:52

If you did have a time out driven reset like watchdog, wouldn't there be a race condition of sorts where by the timeout reset occurs in the middle of a firmware update and leaves the device in a bad state? You can't really predict how long it will take the user to complete the update after the device first enters DFU mode. The user may hit your magic button combo and then go have tea before completing the update.

I think a custom bootloader that times out internally is your best option.