BlackPill 401, bootloader can’t be changed, nor UF2 files

Bootloader for STM32F103 and STM32F4xx micro-controllers
No special driver is required. Support for Windows, Linux and Mac Operating System
Post Reply
fufu
Posts: 1
Joined: Sat Dec 14, 2024 10:44 am

BlackPill 401, bootloader can’t be changed, nor UF2 files

Post by fufu »

Greetings, 👋

I’ve just received a brand new STM32F401 (BlackPill) development board which I successfully flashed with Adafruit’s latest UF2 bootloader (TinyUF2 0.20.1)
Flash was performed on MacOS with dfu-util.

Everything went smooth and my device’s firmware updated with a slightly different default blink program on it. I can open it in the OS’s file manager and see the files and so on.

Issue is that when I replace the UF2 with a custom one, the board doesn’t restart or perform any of the new firmware actions. When I restart it with (boot0 + nrst or unplug) the UF2 file reverts to the original one.

I decided to downgrade the bootloader to TinyUF 0.5.0 which was previously used by some F4 users. But then I observed the same behaviour. dfu-util pushes the bootloader with success but my hexdump shows the 0.20.1 still sitting there.

I tried to zero out the bootloader which this time returned a valid zero out hexdump too, but after reboot, the bootloader was reverted to 0.20.1 again. (0.5.0 flash over the zeroes reverts it to 0.20.1 also)

I don’t own an ST-Link. Both bootloaders are stated to be made for F401 per Adafruit’s repo. That’s my first ever board and I don’t know what this behaviour may even suggest. I can provide command outputs and any help is appreciated. 🙏

EDIT: Turned out TinyUF2 has locked my first two available partitions via option bytes, which I resolved with STM32CubeProgrammer over USB/DFU. Had to hold down boot0 during the option bytes overwrite, otherwise they would get reverted.
Post Reply

Return to “STM32 HID bootloader”