DEV Community

Hedy
Hedy

Posted on

How to check if STM32 has been detected by the computer?

Think of it in two steps:

  1. Did the PC even see any USB/serial device?
  2. Did it recognize it as an STM32 (ST-LINK, DFU, or USB-CDC)?

Exactly how you check this depends on:

  • what board you have (Nucleo / Discovery / Blue Pill / custom), and
  • how it’s connected (ST-LINK, native USB, or USB-UART).

I’ll give you a quick map first, then OS-specific checks.

1. Common connection types for STM32

Before checking the PC, make sure you know what should appear:

1. Nucleo / Discovery boards (on-board ST-LINK)

  • Connect via the USB ST-LINK port.
  • PC should see something like:
    • ST-LINK/V2-1 (debug interface)
    • Optional STM32 Virtual COM Port (serial)

2. Blue Pill / custom boards with ST-LINK dongle

  • ST-LINK USB → your PC
  • SWD pins → STM32
  • PC sees: ST-LINK/V2 (no COM port unless separate UART is connected)

3. Native USB from STM32 (USB CDC / custom USB)

  • Your firmware must configure USB.
  • PC sees:
    • Virtual COM port (USB CDC) or
    • Custom USB device defined in your code.

4. ROM USB bootloader (DFU mode)

  • Some STM32s in DFU mode appear as:
    • STM32 BOOTLOADER / “STM Device in DFU Mode”.
  • Use STM32CubeProgrammer over USB.

5. USB-UART adapter (no native USB on STM32)

  • USB-Serial dongle → PA9/PA10 (USART1) or another UART.
  • PC sees: USB Serial Device / CP210x / CH340 / etc (COM port).

2. Windows: how to check if it’s detected
A. Use Device Manager

  1. Plug in your STM32 board.
  2. Right-click Start → Device Manager.
  3. Look in these sections:

Universal Serial Bus devices / controllers

  • ST-LINK/V2 or ST-LINK/V2-1
  • STM32 BOOTLOADER (DFU mode)

Ports (COM & LPT)

  • STMicroelectronics Virtual COM Port
  • USB Serial Device (COMx) (for USB-UART adapter or USB CDC)

Other devices / Unknown device

  • If drivers are missing, you may see a yellow exclamation mark.

If unplugging and re-plugging makes an entry appear/disappear, the PC does detect something.

B. Use ST tools

If you’re using ST-LINK or DFU:

Open STM32CubeProgrammer.

  • For ST-LINK: choose ST-LINK, click Refresh.
    • If your device shows up with its device ID, the PC + ST tools see it.
  • For DFU: choose USB, click Refresh.
    • Look for something like USB1 - STM32 BOOTLOADER.

If CubeProgrammer can connect, the STM32 is definitely detected.

C. Common problems on Windows

  • Charge-only USB cable (no data) → no device appears.
  • Missing drivers:
    • Install ST-LINK drivers and, for DFU, the STM32 Bootloader driver (via CubeProgrammer installation).
  • Wrong USB port / bad hub → try direct on PC.

3. Linux: how to check if it’s detected
A. Use dmesg

  1. Open a terminal.
  2. Run:
dmesg -w
Enter fullscreen mode Exit fullscreen mode
  1. Plug in your STM32 board and watch the log.

You should see lines like:

For ST-LINK:

usb 1-1: New USB device found, idVendor=0483, idProduct=3748, ...
Enter fullscreen mode Exit fullscreen mode

For DFU:

idVendor=0483, idProduct=df11, Manufacturer=STMicroelectronics, Product=STM Device in DFU Mode
Enter fullscreen mode Exit fullscreen mode

For USB-serial:

cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
Enter fullscreen mode Exit fullscreen mode

If you see a new USB device after plugging in, the kernel sees it.

B. Use lsusb and ls /dev

List USB devices:

lsusb
Enter fullscreen mode Exit fullscreen mode

Look for lines like:

  • STMicroelectronics ST-LINK/V2
  • STMicroelectronics STM Device in DFU Mode

List serial ports:

ls /dev/ttyACM* /dev/ttyUSB* 2>/dev/null
Enter fullscreen mode Exit fullscreen mode

After plugging in:

/dev/ttyACM0 or /dev/ttyUSB0 appearing = detected serial device.

C. Use STM32CubeProgrammer

On Linux, run CubeProgrammer and:

  • For ST-LINK: choose ST-LINK → Refresh → Connect.
  • For DFU: choose USB → Refresh.

If it connects and shows device ID → all good.

4. macOS: how to check if it’s detected
A. Check serial device

  1. Plug in the board.
  2. In Terminal:
ls /dev/tty.usbmodem* /dev/tty.usbserial* 2>/dev/null
Enter fullscreen mode Exit fullscreen mode

New entry like /dev/tty.usbmodem14101 = detected USB CDC or ST-LINK VCP.

B. Check USB tree

system_profiler SPUSBDataType
Enter fullscreen mode Exit fullscreen mode

Look for:

  • ST-LINK/V2-1
  • STM Device in DFU Mode
  • USB Serial adapter name

C. Use STM32CubeProgrammer

Same idea: if CubeProgrammer sees and connects, your Mac detects the STM32.

5. Quick checklist if nothing shows up

If you don’t see any new device when you plug it in:

1. Check power & cable

  • Try another USB cable (many are power-only).
  • Different USB port or PC.

2. Board type and port

  • Nucleo/Discovery: use the ST-LINK USB connector (usually labeled ST-LINK).
  • Blue Pill/custom: if using native USB, you must have:
    • Correct USB-capable pins wired to connector.
    • Firmware that initializes USB (no firmware → no normal USB device, only DFU if supported by that chip).
  • If using ST-LINK dongle: you won’t see a COM port unless the ST-LINK provides one; you’ll see a debug device, not the STM32 itself.

3. Boot mode

  • If you put the STM32 into DFU bootloader (via BOOT0 etc.), expect to see STM32 BOOTLOADER (not your normal USB CDC app).
  • If BOOT0 is wrong or firmware is broken, USB CDC device may not enumerate at all.

4. Drivers (Windows especially)

  • Install STM32CubeProgrammer (it installs ST-LINK and DFU drivers).
  • Replug after install.

Top comments (0)