Skip to content

Is STM32F4 self-update working? #320

Answered by sigprof
ssbb asked this question in Q&A
May 27, 2023 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

In my testing on STM32F401CCU6 the self update code works, but if the currently installed version of tinyuf2 has been built with TINYUF2_PROTECT_BOOTLOADER enabled, the self updater code needs to be built with TINYUF2_PROTECT_BOOTLOADER enabled too, otherwise it won't be able to disable the flash write protection before overwriting the bootloader. So if you want to update from a tinyuf2 build with flash write protection enabled to another tinyuf2 build with flash protection disabled, you probably need to have this in your board.h file:

#ifdef TINYUF2_SELF_UPDATE
#    define TINYUF2_PROTECT_BOOTLOADER 1
#else
#    define TINYUF2_PROTECT_BOOTLOADER 0
#endif

Another observation that may be …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ssbb
Comment options

Answer selected by ssbb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants