Skip to main content
John Griswold
Senior
December 17, 2018
Solved

Trouble with ST-LINK/V2 debugger

  • December 17, 2018
  • 15 replies
  • 4441 views

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

    This topic has been closed for replies.
    Best answer by John Griswold

    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.

    15 replies

    Tesla DeLorean
    Guru
    December 17, 2018

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John Griswold
    Senior
    December 17, 2018

    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?

    John Griswold
    Senior
    December 17, 2018

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

    Tesla DeLorean
    Guru
    December 17, 2018

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John Griswold
    Senior
    December 18, 2018

    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.

    Tesla DeLorean
    Guru
    December 18, 2018

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John Griswold
    Senior
    December 18, 2018

    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...

    Tesla DeLorean
    Guru
    December 18, 2018

    Odd, the firmware can be down graded

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John Griswold
    Senior
    December 18, 2018
    After several house of looking I am unable to find any firmware. Do you happen to know where ST keeps it?
    Thanks
    Tesla DeLorean
    Guru
    December 18, 2018
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John Griswold
    Senior
    December 18, 2018
    Thank you, but apparently they don't like downgrading the firmware:
    13:08:59 : Error: Old ST-LINK firmware version. Upgrade ST-LINK firmware
    13:09:14 : Error: OLD ST-LINK firmware, please upgrade it before trying to reconnect
    At least it allowed me to upgrade again! Back to square zero.
    Just for my own edification, where did you find this? Do you just keep a repository of everything ST releases? :)
    Tesla DeLorean
    Guru
    December 18, 2018

    I archive stuff, it provides historical context to issues, and allows problems to be regression tested. One of the policies the people I work with have is to archive design documents, so design decisions can be reviewed with contemporary documentation.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John Griswold
    John GriswoldAuthorBest answer
    Senior
    December 18, 2018

    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.