cancel
Showing results for 
Search instead for 
Did you mean: 

How to Program STM32G031F6P* TSSOP20 package with ST-Link V2

JasurDovurov
Associate II

Hi Engineers,

I am kinda new to the STM32 MCUs. I have a custom PCB powered with STM32G031F6P* TSSOP20 MCU. so on the PCB, I have a PIN "SWCLK", "SWDIO", GND, and VCC for programming. NRST is pulled HIGH. the strange thing is that BOOT-0 is on the same pin as SWCLK). and my ST-Link V2 can not connect to this PCB.

So my question is How do I program this chip? is this even possible to do?

I think I can program it with UART-1 and with the help of the BOOT-0 pin. But I do want to program this PCB with my current PCB design and configuration.

please help me with this issue!

I will attach the schematics

Best Regards

Jasur

0693W00000WIfPBQA1.png

3 REPLIES 3
MM..1
Chief III

You need NRST on programming pinheader.

Andreas Bolsch
Lead II

In general, you need neither NRST nor BOOT0 pin for attaching debugger/programmer via SWD (the state of BOOT0 - in this case shared with SWD pin - is only sampled during reset, hence don't care later on). BUT: Probably you've already flashed something into the controller?! And probably this program touches the pin configuration of PA13/14/15 and consequently disables the SWD interface?!

In this case, the debugger must attach while NRST is pulled low ...

So it's a good idea to have NRST on the programming header, but with some care, it's not really necessary.

JasurDovurov
Associate II

@MM..1​ many thanks for your help, it actually helped and I also needed to remove pull up resistor.

But after all, I found a little solution after some investigation, I just configured the programmer to reset via software reset instead of hardware reset. you can see this in the attached photo.

0693W00000WIhbYQAT.png