Skip to main content
Associate
September 2, 2026
Solved

STM32 MCU Connection Issue with ST-LINK

  • September 2, 2026
  • 7 replies
  • 141 views

I am currently working with an STM32 MCU and facing an issue while trying to connect the board to my PC using an ST-LINK debugger. The board powers on normally and there does not appear to be any obvious hardware issue, but STM32CubeProgrammer is unable to detect the target device. The connection attempt either fails or reports that no target is found, so I am currently unable to program or debug the MCU.

So far, I have checked the basic connections and setup:

  • USB cable and ST-LINK connection
  • Board power supply and voltage
  • SWDIO and SWCLK connections
  • STM32CubeProgrammer installation
  • ST-LINK firmware and connection settings

I am not sure if the problem could be caused by the MCU configuration, SWD interface, boot mode, or some setting that may have been changed in the firmware. I would also like to know if there are any recommended STM32CubeProgrammer options or recovery procedures that should be tried when the target MCU is not detected.

Has anyone experienced a similar issue with an STM32 MCU and ST-LINK? I would appreciate any suggestions for the best troubleshooting steps to identify whether this is related to the debugger, SWD connection, board configuration, or the MCU itself.

Best answer by MM..1

Complete schematics is last resort, start with MCU + LINK parts and power...

7 replies

Associate II
September 3, 2026

is there any error log can be shared?

Associate
September 5, 2026

is there any error log can be shared?


Thanks for asking. I do have the error information from STM32CubeProgrammer, although I’m not sure which parts of the log are most useful for diagnosing an ST-LINK/SWD detection problem. The connection attempt basically ends with the target MCU not being detected, despite the board powering on and the SWD connections appearing correct.

I can share the relevant error log or the exact error message here. Would you recommend posting the complete CubeProgrammer log, or are there specific lines such as the ST-LINK connection result, SWD frequency, target voltage, or device detection message that would be most useful? Also, if the log indicates that ST-LINK itself is detected but the target is not, would that help narrow the problem down to the SWD connection or MCU configuration?

Associate II
September 3, 2026

Hi,

maybe it helps if you tell which ST-Link you use and how exactly it is connected to your MCU.

MM..1
Super User
September 6, 2026

Show your MCU schematics and get info about is some code in MCU or empty?
 

Associate
September 10, 2026

Show your MCU schematics and get info about is some code in MCU or empty?

Thanks, that’s a good point. I can share the relevant MCU schematic, especially the power, reset, SWD, and boot-related connections. The main difficulty is that I currently can’t connect to the MCU with STM32CubeProgrammer, so I’m not sure whether it contains the expected firmware or whether the SWD interface is being affected by the code already programmed.

Is there a specific way you recommend checking whether the MCU is empty or already programmed when ST-LINK cannot detect the target? Also, would you mainly want to see the MCU section of the schematic, or should I include the complete board schematic for checking the connections?
 

MM..1
MM..1Best answer
Super User
September 11, 2026

Complete schematics is last resort, start with MCU + LINK parts and power...