ST-LINK

Revision as of 11:36, 1 March 2019 by Registered User

Template:ArticleMainWriter

Template:ArticleProposedVersion


SUMMARY
This article describes the ST-LINK hardware probes.

1 Introduction[edit]

The ST-LINK[1] 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.

Depending on the version of the ST-LINK hardware and on the version of its embedded firmware, it can support different debug protocols:

  • SWIM: debug protocol for STM8 microcontrollers
  • SWD/JTAG: debug protocol for STM32 microcontrollers and microprocessors

and communication interfaces:

  • UART
  • I2C
  • SPI
  • CAN
  • GPIO

2 Hardware versions[edit]

Several versions of ST-LINK exists: ST-LINK/V1[1], ST-LINK/V2[2], ST-LINK/V2-A, ST-LINK/V2-B, ST-LINK/V2-1 and STLINK-V3SET[3].

For details about different versions , please refer to the technical note[4] of ST-LINK derivatives.

To check for the ST-LINK version which is embedded in ST boards, you have to refer to the Getting started with ST boards page, and then select your current HW board.

3 Getting started[edit]

3.1 Installing USB driver[edit]

Depending of the ST-LINK version, two USB drivers are associated: one for the debugger itself, and one for the serial communication port from (ST-LINK/V2-1).
Serial communication port is using standard CDC ACM USB Class, which is usually present by default on all PC operating system.

About USB driver for the debugger, this could differ depending of the PC operating system:

  • MS Windows®

A driver must be installed before connecting ST-LINK to a Windows® 7, Windows 8, or Windows® 10 PC via the USB.

The driver is automatically installed by the toolsets supporting ST-LINK. It is also available from the www.st.com website[5].

  • Linux®

Users must be granted with rights for accessing the ST-Link USB devices. It is then necessary to add rules into /etc/udev/rules.d.

All information and files for installing the udev rules are provided in the STSW-LINK007[6] package in st.com (see stsw-link007\AllPlatforms\StlinkRulesFilesForLinux\Readme.txt file).

  • Mac OS®

No specific install is required.

3.2 Connecting JTAG/SWD for debug[edit]

  • Embedded ST-LINK

JTAG/SWD link is available from the USB link provided by the ST-LINK. 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. Please see Hardware versions to check for the connection details.

- JTAG: please ensure these signals are connected to the JTAG/SWD connector: VCC, JTDI, JTMS, JCLK, JRCLK, JTDO, NRST and GDN
- SWD: please ensure these signals are connected to the JTAG/SWD connector (on some ST-LINK hardware version, a dedicated SWD port can be available also): VCC, SWCLK, SWDIO, NRST, SWO and GND.

3.3 Connecting UART port (from ST-LINK/V2-1)[edit]

  • Embedded ST-LINK

UART serial port is available from the USB link provided by the ST-LINK. 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. Please see Hardware versions to check for the connection details.

4 To go further[edit]

4.1 Updating embedded firmware[edit]

All information given in the STSW-LINK007[6] software package in st.com.

Warning white.png Warning
The firmware update application embeds the latest FW version, so do not hesitate to get latest version of the executable STSW-LINK007[6] software package

4.2 How to bypass embedded ST-LINK[edit]

For ST boards which embed a ST-LINK, it could be useful for user to bypass it, in order to use a newest version of ST-LINK standalone probe, or an other debug probe.

  • Deactivate the embedded ST-LINK

Please refer to the board description and schematic to get the way to put the embedded ST-LINK in reset mode if available.

  • Bypass the embedded ST-LINK signals and connect external hardware probe

Following the interface available on the new hardware probe, you have to connect the relevant signals. Please refer to Connecting JTAG/SWD for debug and Connecting UART port for standalone external ST-LINK.

5 References[edit]