Welcome to 16892 Developer Community-Open, Learning,Share
menu search


I'm learning about embedded systems and have an idea about one small project and I want to use Cortex M0+ based MCU STM32G081KBT6. I saw a lot of tutorials with this MCU type, but all of them are based on developer board and with them it is very simple to upload code with USB cable. I want to make my custom PCB for this. So my question is what I have to do so I can upload my code to this microcontroller?

From a datasheet I think I have to use SWDIO (PA13) and SWCLK(PA14) ports for Boot, but if someone can help me do I have to use also some resistors, can I make it USB to wire transfer with this, or I have to use some external device to make it possible? Or there is some easier and better solution to upload code from my laptop to microcontroller?

Thanks for the replies.

thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome To Ask or Share your Answers For Others

1 Answer

There two main options:


Implement an SWD programming connector. Basically the pins GND, SWDIO, SWCLK and preferably 3.3V are made available. No resisters are needed. You can fit a 4 pin header, an official 10 pin SWD connector or just 4 pads (for connecting using an adapter with pogo pins).

This option requires an SWD debug adapter like ST-Link or J-Link. In addition to uploading firmware, this option supports debugging.


Make the USART (RX, TX) pins plus GND and 3.3V available on the board. This option requires a USB-to-serial adapter.

It's also possible to use I2C or SPI instead, though there are no standard solutions for connecting to your board that I'm aware of.

USB isn't an option for this particular chip. It is supported on many of the more expensive STM32 chips though.

I strongly recommend the first option. It is far more versatile than the other options. And an ST-Link adapter isn't expensive.

Details regarding the bootloader capabilities and pins:


thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share