cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 programming using ST link V2.

SA.3
Associate II

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

7 REPLIES 7
TDK
Guru

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
Associate II

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
Principal III

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

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
Associate II

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.

NRESET connected?

BOOT0 ?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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