-
I flashed tinyuf2 with write protection enabled to stm32f401 and now trying to update it. Sadly I don't have SWD exposed and hand soldering to QFN48 chip is not what I would like to do. I am trying to update it with uf2 - I disabled protection in config and changed volume label to see it actually updated. I reset the board, copy self-update uf2 to the volume and nothing happens - vol name not changed after I reset it again and info_uf2 has commit # from the first flash. I know it's impossible to say what wrong when I can't debug it myself with SWD but maybe there some chance I am doing something wrong or it's known that it's not working rn? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Update: I enabled protection in config again and it worked - drive re-mounted and changed it's name to new one. Then I tried to disable protection and change name in the config again. This time drive just disappeared (not re-mounted) and after reset I see it wasn't updated. So looks like write protection prevents itself from being disabled. Anything I could do? |
Beta Was this translation helpful? Give feedback.
-
In my testing on STM32F401CCU6 the self update code works, but if the currently installed version of tinyuf2 has been built with #ifdef TINYUF2_SELF_UPDATE
# define TINYUF2_PROTECT_BOOTLOADER 1
#else
# define TINYUF2_PROTECT_BOOTLOADER 0
#endif Another observation that may be interesting: On the STM32F411CEU6 chip the following sequence of commands, performed with BOOT0 held high while running the first command and at least until the chip reboots, can erase the tinyuf2 bootloader with flash write protection enabled: dfu-util -d 0483:df11 -a 0 -v -s :force:unprotect
dfu-util -d 0483:df11 -a 0 -v -s :force:mass-erase However, the same sequence of commands does not work on the STM32F401CCU6 and STM32F401CEU6 chips — the commands pretend to work, but the flash write protection does not actually get disabled, so after those commands you still have the same version of tinyuf2 in the flash (the |
Beta Was this translation helpful? Give feedback.
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 withTINYUF2_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 yourboard.h
file:Another observation that may be …