2016-11-26 02:20 AM
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?2016-11-26 08:06 AM
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.2016-11-26 09:19 AM
I'm using ST-Link utility and can't even connect to the MCU, much less enter debug mode.
2016-11-26 04:22 PM
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, NRST2016-11-27 02:12 AM
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 VDD
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-VAPP
VDD
7-SWDIO PA139-SWCLK PA14
15-NRST NRST 19-V
DD
3V 20-GND GNDCN3 jumpers on the Disco must be off.
Skipping 19/VDD
and powering the board via USB instead does not work, at least I never managed to get it working this way.