cancel
Showing results for 
Search instead for 
Did you mean: 

Programming the STM32G030F through serial interface

RickH
Associate

Greetings,

I've always programmed MCU's using USB connector (e.g., on Nucleo boards) or through JTAG (for custom boards).  We are considering STM32G030Fx (TSSOP20 package) for sensor control - however, I need to figure out how to program the chip.  From what I've read, I need to assert BOOT0, then use either I2C or UART to make the physical connection to the board; UART is my preferred interface.

I imagine I would hook an FTDI board between my computer (i.e., USB) and the MCU UART TX/RX pins.  What then?  Select ST-Link in CubeIDE with SWD.  Anything else? Is there a cheat-sheet available that describes the process?

Any help would be greatly appreciated!  Thanks much!! Rick

1 REPLY 1
TDK
Guru

Assuming you are in the bootloader (hold BOOT0 high during reset), you can program over UART using STM32CubeProgrammer. Select UART instead of ST-LINK. You could create an External Tools script to program the chip this way from within CubeIDE. I don't think CubeIDE has native UART/I2C programming capability.

See AN2606 for supported bootloader pins.

https://www.st.com/resource/en/application_note/an2606-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

 

And AN3155 for the UART protocol.

https://www.st.com/resource/en/application_note/an3155-usart-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

 

That being said, developing on a board without a debug interface is slow going and frustrating. Better idea would be to create a dev board with the debug interface and remove it after the firmware is complete.

If you feel a post has answered your question, please click "Accept as Solution".