2018-05-14 01:05 AM
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
2018-05-14 02:02 AM
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.
2018-05-14 06:54 AM
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 OS2018-05-14 07:03 AM
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
2018-05-14 08:51 AM
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.
2018-05-14 09:18 AM
I suspect he produces brown-outs in the USB device, i.e. the ST-Link.
2018-05-14 09:20 AM
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.
2018-05-14 09:30 AM
Some grounding issues ?
2018-05-14 09:34 AM
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)
2018-05-14 09:35 AM
brown outs in STLink? How can i check it?