cancel
Showing results for 
Search instead for 
Did you mean: 

Programming the STM32G030K6T6 via USB (DFU)

MattH2
Associate III

Hi,

I originally planned to program my STM32G030K6T6 via USB using the DFU bootloader, but the datasheet doesn’t mention USB_DM/USB_DP, and STM32CubeIDE’s .ioc file shows no USB option under Connectivity, so I believe USB DFU isn’t supported. What’s the best and easiest way to program this MCU, considering future mass production? I’m looking for a reliable, scalable method.

Thank you for the assistance!

STM32G0 Series Bootloader

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

SWD is typically the best way to program as it's always active.

USB is not available on STM32G030K6T6. You can use the UART bootloaders. See AN2606 for supported pins. You can use the bootloader but you will need to ensure the bootloader is active. It'll start when the chip is empty, but after that, you will need to jump into it or program option bytes appropriately.

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

View solution in original post

7 REPLIES 7
TDK
Super User

SWD is typically the best way to program as it's always active.

USB is not available on STM32G030K6T6. You can use the UART bootloaders. See AN2606 for supported pins. You can use the bootloader but you will need to ensure the bootloader is active. It'll start when the chip is empty, but after that, you will need to jump into it or program option bytes appropriately.

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

I plan to mass produce the product I'm currently designing. The board itself is very simple, it reads sensor data from an IMU and provides basic feedback to the user via a strip of NeoPixel LEDs. Once I’ve ironed out any bugs, I assume that having only an SWD (Serial Wire Debug) interface on the production boards will be sufficient. That said, I’d like to confirm: will a single SWD interface be adequate for both programming and the relatively basic debugging required, even on the initial versions of the board?

An SWD interfaces provides programming and debugging capabilities and should be all you need. Only SWDIO/SWCLK/GND need connected. The SWO pin is optional and generally not used on simple projects.

You mention:

> Once I’ve ironed out any bugs, I assume that having only an SWD (Serial Wire Debug) interface on the production boards will be sufficient.

By the work "only" it implies have something else on the development (non-production) boards, but SWD is sufficient there too.

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

And is it not necessary to also use the NRST pin for the SWD connection?

MattH2
Associate III

I plan to include a USART header and an SWD interface in the initial designs of my project. I understand that the STM32G030K6T6 microcontroller has two USART channels. Can both USART channels be used to flash the board via the built-in bootloader? Specifically, I intend to use USART2 for this purpose.

It's not necessary to connect NRST to the debugger. It's optional and generally not needed unless you are reassigning SWD pins.

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

Read AN2606 to see the pins supported by the bootloader.

Introduction to system memory boot mode on STM32 MCUs - Application note

TDK_0-1754395288520.png

 

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