cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link/v2 intermittently stops working and must be disconnected and reconnected to USB port. Is there a way to fix this behavior?

KLock.2
Associate II

We are using STM32_Programmer_CLI.exe in a production environment to load firmware. After a few loads (randomly) the ST-Link/v2 is no longer available to the software. The STM32CubeProgrammer shows "No ST-LINK detected". We must disconnect the ST-Link/V2 from the USB port and reconnect it to continue production.

In desperation, I added this command to our production software so that we will know sooner and waste less time waiting for the error to occur: "C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe -c port=swd FREQ=4000"

The error we receive is "1". I could not find a description of this error in the manual.

Is there any command that I can send to the ST-Link/V2 That might prevent this Problem?

Is there any troubleshooting procedure I can use to track down the issue down to fix it?

3 REPLIES 3

Directly connected USB ports, or via hub or docking station?

H​ubs frequently give me quirky behaviour with the ST-LINK

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
KLock.2
Associate II

Both. We had so much trouble with it directly connected (we had to unplug and replug the USB cable so much the connection started getting loose) that we purchased a hub with switches so that all we had to do was turn the port off and then back on (effectively the same as unplugging/replugging).

KLock.2
Associate II

By the way, we are using a powered USB hub.