STMicroelectronics UM1075 ST-LINK V2 In-Circuit Debugger Programmer User Manual
- June 4, 2024
- STMicroelectronics
Table of Contents
UM1075
User manual
ST-LINK/V2 in-circuit debugger/programmer
for STM8 and STM32
Introduction
The ST-LINK/V2 is an in-circuit debugger/programmer for the STM8 and STM32
microcontroller families. The single wire interface module (SWIM) and
JTAG/serial wire
debugging (SWD) interfaces, facilitate the communication with any STM8 or
STM32 microcontroller located on an application board. In addition to
providing the same functionalities as the ST-LINK/V2, the ST-LINK/V2-ISOL
features digital isolation between the PC and the target application board. It
also withstands voltages of up to 1000 VRMS. The USB full-speed interface
allows communication with a PC and:
- STM8 devices via ST Visual Develop (STVD) or ST Visual Program (STVP) software (which are available from STMicroelectronics).
- STM32 devices via Atollic®, and TASKING integrated development environments.™®, IAR, Keil
Features
-
5 V power supplied by a USB connector
-
USB 2.0 full speed compatible interface
-
USB standard A to Mini-B cable
-
SWIM specific features
– 1.65 V to 5.5 V application voltage supported on SWIM interface
– SWIM low-speed and high-speed modes supported
– SWIM programming-speed rate: 9.7 Kbytes/s in low speed and 12.8 Kbytes/s in high speed
– SWIM cable for connection to the application via an ERNI standard vertical (ref: 284697 or 214017) or horizontal (ref: 214012) connector
– SWIM cable for connection to the application via a pin header or a 2.54 mm pitch connector -
JTAG/serial wire debugging (SWD) specific features
– 1.65 V to 3.6 V application voltage supported on the JTAG/SWD interface and 5 V tolerant inputs
– JTAG cable for connection to a standard JTAG 20-pin pitch 2.54 mm connector
– Supports JTAG communication
– Supports serial wire debug (SWD) and serial wire viewer (SWV) communication -
Direct firmware update feature supported (DFU)
-
Status LED which blinks during communication with the PC
-
1000 VRMS high isolation voltage (ST-LINK/V2-ISOL only)
-
Operating temperature 0 to 50 °C
Ordering information
To order the ST-LINK/V2 refer to Table 1:
Table 1. List of the order codes
Order code | ST-LINK description |
---|---|
ST-LINK/V2 | In-circuit debugger/programmer |
ST-LINK/V2-ISOL | In-circuit debugger/programmer with digital isolation |
Product contents
The cables delivered within the product are showed in Figure 2: ST-LINK/V2 product contents and Figure 3: ST-LINK/V2-ISOL product contents. They include (from left to right in Figure 2 and Figure 3):
- USB standard A to Mini-B cable (A)
- ST-LINK/V2 debugging and programming (B)
- SWIM low-cost connector (C)
- SWIM flat ribbon with a standard ERNI connector at one end (D)
- JTAG or SWD and SWV flat ribbon with a 20-pin connector (E)
Hardware configuration
The ST-LINK/V2 is designed around the STM32F103C8 device, which incorporates
the high-performance ARM® Cortex®
-M3 core. It is available in a TQFP48 package.
As shown in Figure 4, the ST-LINK/V2 provides two connectors:
- an STM32 connector for the JTAG/SWD and SWV interface
- an STM8 connector for the SWIM interface
The ST-LINK/V2-ISOL provides one connector for the STM8 SWIM, STM32 JTAG/SWD and SWV interfaces.
- A = STM32 JTAG and SWD target connector
- B = STM8 SWIM target connector
- C = STM8 SWIM, STM32 JTAG and SWD target connector
- D = Communication activity LED
Connection with STM8 applications
For STM8 developments, the ST-LINK/V2 can be connected to the target board by
two different cables, depending on the connector available on the application
board.
These cables are:
- SWIM flat ribbon with a standard ERNI connector at one end
- SWIM cable with two 4-pin, 2.54 mm connector or SWIM separate-wires cable
Standard ERNI connection with SWIM flat ribbon
Figure 5 shows how to connect the ST-LINK/V2 if a standard ERNI 4-pin SWIM
connector is present on the application board.
- A = Target application board with ERNI connector
- B = Wire cable with ERNI connector at one end
- C = STM8 SWIM target connector
- See Figure 11: SWIM ST-LINK/V2 standard ERNI cable.
Figure 6 shows that pin 16 is missing on the ST-LINK/V2-ISOL target connector. This missing pin is used as a safety key on the cable connector, to guarantee the connection of the SWIM cable in the correct position on the target connector even pins, used for both SWIM and JTAG cables.
Low-cost SWIM connection
Figure 7 shows how to connect the ST-LINK/V2 if a 4-pin, 2.54 mm, low-cost
SWIM connector is present on the application board.
- A = Target application board with 4-pin, 2.54 mm, low-cost connector
- B = Wire cable with a 4-pin connector or separate-wires cable
- C = STM8 SWIM target connector
- See Figure 12: SWIM ST-LINK/V2 low-cost cable
SWIM signals and connections
Table 2 summarizes the signal names, functions, and target connection signals
using the wire cable with a 4-pin connector.
Table 2. SWIM flat ribbon connections for ST-LINK/V2
Pin no. | Name | Function | Target connection |
---|---|---|---|
1 | VDD | Target VCC-1 | MCU VCC |
2 | DATA | SWIM | MCU SWIM pin |
3 | GND | GROUND | GND |
4 | RESET | RESET | MCU RESET pin |
Table 3 summarizes the signal names, functions, and target connection signals
using the separate-wires cable.
As the SWIM separate-wire cable has independent connectors for all pins on one
side, it is possible to connect the ST-LINK/V2-ISOL to an application board
without a standard SWIM connector. On this flat ribbon, all signals are
referenced by a specific color and a label to ease the connection on target.
Table 3. SWIM low-cost cable connections for ST-LINK/V2-ISOL
Color | Cable pin name | Function | Target connection |
---|---|---|---|
Red | TVCC | Target VCC-1 | MCU VCC |
Green | UART-RX | Unused | Reserved(2) (not connected on the target board) |
Blue | UART-TX | ||
Yellow | BOOT0 | ||
Orange | SWIM | SWIM | MCU SWIM pin |
Black | GND | GROUND | GND |
White | SWIM-RST | RESET | MCU RESET pin |
- The power supply from the application board is connected to the ST-LINK/V2 debugging and programming board to ensure signal compatibility between both boards.
- BOOT0, UART-TX, and UART-RX are reserved for future developments.
TVCC, SWIM, GND, and SWIM-RST can be connected to a low-cost 2.54 mm pitch connector or to pin headers available on the target board.
Connection with STM32 applications
For STM32 developments, the ST-LINK/V2 needs to be connected to the
application using the standard 20-pin JTAG flat ribbon provided.
Table 4 summarizes the signals names, functions, and target connection signals
of the standard 20-pin JTAG flat ribbon.
Table 4. JTAG/SWD cable connections
Pin no.| ST-LINKN2 connector (CN3)| ST-LINKN2 function| Target connection
(JTAG)| Target connection (SWD)
---|---|---|---|---
1| VAPP| Target VCC| MCU VDU’)| MCU VDD(1)
2
3| TRST| JTAG TRST| JNTRST| GND(2)
4| GND| GND| GND(3)| GND(3)
5| TDI| JTAG TDO| JTDI| GND(2)
6| GND| GND| GND(3)| GND(3)
7| TMS SWDIO| JTAG TMS, SW 10| JTMS| SWDIO
8| GND| GND| GND(3)| GND(3)
9| TCK SWCLK| JTAG TCK, SW CLK| JTCK| SWCLK
10| GND| GND| GND(3)| GND(3)
11| NC| Not connected| Not connected| Not connected
12| GND| GND| GND(3)| GND(3)
13| TDO SWO| JTAG TDI, SWO| JTDO| TRACESW0(4)
14| GND| GND| GND(3)| GND(3)
15| NRST| NRST| NRST| NRST
16| GND| GND| GND(3)| GND(3)
17| NC| Not connected| Not connected| Not connected
18| GND| GND| GND(3)| GND(3)
19| VDD| VDD (3.3V)t5)| Not connected| Not connected
20| GND| GND| GND(3)| GND(3)
- The power supply from the application board is connected to the ST-LINK/V2 debugging and programming board to ensure signal compatibility between both boards.
- Connect to GND for noise reduction on the ribbon.
- At least one of this pin must be connected to the ground for correct behavior (connecting all of them is recommended).
- Optional: for Serial Wire Viewer (SWV) trace.
- Available on ST-LINK/V2 only and not connected on ST-LINK/V2/OPTO.
Figure 9 shows how to connect the ST-LINK/V2 to a target using the JTAG cable.
- A = Target application board with JTAG connector
- B = JTAG/SWD 20-wire flat cable
- C= STM32 JTAG and SWD target connector
The reference of the connector needed on the target application board is: 2x10C header wrapping 2x40C H3/9.5 (pitch 2.54) – HED20 SCOTT PHSD80.
Note:
For low-cost applications or when the standard 20-pins-2.54mm-pitch-connector
footprint is too big, it is possible to implement the Tag-Connect solution to
save cost and space on the application board. The Tag-Connect adapter and
cable provide a simple reliable means of connecting ST-LINK/V2 or ST-
LINK/V2-ISOL to the PCB without requiring a mating
Hardware configuration
component on application PCB. For more details on this solution and
application-PCB-footprint information, visit www.tag-connect.com. The references of components compatible with JTAG and SWD
interfaces are:
a) TC2050-ARM2010 adapter (20-pin- to 10-pin-interface board)
b) TC2050-IDC or TC2050-IDC-NL (No Legs) (10-pin cable)
c) TC2050-CLIP retaining clip for use with TC2050-IDC-NL (optional)
4.3 ST-LINK/V2 status LEDs
The LED labeled ‘COM’ on top of the ST-LINK/V2 shows the ST-LINK/V2 status
(whatever When the:
- LED is blinking RED: the first USB enumeration with the PC is taking place.
- LED is RED: communication between the PC and ST-LINK/V2 is established (end of enumeration).
- LED is blinking GREEN/RED: data are being exchanged between the target and the PC.
- LED is GREEN: the last communication has been successful.
- LED is ORANGE: ST-LINK/V2 communication with the target has failed.
Software configuration
5.1 ST-LINK/V2 firmware upgrade
The ST-LINK/V2 embeds a firmware upgrade mechanism for an in-situ upgrade
through the USB port. As the firmware might evolve during the whole life of
the ST-LINK/V2 product (new functionality, bug fixes, support for new
microcontroller families …), it is recommended to visit
www.st.com/stlinkv2 periodically in order to
stay up-to-date with the latest firmware version.
5.2 STM8 application development
Refer to ST toolset Pack24 with Patch 1 or more recent, which includes ST
Visual Develop (STVD) and ST Visual Programmer (STVP).
5.3 STM32 application development and Flash programming
Third-party toolchains, Atollic® TrueSTUDIO, IAR™ EWARM, Keil® MDK-ARM™, and
TASKING VX-toolset support ST-LINK/V2 according to the versions given in Table
5 or in the most recent version available.
Table 5. How third-party toolchains support ST-LINK/V2
Third-party | Toolchain | Version |
---|---|---|
Atollic® | TrueSTUDIO | 2.1 |
IAR™ | SWARM | 6.20 |
Keil® | MDK-ARM™ | 4.20 |
TASKING | VX-toolset for ARM® Cortex® -M | 4.0.1 |
The ST-LINK/V2 requires a dedicated USB driver. If the toolset is installed it
automatically, the file stlink_winusb.inf is installed in
- Connect to www.st.com.
- In the search tab, part number field, look for ST-LINK/V2.
- Click on the Generic Part Number column hyperlink to ST-LINK/V2.
- In the Design support tab, SW drivers section, click on the icon to download st-link_v2_usbdriver.zip.
- Unzip and run ST-Link_V2_USBdriver.exe.
Schematics
1. Legend for pin descriptions:
VDD = Target voltage sense
DATA = SWIM DATA line between target and debug tool
GND = Ground voltage
RESET = Target system reset
1. Legend for pin descriptions:
VDD = Target voltage sense
DATA = SWIM DATA line between target and debug tool
GND = Ground voltage
RESET = Target system reset
References
- ST-LINK/V2 - ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 - STMicroelectronics
- Tag-Connect | Tag-Connect
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>