Skip to main content
KMill
Senior
Jul 27, 2026 5:45 PM UTC
Solved

STLink porgrammer up and down like a sabbath lift

I’m using VSC with the STM32 extensions.

When running debug sessions at leat 50% of the time I get this error message:


Error in initializing ST-LINK device.
Reason: USB communication error. Please reconnect the ST-LINK USB cable and try again.
cube has exited with code 3

 

I have a good quality USB lead and I’m running on macOS on a Mac Mini M2

Cartu38 OpenDev
Cartu38 OpenDevBest answer
Graduate II
Jul 27, 2026 7:25 PM UTC

​@KMill 

100% failure would probably help more 😅.

Half-kidding, but let's give us a chance to help you! Could you at least share more about the device (board) you're connecting to?

Also, could you please copy and paste the debug console trace when it fails?

(Tip: Two extra directives can be added to your launch.json file to get more details if needed.)

 

4 replies

Cartu38 OpenDev
Cartu38 OpenDevBest answer
Graduate II
Jul 27, 2026 7:25 PM UTC

​@KMill 

100% failure would probably help more 😅.

Half-kidding, but let's give us a chance to help you! Could you at least share more about the device (board) you're connecting to?

Also, could you please copy and paste the debug console trace when it fails?

(Tip: Two extra directives can be added to your launch.json file to get more details if needed.)

 

Pavel A.
Jul 28, 2026 12:56 AM UTC

> I have a good quality USB lead

Sure? How do you know? 

KMill
KMillAuthor
Senior
Jul 28, 2026 9:19 AM UTC

Well, 

It wasn’t the lead of the programmer.

It was my USB Hub. It died this morning completely.

Strangely, yesterday only the STLink was playing up - the mouse and USB Microscope were both fine, but this morning every port was dead.

New hub and everything is working well today.

Pavel A.
Jul 28, 2026 10:31 PM UTC

Thank you for the idea, btw.  Nobody has invented a sabbath USB hub yet, it’s interesting how such thing can be used, and for which commandment  ;)