cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with ST-LINK/V2 debugger

John Griswold
Senior

I'm feeling really stupid about this. We were unable to debug in our circuit, so to check, we have a standalone STM32L021D4Px, mounted to a solderless breadboard. 3.3V is connected to Pin 14, ground to pins 9 and 1, NRST to pin 4, SWDIO to pin 13 and SWCLK to pin 14.

The debugger does not see the target. The Keil IDE sees the ST-LINK/V2 OK.

Clearly I'm missing something. Can anybody tell me what I'm missing?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
John Griswold
Senior

DOH! I knew it was going to embarrass me when the truth became evident.

We have the isolated version of the ST-LINK/V2. Of the 9 GND pins on the connector, five of them cannot be used for GND because they are disconnected or otherwise purposed.

I moved the GND signal from Pin 4 to Pin 20 and voila!

Thanks, Clive. You're the balls.

View solution in original post

15 REPLIES 15

Stand-alone ST-LINK, or on a DISCO/NUCLEO?

Stand alone needs VTARGET to be powered

Check voltage observed on NRST

VDDA on target needs to be powered

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

Thanks, Clive.

Standalone ST-LINK/V2.

VDDA at Pin 10 is connected to 3.3V.

NRST at 3.3V as well.

Don't know what VTARGET is - could you clarify?

VTARGET is probably listed as VAPP in the pinout for the ST-LINK/V2?

Sometimes called VTRef, pin1 on 20-pin ARM JTAG Header

Powers the target side IO buffers on the stand-alone ST-LINK

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

Yep - ST-LINK/V2 docs call it VAPP. It's connected to the 3.3V supply as well.

Ok, so what error are you seeing?

Do you see failure using ST-LINK with STM32 Cube Programmer?

If it can't connect, you're looking at issues with power, pins, orientation, etc.

Unpowered the device will be unresponsive.

Wrong pins the device will appear unresponsive.

Alternate signs-of-life is to strap BOOT0 High, attempt to connect to System Loader's USART, at 9600 8E1 send an 0x7F bit pattern, observe 0x79 response. See AN2606

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

The error I see under Cube Programmer is the ever-popular:

ST-LINK error (DEV_USB_COMM_ERR)

Error: Problem occured while trying to connect

I hooked up a 3.3 V FTDI serial cable, send a DEL char (0x7F), and got back the 'y' (0x79), so apparently there is power and ground, and the chip is alive.

Now it's a matter of finding which of the signals (that the hardware engineer and I both checked three or four times) is still screwed up. I'm going to need a nice slap upside the head, I suspect.

Thank you.

7. PA14 pin on TSSOP14 package acts as an output pin when the embedded bootloader is active (SPI1_MISO). On empty devices (devices from factory), the bootloader is active due to the empty check mechanism (refer to RM0377 reference manual). PA14 pin also acts as SWCLK. When programming devices in TSSOP14 for the first time, it is necessary to use the "connect under reset" method and the SWD interface to disable the bootloader by driving this PA14/SWCLK pin.

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

The programmer is not seeing the VTarget voltage, though I can measure 3.25V on the pin at the debugger module. Grrr. Now I'm getting a complaint about a corrupt database, and the following log messages:

09:44:29:242 : STLinkUSBDriver.dll loaded

09:44:29:243 : STLinkUSBDriver.dll loaded

09:44:29:244 : ST-LINK SN : 55FF6E067871515325212367

09:44:29:244 : ST-LINK FW : V2J32S7

09:44:29:244 : Voltage : 0.07V

09:44:29:244 : Error: ST-LINK error (DEV_NO_DEVICE)

09:44:29:279 : Warning: unknown or unsupported device

09:44:29:337 : Error: Device not supported

09:44:29:366 : Error: flash loader cannot be loaded. FlashLoaderPath = C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/FlashLoader/0x0.stldr

I did upgrade firmware in the ST-Link. Perhaps that was a mistake? I figured it would be safe as it's not Microsoft...