cancel
Showing results for 
Search instead for 
Did you mean: 

Program STM32G030 by UART

Laurie1
Associate III

I'm trying to program STM32G030 but I don't have a ST-LINK.

I wonder is it possiable to program this chip through UART interface? 

There is a LED-BLINKING program programed by distributer in main flash memory. I have tried to pull BOOT0 to VCC and reset the chip. But the LED on the board is still blinking. I got confused why this chip doesn't go to bootloader but still excute program in main flash memory instead.

If you got any idea about this question, please let me know. Thank you !

7 REPLIES 7
Uwe Bonnes
Principal III

Boot0 and Reset may be remapped and set by option bits. Only possible way to attach to such a device in my understanding is:

  • Pull and keep reset low
  • Power up device
  • Connect via SWD under reset

Get a working G0 nucleo or disco board to try out the procedures and your understanding. Then review the board you have and what is happening with the board.

Thank you for the information. I think I have to purches a ST-LINK as soon as possiable:ok_hand:

Better buy a G0 Nucleo. You can practice your code on that board and you can use jumper wires to program your boardlater . An STLink is integrated on the Nucleo board.

A standalone STLink has no reset buttom. To practice thye procedure above, you need to keep the reset buttom pressed by hand, as STLink can not do that programmatical.

I got an tiny evaluation board with reset bottom and SWD port at current time:eyes: . Anyway thank you for your advice.:folded_hands:

MM..1
Chief III

AN2606 start pattern 11

Boot0(pin) = 0, nBOOT0_SEL(bit) = 0, BOOT_LOCK(bit) = 0 and main Flash memory empty

when this is default config your MCU start system memory bootloader and you can load first code UART... , but for next starting you need method in your code to jump to system bootloader... read AN

And what is your board have blinky and dont have onboard USB stlink?

If I set nBOOT0_SEL bit to 1, nBOOT0 bit to 1 (boot from main flash memory and BOOT0 pin are not connect to boot mode), and remap SWDIO, SWCLK to reset state (SWD are disabled). I wonder is it possiable to program this chip again?

Thank you.0693W00000JMw9BQAT.png

Yes seems your blinky board have WTF setup from line 4.

Then you only can use SWD to get it back or replace chip on board with empty one.

SWD under reset is always work onle RDP level 2 i mean bloack it.