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
Posted on May 15, 2018 at 08:51

Monitor the supply voltage of the ST-Link (to the F103 MCU), together with the USB traffic (or another measurable event that marks said loss of connection). Will probably require you to remove the casing of the ST-Link.

I would perhaps include the current drawn from the 24V supply in the tracing.

If connection losses correlate with current surges, you might have a ground level issue.

Even if all ground connected together, large currents through thin (ground) wires can offset logic levels of the affected device substantially.