2026-01-08 2:59 AM
Hey,
I am using the STM32G0B0VET (16MHz HSE) with a virtual com port over USB.
The virtual com port is working fine but as a backup I would love to be able to let the user reflash the device.
I was thinking of using the DFU for this since then the user would only need a standard USB cable (consumer electronics hopefully high volume). I exposed a button that can pull BOOT O high (small reprogram button you have to push).
(Normally in the field updates are not needed but I would like to have this as a backup).
Now I have the following problem when I boot the device (that is flashed) when pressing the button (keeping BOOT 0 high) my PC sees the virtual COM port and not the DFU device. It is thus running the usual code and not entering the bootloader.
If I erase the STM32 with the ST link I can access the DFU just fine with the boot button.
Does anybody have a fix for this?
Best regard and thanks already for the help.
Solved! Go to Solution.
2026-01-08 6:14 AM - edited 2026-01-08 11:37 AM
It sounds like it's not booting up into the bootloader.
See AN2606 for how to enter the bootloader. For this chip, it's:
The default settings for these are in the reference manual. They are:
nBOOT0_SEL = nBOOT0 = nBOOT1 = 1.
So the BOOT0 pin is ignored by default. Your button does nothing (by default).
You can change the option bytes in STM32CubeProgrammer on the OB tab. Set nBOOT0_SEL=0 to have the BOOT0 pin sampled on startup.
Edit: also be aware that on a fresh (i.e. not yet programmed) chip the bootloader will always run since the main flash is empty.
2026-01-08 6:14 AM - edited 2026-01-08 11:37 AM
It sounds like it's not booting up into the bootloader.
See AN2606 for how to enter the bootloader. For this chip, it's:
The default settings for these are in the reference manual. They are:
nBOOT0_SEL = nBOOT0 = nBOOT1 = 1.
So the BOOT0 pin is ignored by default. Your button does nothing (by default).
You can change the option bytes in STM32CubeProgrammer on the OB tab. Set nBOOT0_SEL=0 to have the BOOT0 pin sampled on startup.
Edit: also be aware that on a fresh (i.e. not yet programmed) chip the bootloader will always run since the main flash is empty.
2026-01-08 11:59 PM
Hi @Sander_V & welcome to ST Community
Your target's behavior regarding entering the system bootloader as mentioned @TDK depends on the option byte nBOOT0_SEL:
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.