cancel
Showing results for 
Search instead for 
Did you mean: 

How to restart ST Link automatically.

b k
Associate II
Posted on May 14, 2018 at 10:05

Hello all

I am quite new to STLink. I am trying to program a microcontroller using STLink/V2. In normal situations it works perfectly. but at times i do have a communication error with STLink and it shows' USB communication error'. The settings are all unchanged but still a communication error occurs between STLink & computer.

After sometime i noticed that when I unplug the usb cable and plug it again, the STLink & the programming works again.

So i tried using DEVCON.EXE utility from cmd line to enable & disable the STLink USB port automatically, before starting programming each time. It works in a way, but for that i need Admin rights, which is not available on the account where i use the final application. 

So i would like to know whether there is some option within STLink to restart the STLink or to enable/disable the USB port.

Thanks

Bk

10 REPLIES 10
AvaTar
Lead
Posted on May 14, 2018 at 11:02

In normal situations it works perfectly. but at times i do have a communication error with STLink and it shows' USB communication error'.

Are you sure you do not have an application problem ?

If the ST-Link and the target are on the same board (Discovery, Nucleo), an over-current will affect the ST-Link as well.

BTW, you could be a bit more informative, like the board you use, target application, ST-Link firmware version, host OS, host USB driver version, etc.

b k
Associate II
Posted on May 14, 2018 at 13:54

I am having a PCB with testpoints which contains the BT121 module (Bluegiga). The test points are then  connected to STLink via 20-pin flat cable.( like Pin 1 to Target Voltage 3.3V, Pin7, Pin9, Pin 20 - to GND). A Renesas Flash programmer E1 is also connected to the PCB but only one of them (either E1 or STLink) is powered ON at a time.

Here are further infos:

I am using a  STMicroelectronics STLink Driver 1.1.0.0 ( under Device Manager--> Driver)

        STM32 ST Link Utility v4.1.0.0

        STLinkUSBDriver.dll    v5.0.2.0

        ST-Link_CLI.exe        v3.1.0.0

        STLink Firmware version --> V2.J28.S7 STM32+STM8 Debugger

        Operating System Win 7 64bit OS
Pavel A.
Evangelist III
Posted on May 14, 2018 at 16:03

Most ways to reset a USB device, like using devcon, indeed require elevation. Either in runtime, or to set up things.

Maybe this is an issue which can be fixed in the driver, or ST-LINK DLL or utility, if you could reproduce it clearly for ST support.

-- pa

Posted on May 14, 2018 at 15:51

Is the ST-Link supposed to supply power to your setup ?

And if so, is the drawn current within the specs of the ST-Link device ?

I don't have your hardware/setup, so you will need to verify this points.

I never had any communication abort problems caused by the ST-Link, and haven't heard of any.

Posted on May 14, 2018 at 16:18

I suspect he produces brown-outs in the USB device, i.e. the ST-Link.

b k
Associate II
Posted on May 14, 2018 at 16:20

On the PCB i am having another IC which is powered by 24VDC. This IC produces a 3.3V which is then connected to Pin 1 of STLInk.

The communication error does not occur regulary but random. like 1 in 10 times. And once such an error have occured, then i have to unplug and re-plug stlink usb. otherwise it stays always.

Posted on May 14, 2018 at 16:30

Some grounding issues ?

b k
Associate II
Posted on May 14, 2018 at 16:34

In the beginning i also thought the same. then i connected all the GNDs each other . ( Pin 4,6,8,10,12,14,16,18,20 to GND)

b k
Associate II
Posted on May 14, 2018 at 16:35

brown outs in STLink?  How can i check it?