2020-08-28 03:58 PM
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?
2020-08-28 04:18 PM
> 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.
2020-08-29 02:16 AM
Is the STLink okay? Do you use a short enough cable?
JW
2020-08-29 10:02 AM
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.
@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.
2020-08-29 10:43 AM
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.