cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link V2 dongle broken?

parsec
Associate III
Posted on November 26, 2016 at 11:20

Purchased from Mouser 1.5 years ago but not used until now. I am getting ''Can not connect to target!'' error message in ST-Link Utility whether I try my Mini-M4 for STM32 (415RG, JTAG/SWD) or my Discovery board (407VG, SWD).

Using the Discovery onboard ST-Link I can connect to the Mini-M4 using SWD without problems so the chip is fine. Programming either board via bootloader - also fine. I have tried on a different PC, swapping USB cables, updating ST-Link firmware, verifying the wiring etc. etc. with no luck.

In the ST-Link Utility error log I see this:

ST-Link/V2 device detected

Target voltage detected: 1.565422

Error getting target IDCODE: if SWD, check SWD connection

Error (4) while initializing ST-Link in SWD mode

Is the target voltage too low?

This is so frustrating, just when I need it if refuses to play. Are there ways to further fault search this issue or should I just stop pulling my hear, declare it shot and move on and buy another one?
4 REPLIES 4
abarrotes
Associate II
Posted on November 26, 2016 at 17:06

Recently, I'm having exactly the same problem but I don't think the dongle is broken.

I went step by step into debugger mode and it was occurring in flash sector erase function. then if you pass slowly to this then you don't get the problem, but it result longer to debug instead of focus in your main zone.

It could be the configuration of your project because I have others projects that I can debug without any problem. 

Its just my experience but It would be nice to have an answer from an expert.

parsec
Associate III
Posted on November 26, 2016 at 18:19

I'm using ST-Link utility and can't even connect to the MCU, much less enter debug mode.

Posted on November 27, 2016 at 01:22

Telling me you checked the connections doesn't tell me exactly how you have it connected.

The target voltage on an STM32-DISCO is typically 3V, the stand-alone ST-LINK requires a connection to VDD and VSS, as it has pin drivers so it can match the targets operating voltage.

At a minimum I'd connect 3V, GND, SWDIO, SWCLK, NRST

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
parsec
Associate III
Posted on November 27, 2016 at 11:12

Bingo! See below...

 

 

At a minimum I'd connect 3V, GND, SWDIO, SWCLK, NRST

 

 

That's how I connected it. Key here was V

APP

(dongle pin 1). It must be connected to V

DD

on the Disco or the SWD connection will fail. Once I did that it worked just dandy. For reference, here is the connection scheme that was required for me to get the communication to work, assuming an unpowered target.

ST-Link pin    STM32-Disco pin

1-V

APP

        V

DD

7-SWDIO        PA13   

9-SWCLK        PA14

15-NRST        NRST

19-

V

DD

         3V

20-GND         GND

CN3 jumpers on the Disco must be off.

Skipping 19/V

DD

and powering the board via USB instead does not work, at least I never managed to get it working this way.