Permission denied
Your OS is blocking access to the USB device.
PERMISSION_DENIED
Symptoms
- The probe appears in lsusb (Linux) but MCUHex/pyOCD cannot open it.
- Errors mention LIBUSB_ERROR_ACCESS, "Access denied (insufficient permissions)", or the probe list stays empty unless the SDK runs with sudo.
- On Windows, the probe shows a warning icon in Device Manager, or only works in one specific tool.
Likely causes
- Linux: missing udev rules — USB devices are owned by root by default, so your user account cannot open the probe.
- Windows: wrong or missing driver — the ST-Link needs ST’s driver; a vendor-specific driver bound by another tool can also block generic access.
- The SDK runs as a different user than the one the udev rule grants access to.
How to fix it
-
Linux: install the probe udev rules
Install ST’s rules, or pyOCD’s ruleset covering ST-Link, J-Link and CMSIS-DAP, then reload udev. A minimal ST-Link V2/V3 rule is shown below.
sudo cp 49-stlinkv2.rules 49-stlinkv3.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules sudo udevadm trigger # minimal rule contents (V2 / V2-1 / V3): SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666", TAG+="uaccess" SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="374b", MODE="0666", TAG+="uaccess" SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="374e", MODE="0666", TAG+="uaccess" -
Linux: replug the probe
udev rules apply on device insertion — unplug and replug the USB cable after reloading rules. Do not keep running the SDK with sudo as a workaround.
-
Windows: install the ST-Link driver
Install ST’s official ST-Link USB driver, then check Device Manager: the probe should appear without a warning icon.
-
macOS: allow USB access if prompted
Recent macOS versions may prompt when a new USB device is accessed; approve it in System Settings → Privacy & Security.
-
Retry in MCUHex
Refresh the device list. The probe should now open without elevated privileges.