Skip to main content
b k
Associate
May 14, 2018
Question

How to restart ST Link automatically.

  • May 14, 2018
  • 2 replies
  • 5524 views
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

    This topic has been closed for replies.

    2 replies

    AvaTar
    Senior III
    May 14, 2018
    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
    b kAuthor
    Associate
    May 14, 2018
    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
    AvaTar
    Senior III
    May 14, 2018
    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.

    Pavel A.
    May 14, 2018
    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

    AvaTar
    Senior III
    May 14, 2018
    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
    b kAuthor
    Associate
    May 14, 2018
    Posted on May 14, 2018 at 16:35

    brown outs in STLink?  How can i check it?