Skip to main content
Visitor II
March 28, 2022
Question

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

  • March 28, 2022
  • 1 reply
  • 1413 views

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 :)

    This topic has been closed for replies.

    1 reply

    Graduate II
    March 28, 2022

    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.

    HMoaz.1Author
    Visitor II
    March 28, 2022

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