cancel
Showing results for 
Search instead for 
Did you mean: 

[Linux] STM32Cube for VS Code: /dev/ttyACM0 + Debugging issues fixed with STSW-LINK007 + libusb-1.0

saacifuentesmu
Associate

Context

Fresh Ubuntu 24.04, STM32 board (ST-LINK/V2-1 0483:374b), STM32Cube for VS Code 3.6.4.
Out of the box, both Serial Monitor and debugging failed:

**** Failed to open the serial port /dev/ttyACM0 ****

Adding myself to dialout didn’t help; debugging couldn’t connect to any target.

Root cause

STM32Cube for VS Code doesn’t install udev rules or USB deps for ST-LINK on Linux. Result:

  • /dev/ttyACM* gets recreated with restrictive perms on each replug.

  • The debug adapter (ST custom DAP / libusb backend) can’t init properly.

Fix (repeatable)

  1. Install USB dependency + ST udev rules

sudo apt update
sudo apt install libusb-1.0

Download STSW-LINK007, then follow itsreadme.txt.

  1. Replug the board and verify:

ls -l /dev/ttyACM*
# example:
# crw-rw----+ 1 root dialout 166, 0 Nov  4 16:39 /dev/ttyACM0
  1. Verify debugging in VS Code
    Run: Run & Debug → STM32Cube: ST-LINK GDB Server.
    Debug now starts normally with ST-LINK/V2-1 and Cube 3.x.

1 REPLY 1
vincent_grenet
ST Employee

@saacifuentesmu 
Thanks for sharing, and well done!
Currently, the same applies to Windows OS but with a different package: https://www.st.com/en/development-tools/stsw-link009.html. W
e are pointing these Thanks resources shortcut:
vincent_grenet_0-1762324026337.png
As part of our roadmap, we are working on smarter integration of all these features.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.