Summary
This article describes tips to prevent or fix errors encountered when connecting the STM32 target board to your computer such as: “No target connected”, “Target not found”, “No ST-LINK detected”, and “ST-LINK connection error”.
Software and debug checklist
We recommend using the STM32CubeProgrammer for programming STM32 microcontrollers, instead of STM32 ST-LINK Utility (STSW-LINK004).
- Make sure that you are using the latest software version of STM32CubeProgrammer.
- Ensure that the ST-LINK firmware is up to date. To upgrade the ST-LINK firmware to the latest version, you can use the STM32CubeProgrammer tool
- Follow the steps mentioned in the following article to connect to the STM32 board using STM32CubeProgrammer: How can I connect to my STM32 evaluation board using STM32CubeProgrammer?
- Check whether your computer recognizes ST-LINK: Go to the Device Manager and check that ST-LINK is listed as a USB device. If not, reinstall the ST-LINK USB device driver.
- Make sure that your debug pins (SWDIO, SWCLK) are free, reserved for debug. In case one of the debug pins have been set accidentally to any other signal than SWDIO and SWCLK, refer to this article to solve this: How to solve debugger connection issues
- Check the option bytes, as this can help prevent and debug issues related to incorrect configurations: What option bytes in STM32 are, and how to use them.
Hardware checklist
- Make sure that you use a genuine ST-LINK/V2. Refer to this article to check if you are using a genuine ST-LINK/V2 or a cloned one: How to recognize a genuine ST-LINK/V2 versus a cloned one.
- Verify all physical connections, such as: USB cables and connectors, and try using a different USB port or cable. Check the ST-LINK connection to ensure that the ST-LINK is properly connected to the STM32 target board.
- Make sure that the target board is powered. If the target board is not powered, this can lead to errors such as "No target connected".
- Check that all pins are properly connected and there is no conflict with other pins.
Consider the check of the basic pins and the following power supply schemes that are within their specified voltage ranges: VDD, VSS, VSSA, VDDA, VCAP, VDDIO1, VDDIO, VBAT, VREF+. For detailed information on the power supply requirements and pinout descriptions, you can refer to the datasheet related to the used device.
- Follow the recommended PCB routing guidelines in the paired application note for your MCU named: “Getting started with STM32xx MCU hardware development”.
- Check the jumpers on the board and make sure that they are set correctly. You can follow the recommendations described in the associated user manual, which contains all the jumpers and solder bridges with their functions.
- Additionally, use the articles linked below and follow the recommended steps and key areas to consider when reviewing your STM32 schematic design:
- If the board is not being detected, try selecting the "Connect under reset" mode and holding the reset button while attempting a "Full Chip Erase" to clear the flash memory.
- Alternatively, if the issue is not being resolved, try connecting to other STM32 MCU boards to confirm if the problem is related to the used board or not.
If this checklist does not help to solve your problem, we suggest that you create a new post in the STM32 MCUs Products forum for further assistance.