- Last edited 5 months ago ago
This article describes the ST-LINK hardware probes.
The ST-LINK is an in-circuit debugger and programmer for the STM8 and STM32 microcontroller families.
ST-LINK is a USB device and has to be connected to a PC host. It can be either embedded on ST boards or provided as standalone dongle.
ST-LINK can support different debug protocols depending on ST-LINK hardware version and on its embedded firmware version:
- SWIM: debug protocol for STM8 microcontrollers
- SWD/JTAG: debug protocol for STM32 microcontrollers and microprocessors
and communication interfaces:
2 Hardware versions
Several versions of ST-LINK exist: ST-LINK/V1, ST-LINK/V2, ST-LINK/V2-A, ST-LINK/V2-B, ST-LINK/V2-1 and STLINK-V3SET.
For details about the different versions, please refer to technical note of ST-LINK derivatives.
To find out the ST-LINK version that is embedded in your ST board, refer to the Category:STM32 MPU boards page, and then select your hardware board.
3 Getting started
3.1 Installing the USB driver
Two USB drivers are associated to ST-LINK, depending of ST-LINK version: one for the debugger itself, and one for the serial communication port from (ST-LINK/V2-1).
The serial communication port uses standard CDC ACM USB Class, which is usually present by default on all PC operating systems. The USB driver for the debugger can differ depending of the PC operating system:
- MS Windows®
A driver must be installed before connecting ST-LINK to a Windows® 7, Windows® 7 8, or Windows® 10 PC via the USB.
The driver is automatically installed by the toolsets supporting ST-LINK. It is also available from www.st.com .
Users must be granted with rights for accessing ST-Link USB devices. Rules must then be added into /etc/udev/rules.d.
All information and files for installing the udev rules are provided in the STSW-LINK007 package available from www.st.com (see stsw-link007\AllPlatforms\StlinkRulesFilesForLinux\Readme.txt file).
- Mac OS®
No specific installation is required.
3.2 Connecting JTAG/SWD for debugging
- Embedded ST-LINK
A JTAG/SWD link is available from the USB link provided by the ST-LINK. The USB device is mounted on the host PC and ready to be used.
- Standalone ST-LINK
Pins are available on the ST-LINK to connect the JTAG/SWD signals. Refer to Hardware versions for connection details.
- - JTAG: VCC, JTDI, JTMS, JCLK, JRCLK, JTDO, NRST and GDN signals must be connected to the JTAG/SWD connector.
- - SWD: VCC, SWCLK, SWDIO, NRST, SWO and GND signals must be connected to the JTAG/SWD connector (on some ST-LINK hardware version, a dedicated SWD port can also be available).
3.3 Connecting UART port (from ST-LINK/V2-1)
- Embedded ST-LINK
A UART serial port is available from the USB link provided by the ST-LINK. The USB device is mounted on the host PC and ready to be used.
- Standalone ST-LINK
Pins are available on the ST-LINK to connect the Rx/Tx and GND signals. Refer to Hardware versions for connection details.
4 To go further
4.1 Updating the embedded firmware
All information are given in the STSW-LINK007 software package available from www.st.com.
4.2 How to bypass the embedded ST-LINK
To use a newest version of ST-LINK standalone probe or another debug probe, ST-LINK can be bypassed for ST boards that already embed it.
- Deactivating the embedded ST-LINK
Please refer to the board description and schematic for how to put the embedded ST-LINK in reset mode if available.
- Bypassing the embedded ST-LINK signals and connecting an external hardware probe
Connect the relevant signals depending on the interface available on the new hardware probe. Please refer to Connecting JTAG/SWD for debug and Connecting UART port for standalone external ST-LINK.
- ↑ 1.01.1 https://www.st.com/en/development-tools/st-link.html
- ↑ https://www.st.com/en/development-tools/st-link-v2.html
- ↑ https://www.st.com/en/development-tools/stlink-v3set.html
- ↑ https://www.st.com/resource/en/technical_note/dm00290229.pdf
- ↑ https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-utilities/stsw-link009.html
- ↑ 6.06.16.2 https://my.st.com/content/my_st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link007.html