2017-06-21 09:03 AM
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-link2017-06-21 01:50 PM
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.
2017-06-22 01:07 AM
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
2017-06-22 06:05 AM
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).
2017-06-22 09:34 AM
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'.
2017-06-23 03:23 AM
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 ?
2017-06-23 11:51 AM
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.
I hope I am not having issues because it is not made by ST. Do you think that's a possibility?
2017-06-23 03:24 PM
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();2017-06-26 03:26 AM
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
2017-06-26 04:55 AM
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
and remap the RST signal from PB0 to PB6.