cancel
Showing results for 
Search instead for 
Did you mean: 

In the STM32G031 do you need to set any pins a certain way to be able to reprogram the chip with ST-LINK or with the Bootloader?

KiptonM
Lead

I had PA13 and PA13 set as a GPIO. I was able to program it one time with both the ST-Link V2 Clone, a.k.a Blue Pill, and via the Bootloader program stm32flash (on SorceForge.net) using the UART.

Both would only work on a new chip. Once the chip was programmed neither one would work again on that chip.

I can understand that the ST-LINK probably needs PA14 (boot) to be set as SYS_SWCLK and PA13 needs to be SYS_SWDIO for the ST-LINK to work while it is running.

But I would have thought by using the bootloader and setting BOOT0 high before releasing (bringing it high) NRST (Reset) the chip would go directly to the Bootloader and be unaware of anything you set the BOOT0 pin to in the user code.

None of the bootloader documentation says anything about reserving any pins for any function that I have seen. If it is there then it needs to be clearer, because I do not see it.

What do I have to do to be able to reprogram the chip with the bootloader a second time? We want to be able to upload new firmware once installed without tearing the equipment apart.

10 REPLIES 10
S.Ma
Principal

Low pincount raises the bar for debugging and programming. Reset pin that can turn as IO, boot pin shared with swd signal, swd pins that can too tun as IO.... and FW which can clock stop the core. All this suggest to have a way for the SW to trigger a IO reconfig to programming, a special analog voltage, a long key presssed, a pull up/down at power up on pins, even playing with the time it takes to charge discharge a decohpling cap detect on a slow gpio pin could be considered.... food for thoughts....