2023-07-20 05:03 PM
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
2023-07-20 06:55 PM - edited 2023-07-20 06:57 PM
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.
And AN3155 for the UART protocol.
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.