cancel
Showing results for 
Search instead for 
Did you mean: 

STLink-V2 Issue

JReas.1
Associate

I am having trouble communicating with a STM32F042K6T6 microcontroller (on a custom soldered board) via a ST-LINK V2. Whenever I try to connect I receive the error: “Cannot connect to target!�? The STLink V2 does register and I can see it in the software.

Here is what I have connected (I am using the LQFP32 package):

3.3V to VDD, VDDA, and VDDIO2 (all tied together)

SWCLK to CLK/PA13

GND to VSS (both pins 1 and 16)

SWDIO to DIO/PA14

No other pin is connected

Here are the software versions:

STM32 ST-Link Utility-v4.5.0.0

STMLinkUSBDriver.dll-v5.1.2.0

ST-LINK_CLI.exe v3.5.0.0

STLINK V2 Firmware-V2J34S7

What I have tried:

I have soldered another microcontroller to an empty board without any components and tried to connect to it. However, there was no difference.

I have tried all different frequencies of both JTAG and SWD, and all three modes (Normal, Hot Plug, Connect Under Reset) and all three reset modes (System Software, Hardware, and Core. However, nothing seems to change.

I have tried to connect PB8-BOOT0 (pin 2) to both GND and to 3.3V.

I have tried to use external 3.3V to give it more current.

What I am wondering:

              Is there a way to make sure that the chip still works to confirm that I have not plugged anything backwards and killed it?

What am I doing wrong?

4 REPLIES 4
TDK
Guru

> empty board without any components

Do you have the appropriate caps on the board? I can't imagine it'll work without VCAP at the least.

It should work, not much else to say. Check power rails, check for solder bridges, check for appropriate chip orientation. Check that the power draw is appropriate.

Typically NRST is also connected, but unless you've remapped SWDIO/SWCLK, you shouldn't need it.

> GND to VSS (both pins 1 and 16)

Is VSS connected to all other VSS pins along with VSSA? Same question for VDD/VDDA.

If you feel a post has answered your question, please click "Accept as Solution".

Is the STLink okay? Do you use a short enough cable?

JW

JReas.1
Associate

Thank you so much for your responses!

@TDK

I am not sure what caps you are referring to. I did have two 100nf capacitors on one board between 3.3v and ground, but cannot find “VCAP�? or where it should go in the documentation, so any further reference would be useful. The VSS and VDD pins are connected to all other VSS/VDD pins (shorted together) I have also attached the schematic to show what I have. Currently only power related connections are connected.

0693W000002liEEQAY.png 

@waclawek.jan

I have two STLinks and there are both doing the same things. I am using the cables that come with the STLink, and I have tested continuity between the STLink and the pins they should connect to. Thus, I think that that section it alright.

TDK
Guru

This package doesn't have VCAP pins, so disregard that advice.

It does suggest larger caps in addition to the 0.1uF ones. I doubt that's the issue, but it could be. From datasheet:

Also recommended is a 0.1uF cap on NRST. Unlikely to be the problem here, but it could bite you when the program is running. Maybe you even have it somewhere else.

You could try reducing the SWD clock speed to see if that works better.

Can't see any other issues in the schematic.

If you feel a post has answered your question, please click "Accept as Solution".