Skip to main content
SA.3
Associate
November 15, 2021
Question

STM32 programming using ST link V2.

Hi,

We are using STM32F407VG MCU for one of the project and for programming we are using ST link V2. The MCU has SWD pinout, when we try to connect the MCU using STM32cube programmer we are getting the below errors,

ST-LINK error (DEV_USB_COMM_ERR)

Error: Problem occured while trying to connect

Tried to program the MCU with different laptop using STM32Cubeprogrammer but same error. We have 4 boards which need to be flashed, we were able to flash one board successfully but the other boards are not getting programmed.

Would like to know how to solve this issue.

Thanks,

Sreekanth

This topic has been closed for replies.

7 replies

TDK
November 15, 2021

Are all 4 boards the same? If 1/4 board works, the most likely explanation is that the programmer is okay but there are hardware issues with 3/4 boards. It is detecting a target voltage, so power is probably okay as well. Look for solder bridges or other bad connections on the board. You can also try a lower clock speed.

"If you feel a post has answered your question, please click ""Accept as Solution""."
SA.3
SA.3Author
Associate
November 15, 2021

Yes, all the 4 boards are same.

I forgot to mention one more point. I was able to flash one board for once, after that when I tried to re-flash the board I am getting the same error. I have checked for bad solder bridges, bad connection etc..

Uwe Bonnes
Chief
November 15, 2021

Try another debugger that is more verbose so you get more hints of what is wrong. Did you also try to connect under reset?

David Littell
Senior II
November 15, 2021

The "DEV_USB_COMM_ERR" implies that STM32CubeProgrammer is having trouble talking to the ST-LINK. I'd suggest checking/replacing the USB cable and then using CubeProgrammer to update the firmware in the ST-LINK.

SA.3
SA.3Author
Associate
November 16, 2021

We tried flashing another MCU (Different board/MCU) with JTAG interface and is working fine. We are having trouble flashing MCU in SWD mode. Before posting in community we tried to flash using another PC, still we got the same error.

Tesla DeLorean
Guru
November 16, 2021

NRESET connected?

BOOT0 ?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SA.3
SA.3Author
Associate
November 16, 2021

MCU NRESET is connected to debugger. BOOT0 is pulldown using 510 ohm resistor and Boot1 is pull up using 10K resistor.