2025-06-25 5:40 AM - last edited on 2025-06-25 6:57 AM by Andrew Neil
I am contacting you to report and request assistance with a recurring issue I am facing while working with the STM32G071CBT6TR microcontroller. I am experiencing problems with the bootloader during UART-based firmware uploads.
The microcontroller programs successfully only the first time via UART using a USB-to-Serial converter (FT232RL). However, after a successful first upload, subsequent upload attempts fail, even though nothing changes in the hardware or the code.
MCU: STM32G071CBT6TR
Programming Method: UART (USART1) using USB-to-Serial (FT232RL)
Baud Rate: 115200
Parity: Even (as required by STM32 bootloader)
Boot Mode Configuration:
BOOT0 is connected to 3.3V
Reset pin is manually triggered before upload
Software: STM32CubeProgrammer
Port Status: COM port opens successfully
First Upload:
Upload works perfectly with the default settings using STM32CubeProgrammer over UART.
Following Uploads:
All subsequent attempts fail with the following error:
Despite confirming that BOOT0 is still high, the reset pin is pressed, and all connections remain unchanged, the bootloader fails to respond.
Serial Output Behavior:
With parity set to even: readable output appears, but the upload still fails.
Verified all connections (TX/RX orientation, BOOT0 high, proper reset sequence).
Tried different USB-to-Serial adapters.
Checked signal integrity and power stability (3.3V regulated).
Tried slower baud rates and different computers.
Attempted to enter bootloader manually again via BOOT0 + Reset combo, to no avail.
I would greatly appreciate your assistance in diagnosing and resolving this issue. Specifically, I would like to know:
Is this a known issue with the STM32G071CBT6TR UART bootloader?
Are there any documented limitations or special procedures required after the first flash?
Is there a way to fully reset the bootloader to an initial working state?
Please let me know if you need schematics, logic analyzer captures, or any additional diagnostic information.
Thank you in advance for your time and support.
Best regards,
2025-06-25 6:01 AM
The BOOT0 pin state is ignored on this microcontroller by default. You need to change the option bytes if you want different behavior.
On the first boot, since flash is empty, it boots into the bootloader. After that, it boots into user flash.
To recover, you will need to change the option bytes using a SWD programming connection.
2025-06-25 6:15 AM
i have some other question if you mind
1) Is modifying the option bytes via SWD the only method to enable bootloader mode using BOOT0 on this MCU?
2) Is there any documentation or official application note that clearly describes this boot behavior for the STM32G071 series?
3) Is there a recommended way to safely configure option bytes so the bootloader is always available when BOOT0 is high?
2025-06-25 6:48 AM
1) After it's already programmed, yes. If not yet programmed, the bootloader could do this via STM32CubeProgrammer.
2) AN2606 describes how to get into the bootloader. The reference manual describes default option bytes.
3) Set BOOT_SEL = 0 to have the BOOT0 pin be sampled on startup rather than the nBOOT0 bit.
2025-06-25 6:56 AM
Thank you very much for the detailed clarification, have a great day sir.