STM32G070KBT6 does not exit USART1 bootloader without a hard reset
How can I exit STM32G070KBT6 USART1 bootloader without cycling the power?
All I have to do to exit the USART1 bootloader on the STM32G030K8T6 or the Nucleo-G031K8 is to set the nBoot0 bit in the FLASH_OPTR register and then it immediately starts running the application code.
If I do the exact same thing with a STM32G070KBT6 it only runs the application code after I cycle the power.
I need the ability to exit the STM32G070KBT6 USART1 bootloader without cycling the power so I can upgrade firmware remotely. Is there a different way to exit the bootloader using the USART?
This issue can be reproduced using the STM32CubeProgrammer
- Program the target PCB with the STM32G070KBT6 with some simple code to blink an LED so you can tell when the PCB is running the program (LED blinking), or the PCB is in the bootloader (LED not blinking).
- Use an ST-Link to put the target PCB with the STM32G070KBT6 into the bootloader by changing the following Option Bytes User Configuration bits:
- BOOT_LOCK = unchecked
- nBOOT_SEL = checked
- nBOOT1 = checked
- nBOOT0 = unchecked
- Then click “Apply”.
- Click “Disconnect”.
- You can power down now and disconnect the ST-Link.
- Connect a USB to serial port cable between the computer and USART1 on the target PCB with the STM32G070KBT6.
- Power up the target PCB. The target PCB should boot to the bootloader and the LED should not be blinking.
- In the STM32CubeProgrammer select “USART” instead of “ST-LINK” then click “Connect”.
- Change the User Configuration bits so it will boot to the application (main flash memory).
- BOOT_LOCK = unchecked
- nBOOT_SEL = checked
- nBOOT1 = checked
- nBOOT0 = checked
- Then click “Apply”.
- Notice the LED is still not blinking. The only way to make the application run is to cycle the power. After the power is cycled it boots to the application and the LED blinks.
- If you do the same exact procedure with the STM32G030K8T6 it does not require the power to be cycled to run the application. The application starts running and the LED blinks as soon as you click on “Apply” to change nBOOT0 from unchecked to checked.
