cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 will no longer go into bootloader mode, always executing my code instead upon reset

HMoaz.1
Associate

I successfully programmed the flash memory of a 20-pin TSSOP STM32G41 with a sample "blink program" using I2C connection and holding BOOT0 high (using the built-in System Memory bootloader), using stm32flash which I compiled on a linux machine. It all went flawlessly.

The connected LED blinks as expected. Yayyy!!!! :) Wait, not so fast.

Unfortunately I specified pin 20 for the LED, which is the I2C pin (due to incorrect instruction I found on the web).

Now even with BOOT0 pin connected to VCC the LED continues to blink after I hit reset.

(Note: the reset is working, while I hold the button down the LED stops blinking momentarily, but starts blinking immediately after I release the reset button).

How can I get the MCU back into bootloader mode?

FYI: I do not have a Windows machine, only MacOS and Linux. I cannot install or use a Windows platform application or hardware.

P.S. This is not an evaluation board or BluePill, I literally have a chip and the appropriate caps and resistors connected on a breadboard. Yes, the caps are right next to the VCC pin, and the reset pin, as I said, the programming went just fine and the led is blinking, I just can't get back to the bootloader to erase and reprogram it with something a little more useful than a blinking LED :)

2 REPLIES 2

Doesn't it have multi-use pins, and option byte settings?

I could see you getting it into a state where only your code runs.

So a) you need a method in your own code to erase or get to the loader, or b) connect via SWD and erase/reprogram from there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for the hint, I'll follow up on SWD.