UM1075 User Manual: ST-LINK/V2 In-Circuit Debugger/programmer For STM8 and STM32
UM1075 User Manual: ST-LINK/V2 In-Circuit Debugger/programmer For STM8 and STM32
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 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 2500 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, IAR, Keil, and TASKING integrated development
environments.
ST-LINK/V2 ST-LINK/V2-ISOL
Contents
1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Product contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Hardware configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1 Connection with STM8 applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.1 Standard ERNI connection with SWIM flat ribbon . . . . . . . . . . . . . . . . . . 9
3.1.2 Low-cost SWIM connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.3 SWIM signals and connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Connection with STM32 applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 ST-LINK/V2 status LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4 Software configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1 ST-Link/V2 firmware upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 STM8 application development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3 STM32 application development and Flash programming . . . . . . . . . . . . 15
5 Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
List of tables
List of figures
1 Features
2 Product contents
Figures ST-LINK/V2 product contents show the various cables delivered within the product.
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)
D E
C
C E
D
A
B
3 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 C
A A
B B
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 connection of the
SWIM cable in the correct position on the target connector even pins, used for both SWIM
and JTAG cables.
A A
B B
Table 3 summarizes the signal names, functions, and target connection signals using the
separate-wires cable.
As the SWIM separate-wires 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.
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.
1
VAPP Target VCC MCU VDD(1) 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 IO JTMS SWDIO
8 GND GND GND(3) GND(3)
9 TCK_SWCLK JTAG TCK, SW CLK JTCK SWCLK
(3)
10 GND GND GND GND(3)
11 NC Not connected Not connected Not connected
(3)
12 GND GND GND GND(3)
13 TDO_SWO JTAG TDI, SWO JTDO TRACESWO(4)
14 GND GND GND(3) GND(3)
15 NRST NRST NRST NRST
(3) GND(3)
16 GND GND GND
17 NC Not connected Not connected Not connected
(3)
18 GND GND GND GND(3)
19 VDD VDD (3.3V)(5) Not connected Not connected
20 GND GND GND(3) GND(3)
1. 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.
2. Connect to GND for noise reduction on the ribbon.
3. At least one of this pin must be connected to the ground for correct behavior (connecting all of them is
recommended).
4. Optional: for Serial Wire Viewer (SWV) trace.
5. 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.
B A
B
C
C
19 17 15 13 11 9 7 5 3 1
20 18 16 14 12 10 8 6 4 2
Note: For low cost applications or when the standard 20 pins pitch 2.54mm 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 your PCB without requiring a mating
component on application PCB. For more details on this solution and application PCB
footprint information, please visit www.Tag-Connect.com.
The references of components compatible with JTAG and SWD interfaces are:
a) TC2050-ARM2010 adapter (20pins to 10pins interface board)
b) TC2050-IDC or TC2050-IDC-NL (No Legs) (10pins cable)
c) TC2050-CLIP retaining clip for use with TC2050-IDC-NL (optional)
4 Software configuration
The ST-LINK/V2 requires a dedicated USB driver. If the toolset installed it automatically, file
stlink_winusb.inf is installed in <WINDIR>/inf (where <WINDIR> is typically C:/Windows).
If the toolset setup did not install it automatically, the driver can be found on www.st.com:
1. Connect to www.st.com.
2. In the search tab, part number field, look for ST-Link/V2.
3. Click on the Generic Part Number column’s hyperlink to ST-Link/V2.
4. In the Design support tab, SW drivers section, click on the icon to download st-
link_v2_usbdriver.zip.
5. Unzip and run ST-Link_V2_USBdriver.exe.
For more information on third party tools, please visit:
● www.atollic.com
● www.iar.com
● www.keil.com
● www.tasking.com
5 Schematics
Target board
(horizontal mount)
ST-LINK/V2 board
Low cost
1 femal
2 connector
ERNI
PIN 1 - VDD
PIN 2 - DATA
USB
Target board
CN3
(vertical mount) PIN 3 - GND
1
PIN 4 - RESET
1
CN4
USB
1
2 PCB
3
4
ai18745V2
Application male
connector Low cost Low cost
02 20 227 2041 femal Cable lenght 100 mm femal
connector connector
02 201 3047 02 201 3047 ST-LINK/V2
PCB male
connector 02
20 227 2041
1
1
1
PIn 4 - RESET
1
CN4
CN3
USB
PCB
PCB
ai18746V2
6 Revision history
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.