cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link/V2 and ST-Link/V2-1 issue

Fahad Mirza
Associate II
Posted on June 21, 2017 at 18:03

I have a custom board with STM32L051 on it. I am using an example from ST (I-Cube_lrwan). For some reason, once I load the firmware I cannot access the MCU anymore using ST-Link Utility and ST-Link/V2. It always throw 'Cannot connect to target'. But if I press the reset button before I press 'Connect' (in ST-Link Utility) and release the button right after I press 'Connect' , ST-Link/V2 can find my MCU.

But... when I use ST-Link/V2-1 from a Nucleo Board, it works perfectly. To me, its like ST-Link/V2-1 can reset the MCU properly where ST-Link/V2 cannot for some reason.

Can anyone suggest me what should I do if I want to use ST-Link/V2, in my case?

#st-link
13 REPLIES 13
Posted on June 21, 2017 at 22:50

I would try to upgrade the ST-LINK firmware first. Use the build-in ST-Link capability to do it. Sometimes you will need to reconnect the usb cable to enter the programming mode.

Olivier GALLIEN
ST Employee
Posted on June 22, 2017 at 10:07

Hi

fahadmirza

Do you select 'Connect under reset' mode in ST-Link Utility ?

Does you firmware enter any low power mode or change SWD GPIO settings which can explain you can't reconnect with a normal system reset ?

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Posted on June 22, 2017 at 15:05

Sometimes you need to connect to the device under reset.

I am talking about upgrading the firmware on ST-LINK programmer (not the target MCU).

Fahad Mirza
Associate II
Posted on June 22, 2017 at 18:34

Hello

Golab.Piotr

,

It has the updated FW. At least that's what ST-Link is showing me (FW ver: V2.JS7 STM32+STM8 Debugger). Nucleo ST-Link FW version is V2.JM17 STM32 Debug+Mass storage

Hi

GALLIEN.Olivier

‌,

Yes, the HW goes to low power mode (STOP mode) and change the SWDIO and SWCLK pins to analog. I did get the warning on ST-Link Utility ('Device is disconnected') right after I flash FW. For a long period of time I thought this was the problem and that's why I was using the external RESET button to flash my MCU.

But... the ST-Link from Nucleo can access my MCU, with low-power and changed pin configuration. That's why I was wondering what are the differences between these two ST-Links

N.B. My Nucleo board has ST-Link/V2-1 (that's what datasheet says) and the separate programmer is ST-Link/V2. And I am using 'Connect under reset'.

Posted on June 23, 2017 at 10:23

For a connect under reset the ST-LINK drive the NRST signal of the MCU. 

On Standalone V2 probe the CN3.15 is driven and should be connected to NRST of your MCU.

Is it the case ? 

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Posted on June 23, 2017 at 18:51

I am not sure which pin is CN3.15. The ST-Link I have is shown below. RST is connected with my MCU's NRST.

0690X00000607KiQAI.png

I hope I am not having issues because it is not made by ST. Do you think that's a possibility?

Posted on June 23, 2017 at 22:24

http://www.st.com/content/ccc/resource/technical/document/user_manual/65/e0/44/72/9e/34/41/8d/DM00026748.pdf/files/DM00026748.pdf/jcr:content/translations/en.DM00026748.pdf

 

The use of NRST you indicate should suffice.

You are likely to lose connectivity if you allow the CPU to go into a low power/sleep mode, try defining 

LOW_POWER_DISABLE

DISABLE_IRQ();

/* if an interupt has occured after __disable_irq, it is kept pending

* and cortex will not enter low power anyway */

if (State == LOWPOWER)

{

&sharpifndef LOW_POWER_DISABLE

LowPower_Handler();

&sharpendif

}

ENABLE_IRQ();
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 26, 2017 at 10:26

Hello

Mirza.Fahad

Seems this probe is not working properly.

May I suggest you to get ST Standalone probe or keep using Nucléo STLINK/V2-1 ?

Br,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Posted on June 26, 2017 at 11:55

I had very similar issues with that knock off ST-Link. As far as I can tell the RST pin is driven only when used in SWIM more (for STM8), not SWD.

I'd suggest you reflash the thing with

https://github.com/x893/CMSIS-DAP

and remap the RST signal from PB0 to PB6.