In this guide, you’ll find the ST-LINK V2 pinout diagram (the genuine ST probe’s 20-pin JTAG/SWD and SWIM connectors, and the ST-LINK V2 clone USB dongle’s 10-pin header), its datasheet and schematic information, and every interface explained with its wiring and extra tips. Without further ado, let’s get right into it!
The ST-LINK/V2 is STMicroelectronics’ in-circuit debugger and programmer for STM32 (JTAG, SWD and SWV trace) and STM8 (SWIM) microcontrollers. It plugs into your PC over USB, and inside there’s an STM32F103 running ST’s firmware. Next to it on every bench sits the cheap aluminium “ST-LINK V2” USB stick, a clone with a different pinout and some traps of its own.
ST-LINK/V2 Pinout Diagram
Here is a detailed ST-LINK/V2 Pinout Diagram with colored labels and legends to help you easily identify the functionalities that each pin can perform. It shows the genuine debugger’s CN3 20-pin JTAG/SWD connector and the 4-pin STM8 SWIM connector, drawn the same way as on the debugger.
Each row shows the ST-LINK signal name (as printed in UM1075), its SWD and JTAG role, and the pin it goes to on a typical STM32 target. On CN3, pin 1 sits on the row with the key notch, and the odd pins (1, 3, 5 … 19) run along that row, while the even pins (2 … 20) are the outer row. The ribbon cable is straight-through, so pin n on the probe is pin n on your target’s 20-pin header.
ST-LINK V2 Clone Pinout Diagram (10-Pin USB Dongle)
And here is the ST-LINK V2 clone pinout diagram for the aluminium USB-stick dongle. It shows the 10-pin header, the connector face view of both printed label variants sold today, and a genuine vs clone summary.
Clone photo: Phil Pemberton (philpem.me.uk), licensed under CC BY-NC-SA 4.0.
On the clone, pin 1 is under the small ▲ on the box header, and the odd pins are the row under the printed label. The labels differ between batches, so always wire from the print on your dongle (more on that in the clone section below).
Buy an ST-LINK/V2: You can get the genuine ST probe from Amazon or AliExpress, or the low-cost clone dongle from Amazon or AliExpress. The genuine probe gives you JTAG, SWO trace and target voltage sensing; the clone is fine for basic SWD flashing and debugging.
Download ST-LINK/V2 Pinout Diagrams (Full Resolution)
Both ST-LINK/V2 pinout diagrams (the genuine probe’s CN3 + SWIM connectors, and the clone dongle’s 10-pin header) in full resolution (5120 px WebP), in one ZIP file. Print them, zoom in, or keep them next to your bench. Please consider supporting my work if it helped you.
ST-LINK/V2 Datasheet
ST doesn’t publish a classic “datasheet” for the ST-LINK/V2. Its specifications live in the DB1275 data brief, and the pinout, cables and LED states are in the UM1075 user manual. Here are the official documents you’ll need, all from st.com:
| Document | ID | Revision | What You’ll Use It For | Link |
|---|---|---|---|---|
| ST-LINK/V2 data brief (the “datasheet”) | DB1275 | Rev 6 (Nov 2020) | Features, interfaces, voltage ranges, order codes | |
| ST-LINK/V2 user manual | UM1075 | Rev 10 (Apr 2024) | CN3 and SWIM pinouts (Tables 2 and 4), cables, LED states, driver | |
| Overview of ST-LINK derivatives | TN1235 | Rev 7 (Jan 2025) | V2 vs V2-1 vs V2-A/B vs V3, firmware update and USB modes | |
| SWD multidrop for STM32 with ST-LINK | AN6382 | Rev 1 (Nov 2025) | Debugging several STM32s on one SWD bus |
Which document do I need? UM1075 for the pinout and wiring (everything in this article’s tables comes from it), DB1275 for the specs, and TN1235 when you’re comparing ST-LINK versions or updating firmware. All four are listed on ST’s ST-LINK/V2 product page, where the ST-LINK/V2 is still marked ACTIVE (checked November 2026). There are no ST documents for the clone dongles.
ST-LINK/V2 Schematic
ST doesn’t publish a schematic for the ST-LINK/V2 probe. The “Schematics” section of UM1075 (section 6) only shows the two SWIM cables (the ERNI cable and the low-cost 4-pin cable), and Figures 9 and 10 show how the 20-pin JTAG/SWD ribbon connects to the target. Here’s what UM1075 does tell you about the hardware:
- Target interface: the 20-pin CN3 connector is the standard ARM JTAG 20-pin layout (2.54mm pitch). SWD uses pins 7 (SWDIO) and 9 (SWCLK), with pin 13 as SWO, and pin 15 is NRST.
- Voltage sensing: pins 1 and 2 (VAPP) are connected to your board’s supply “to ensure signal compatibility”. The probe senses this voltage; it doesn’t supply it.
- Output level: the probe talks to targets below 3.3v, but it drives its outputs at 3.3v. STM32 targets tolerate this. For sensitive parts on the target board, ST points to the ST-LINK/V2-ISOL, STLINK-V3MINIE, or STLINK-V3SET with the B-STLINK-VOLT adapter.
- SWIM cables: the ERNI cable (target connector 284697 or 214017 vertical, 214012 horizontal) and the low-cost cable with a 2.54mm 4-pin female connector.
If you want to see a real ST-LINK circuit, the closest official one is the ST-LINK/V2-1 that ST puts on its Nucleo boards. It’s drawn on a page of every Nucleo-64 schematic pack, for example in the NUCLEO-F446RE CAD resources (and walked through in our Nucleo-F446RE pinout guide). It’s the same STM32F103 idea plus a virtual COM port, but it’s not the ST-LINK/V2 probe itself. The schematics you’ll find online for the USB clone dongles are community-traced, and they differ between PCB versions.
ST-LINK/V2 Specs
The ST-LINK/V2 is a stand-alone USB probe in a white plastic case. Here are its specifications from DB1275 and UM1075, including the details that matter when you wire it to a board.

Get an ST-LINK/V2: The genuine ST probe is the one I recommend for real debugging; grab it from Amazon or AliExpress. On a tight budget, the clone dongle from Amazon or AliExpress does SWD flashing.
| Item | ST-LINK/V2 (Genuine) |
|---|---|
| Order codes | ST-LINK/V2, ST-LINK/V2-ISOL (isolated version) |
| Probe MCU | STM32F103C8 (Arm Cortex-M3), running ST’s ST-LINK firmware |
| Host interface | USB 2.0 Full-Speed, Mini-B connector, 5v bus powered (USB-A to Mini-B cable included) |
| STM32 interfaces | JTAG up to 9MHz (default 1.125MHz), SWD up to 4MHz (default 1.8MHz), SWV trace up to 2MHz |
| STM8 interface | SWIM low-speed and high-speed: 9.7KB/s and 12.8KB/s programming rates |
| Target voltage | JTAG/SWD: 1.65v to 3.6v with 5v-tolerant inputs; SWIM: 1.65v to 5.5v |
| Output levels | Driven at 3.3v, even for lower-voltage targets (UM1075) |
| Powers the target | No: VAPP (pins 1, 2) only senses the target voltage |
| Connectors | CN3: 2×10, 2.54mm box header (ARM JTAG 20-pin); SWIM: 4-pin |
| Cables included | 20-pin JTAG/SWD flat ribbon, SWIM ERNI cable, SWIM low-cost 4-pin cable |
| Status LED | COM LED, red/green (orange on a failed target connection) |
| Firmware update | Yes, over USB (DFU): STSW-LINK007 or STM32CubeProgrammer |
| Operating temperature | 0°C to 50°C |
| No | Virtual COM port, USB mass storage (drag-and-drop), target power output |
ST-LINK/V2 Specifications Summary
- The ST-LINK/V2 debugs and programs STM32 over JTAG or SWD and STM8 over SWIM.
- SWD runs at up to 4MHz (1.8MHz by default) and JTAG at up to 9MHz (1.125MHz by default).
- The minimal SWD wiring is pin 1 (VAPP), pin 7 (SWDIO), pin 9 (SWCLK) and a GND pin, plus pin 15 (NRST) for connect under reset.
- SWO trace (printf over SWV) is on pin 13, up to 2MHz, for Cortex-M3/M4/M7/M33 targets.
- The genuine ST-LINK/V2 does not power the target: VAPP is a sense input, and pin 19 (3.3v) is not connected on the target side.
- It works with 1.65v to 3.6v STM32 targets (5v-tolerant inputs), and its outputs are driven at 3.3v.
- The STM8 SWIM connector is separate: 1 VDD, 2 DATA, 3 GND, 4 RESET, for 1.65v to 5.5v targets.
- It connects over USB 2.0 Full-Speed (Mini-B) and has no virtual COM port.
- The clone dongle has a 10-pin header with SWDIO, SWCLK, SWIM, RST, 2x GND, 2x 3.3v and 2x 5v, and no SWO and no JTAG.
- On most clones, RST is the STM8 SWIM reset, not an STM32 NRST.
ST-LINK/V2 Quick Wiring Guide
Not sure which ST-LINK/V2 pins to connect? Here are the connections I’d use for each job, and why.
| Use Case | ST-LINK/V2 Pins | Why |
|---|---|---|
| Flash and debug any STM32 (minimum) | CN3-1 VAPP, CN3-7 SWDIO, CN3-9 SWCLK, CN3-20 GND | SWD needs 2 signals; VAPP tells the probe the target voltage |
| Connect under reset | Add CN3-15 NRST | Needed when your code reuses PA13/PA14 or sleeps |
| printf over SWO | Add CN3-13 TDO_SWO → PB3 | Serial Wire Viewer trace on Cortex-M3/M4/M7/M33 |
| Full JTAG | CN3-3, 5, 7, 9, 13, 15 + VAPP + GND | Boundary scan or JTAG-only tools |
| STM8 programming | SWIM connector: 1 VDD, 2 DATA, 3 GND, 4 RESET | SWIM is on its own 4-pin connector |
| Clone dongle on a Blue Pill / Black Pill | SWDIO, SWCLK, GND (+ 3.3V only if the board has no other supply) | The clone can power a small board; the genuine probe can’t |
ST-LINK/V2 Pins to Use With Caution
| Pin | Reason | What to Do |
|---|---|---|
| CN3-19 VDD (3.3v) | The probe’s own 3.3v; UM1075 leaves it unconnected on the target | Never use it to power your board |
| CN3-1, CN3-2 VAPP | Sense input, not a supply output | Connect to the target’s VDD; power the target separately |
| CN3-3 TRST, CN3-5 TDI | JTAG-only; UM1075 ties them to GND in SWD mode for noise | Leave them unconnected or grounded on an SWD-only board |
| CN3-13 TDO_SWO | SWO exists only on Cortex-M3/M4/M7/M33 targets | Leave it unconnected on Cortex-M0/M0+ parts (F0, G0, L0, C0) |
| CN3-15 NRST | Without it, connect under reset and hardware reset fail | Wire it whenever your firmware remaps PA13/PA14 or uses low-power modes |
| Clone RST | Usually the STM8 SWIM reset, not an STM32 NRST | Use a software reset, or hold the target’s reset button while connecting |
| Clone 3.3V, 5.0V | Outputs from the dongle (LDO and USB VBUS) | Never connect them to a board that has its own supply |
ST-LINK/V2 Pins Functions
The 20 pins of the ST-LINK/V2 CN3 connector and its 4-pin SWIM connector are divided into the following groups based on the interface they’re used for. Some pins do two jobs: pin 7 is JTAG TMS and SWD SWDIO, pin 9 is TCK and SWCLK, and pin 13 is TDO and SWO.
- 5x JTAG Pins: TRST, TDI, TMS, TCK, TDO
- 2x SWD Pins: SWDIO, SWCLK
- 1x SWV/SWO Trace Pin
- 1x SWIM Pin (STM8, on its own 4-pin connector)
- 1x NRST Reset Pin (+ RESET on the SWIM connector)
- Power & Target Voltage Pins: 2x VAPP, 1x VDD, 9x GND
- 2x Not Connected: pins 11 and 17
We’ll discuss each pin group in the following sections one by one in more detail.
ST-LINK/V2 JTAG Pins
The ST-LINK/V2 JTAG interface uses 5 signals on CN3: TRST (pin 3), TDI (pin 5), TMS (pin 7), TCK (pin 9) and TDO (pin 13), plus NRST on pin 15. It runs at up to 9MHz (1.125MHz by default).
| CN3 Pin | CN3 Name | ST-LINK Function | Target JTAG Pin | Typical STM32 Pin |
|---|---|---|---|---|
| 3 | TRST | JTAG TRST (out) | NJTRST | PB4 |
| 5 | TDI | JTAG TDO (probe out) | JTDI | PA15 |
| 7 | TMS_SWDIO | JTAG TMS | JTMS | PA13 |
| 9 | TCK_SWCLK | JTAG TCK | JTCK | PA14 |
| 13 | TDO_SWO | JTAG TDI (probe in) | JTDO | PB3 |
| 15 | NRST | NRST | NRST | NRST |
Note: The CN3 names are the target’s view, while UM1075’s function column is the probe’s view. So pin 5 is named “TDI” because it goes to the target’s TDI, but it carries the probe’s TDO output. Don’t cross TDI and TDO: wire CN3-5 to JTDI and CN3-13 to JTDO.
The “typical STM32 pin” column holds for most STM32 families with JTAG (F1, F2, F3, F4, F7, L1, L4, G4, H7 …). Cortex-M0/M0+ families (F0, G0, L0, C0) are SWD-only, so use the SWD pins below. Most people never need JTAG on an STM32: SWD does everything with 2 wires and frees PA15, PB3 and PB4.
ST-LINK/V2 SWD Pins
The ST-LINK/V2 SWD (serial wire debug) pins are CN3-7 (SWDIO) and CN3-9 (SWCLK), which go to PA13 and PA14 on the STM32. SWD runs at up to 4MHz (1.8MHz by default), and it’s what STM32CubeIDE and STM32CubeProgrammer use by default.
ST-LINK/V2 Minimal SWD Wiring: pin 1 (VAPP) → target VDD, pin 7 (SWDIO) → PA13, pin 9 (SWCLK) → PA14, any even pin (GND) → GND, and pin 15 (NRST) → NRST for connect under reset.
| CN3 Pin | Signal | Connect To (STM32) | Needed? |
|---|---|---|---|
| 1 (or 2) | VAPP | Target VDD (3.3v) | Yes: the probe reads the target voltage here |
| 7 | SWDIO | PA13 (SWDIO) | Yes |
| 9 | SWCLK | PA14 (SWCLK) | Yes |
| 20 (any even pin 4–20) | GND | GND | Yes (UM1075 recommends all of them on the ribbon) |
| 15 | NRST | NRST | Recommended (connect under reset) |
| 13 | SWO | PB3 (TRACESWO) | Optional (printf trace) |
Keep the SWD wires short (under about 20cm with jumper wires). If the connection drops, lower the SWD frequency in your IDE’s debug settings; that fixes most flaky jumper-wire setups.
Tip: On your own PCB, put the 6 SWD signals (VDD, SWDIO, SWCLK, NRST, SWO, GND) on a small header in the same order as your favourite cable, or fit the full 2×10 2.54mm header so the ST-LINK/V2 ribbon plugs straight in.
Learn more in our STM32 SWD Debugging Tutorial.
Also Read
ST-LINK/V2 SWV / SWO Pin
The ST-LINK/V2 SWO trace input is CN3-13 (TDO_SWO), wired to PB3 (TRACESWO) on the STM32. It carries the Serial Wire Viewer (SWV) trace at up to 2MHz, which lets you printf() to the IDE without a UART.
SWO works on Cortex-M3, M4, M7 and M33 targets, which have the ITM trace unit. Cortex-M0/M0+ parts (STM32F0, G0, L0, C0) have no SWO, and the clone dongles don’t bring the pin out at all. Here’s the short C code that sends printf() to SWO on an STM32 (CubeIDE project, HAL):
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include <stdio.h> /* Redirect printf() to the ITM stimulus port 0 (SWO on PB3) */ int _write(int file, char *ptr, int len) { for (int i = 0; i < len; i++) { ITM_SendChar(*ptr++); } return len; } /* In main(), inside the while(1) loop: */ printf("Counter = %lu\r\n", counter++); HAL_Delay(500); |
In STM32CubeIDE, set SYS → Debug to “Trace Asynchronous Sw” in CubeMX, then open the debug configuration, enable Serial Wire Viewer (SWV) and set the core clock to your real SystemCoreClock. Start debugging, open the SWV ITM Data Console, enable port 0, and press “Start Trace”. The text shows up there.
Note: If the SWV console stays empty, the core clock in the debug configuration doesn’t match the MCU’s real clock (the SWO baud rate is derived from it), or PB3 is used for something else in your code.
ST-LINK/V2 SWIM Pins (STM8)
The ST-LINK/V2 programs STM8 microcontrollers over SWIM (single wire interface module), on its own 4-pin connector next to CN3: 1 VDD, 2 DATA, 3 GND, 4 RESET. SWIM supports 1.65v to 5.5v targets.
| SWIM Pin | Name | Function | Connect To (STM8) |
|---|---|---|---|
| 1 | VDD | Target VCC (input, voltage reference) | MCU VDD |
| 2 | DATA | SWIM | SWIM pin (PD1 on STM8S, PA0 on STM8L) |
| 3 | GND | Ground | GND |
| 4 | RESET | Reset | NRST |
With the “STM8” label above the connector, as in ST’s photo, pin 1 is the right-hand pin (the bottom pin in our rotated diagram, nearer the COM LED). The connector has a latch wall at the pin 4 end. Use the ERNI cable for boards with an ERNI connector, or the low-cost 4-pin cable for a 2.54mm header.
Like VAPP on CN3, SWIM pin 1 is an input: the ST-LINK/V2 reads the STM8’s supply voltage there, it doesn’t power the STM8. Program STM8 parts with ST Visual Programmer (STVP-STM8), ST Visual Develop, or a third-party IDE.
ST-LINK/V2 NRST Reset Pin
The ST-LINK/V2 reset output is CN3-15 (NRST), wired to the STM32’s NRST pin. The SWIM connector has its own reset, pin 4 (RESET), for STM8 targets.
NRST is what makes “Connect under reset” work: the probe holds the MCU in reset, connects to the debug port, and only then lets your code run. That’s your way back in when the firmware has locked SWD out, for example:
- Your code configures PA13/PA14 as GPIO (or another alternate function), so SWD stops working right after reset.
- The MCU goes into Stop, Standby or Shutdown mode, and the debug port turns off with it.
- The firmware disables the debug pins with HAL_GPIO_DeInit() or by turning off the SWJ port.
Note: No NRST wire (for example on a clone dongle)? Hold the target’s reset button, set the mode to “Under reset” in STM32CubeProgrammer, click Connect, and release the button right after. If that fails too, set BOOT0 = 1 and reset, so the MCU starts the system bootloader instead of your code, then erase the flash.
Learn more in our STM32 Boot Modes Tutorial.
Also Read
ST-LINK/V2 Power & Target Voltage Pins
The genuine ST-LINK/V2 does not power your target board. It runs from your PC’s USB 5v, and its VAPP pins (CN3-1 and CN3-2) are inputs that sense the target voltage (1.65v to 3.6v). Pin 19 (VDD, 3.3v) is the probe’s own supply, and UM1075 leaves it unconnected on the target side.
| CN3 Pin | Name | Direction | What It Does |
|---|---|---|---|
| 1, 2 | VAPP | Input | Target VDD sense: the probe matches its signal levels and reports the target voltage |
| 19 | VDD | (output inside the probe) | The probe’s 3.3v; not connected to the target |
| 4, 6, 8, 10, 12, 14, 16, 18, 20 | GND | – | Ground; connect at least one, ideally all (UM1075) |
| 11, 17 | NC | – | Not connected (pin 11 is RTCK on the ARM standard) |
That’s why the most common first error with a genuine probe is “Target voltage 0v” or “No STM32 target found”: VAPP isn’t wired to the target’s 3.3v, or the target simply has no power. Power your board from its own supply or USB, wire VAPP to its VDD, and the probe reads the right voltage.
Note: The ST-LINK/V2 drives its outputs at 3.3v even when the target runs at 1.8v (UM1075). STM32 parts tolerate it, but if other chips on your 1.8v board don’t, use the ST-LINK/V2-ISOL, an STLINK-V3MINIE, or an STLINK-V3SET with the B-STLINK-VOLT adapter.
ST-LINK V2 Clone Pinout (10-Pin USB Dongle)
The ST-LINK V2 clone is the aluminium USB-stick dongle with a 10-pin box header: RST, SWDIO, SWCLK, SWIM, 2x GND, 2x 3.3V and 2x 5.0V. It does SWD for STM32 and SWIM for STM8, but it has no JTAG and no SWO pin. Inside is an STM32F101C8/F103C8 (or a copy such as CKS32, APM32 or GD32) running a copy of ST’s firmware.
There are two label variants on sale. Both put pin 1 under the ▲ on the box header, but the signals sit on different pins, so read the label printed on your own dongle before you wire it:
| Pin | Variant B (gold/red/blue/silver shells with the ST logo) | Variant A (e.g. blue “STLNK V2” shells) |
|---|---|---|
| 1 | RST | RST |
| 2 | SWDIO | SWCLK |
| 3 | GND | SWIM |
| 4 | GND | SWDIO |
| 5 | SWIM | GND |
| 6 | SWCLK | GND |
| 7 | 3.3V | 3.3V |
| 8 | 3.3V | 3.3V |
| 9 | 5.0V | 5.0V |
| 10 | 5.0V | 5.0V |
How to read your clone’s label: the print on the shell shows a small 1–10 pin map with a signal name on each side: the names on the left are the odd pins (1, 3 … 9), and the names on the right are the even pins (2 … 10). If your print doesn’t match either variant above, trust your print. And if in doubt, check continuity: the 3.3V pins read about 3.3v and the 5.0V pins about 5v to GND with the dongle plugged in.
ST-LINK V2 Clone RST Pin Is the SWIM Reset
On most ST-LINK V2 clone dongles, RST is the STM8 SWIM reset, not an STM32 NRST. So wiring RST to your STM32’s NRST usually does nothing, and “Connect under reset” and hardware reset fail (users report it on the ST Community and in ST’s own clone article). Use a software reset, or hold the target’s reset button while connecting, as in the NRST section above.
ST-LINK V2 Clone 3.3v and 5v Pins Power the Target
Unlike the genuine probe, the clone’s 3.3V pins are outputs from the dongle’s small LDO (shared with its own MCU), and the 5.0V pins are the USB VBUS, unregulated. That’s handy for a bare Blue Pill or Black Pill, but there’s no target voltage sensing: STM32CubeProgrammer and OpenOCD show the dongle’s own ~3.2–3.3v, even when your board is off (ST Community thread).
Note: Never connect the clone’s 3.3V or 5.0V pins to a board that has its own supply (USB, a regulator, a battery). The two supplies fight each other and back-feed, and users report dead clones and boards after doing it. Connect GND, SWDIO and SWCLK only, and leave the power pins unconnected.
ST-LINK V2 Clone SWO and Firmware Updates
No SWO: the clone’s header has no SWO pin, so printf() over SWV doesn’t work out of the box. Community hacks add it with a bodge wire from the dongle MCU’s trace-capable pin (PA10 on many units; it varies with the PCB) to a header pin (EEVblog forum). If you need trace, a genuine probe or a Nucleo board’s ST-LINK is the easier path.
Firmware updates: ST’s firmware upgrade tool (in STM32CubeProgrammer and STM32CubeIDE) can refuse or brick clones, especially the ones built on non-ST MCUs. After updates from STM32CubeIDE 1.10.1 onwards, users reported clones that stopped detecting targets (ST Community). ST says it doesn’t support clones. If yours gets bricked, it can be reflashed over the 4 SWD pads inside the shell with a second probe (stlink-org issue). My advice: if your clone works, don’t update it.
ST-LINK/V2 Wiring Examples
Here are the two hookups most readers need: the ST-LINK V2 clone with a Blue Pill or Black Pill, and the genuine ST-LINK/V2 with your own custom board.
ST-LINK V2 Clone to Blue Pill / Black Pill
Both boards have a 4-pin SWD header at the end: 3.3v, DIO (PA13), CLK (PA14), GND (the clock label reads DCLK or CLK on Blue Pills, and SCK on the Black Pill). With a variant B clone:
| Clone Pin (Variant B) | Blue Pill / Black Pill SWD Header | Note |
|---|---|---|
| 2 SWDIO | DIO (PA13) | |
| 6 SWCLK | CLK / SCK (PA14) | |
| 3 or 4 GND | GND | |
| 7 or 8 3.3V | 3.3 / 3V3 | Only if the board has no USB or other supply connected |
Then select “ST-LINK” and “SWD” in your IDE (STM32CubeIDE, Arduino IDE with STM32duino, PlatformIO) and flash. If your Blue Pill or Black Pill is also plugged into USB, leave the 3.3V wire off. Our Black Pill F401CE pinout guide has the full SWD header and boot-pin details, and the STM32 Blue Pill Arduino IDE guide walks through the first upload.
Genuine ST-LINK/V2 to a Custom STM32 Board
On your own board, fit a 2×10 2.54mm box header with the ARM JTAG 20-pin layout and the ST-LINK/V2 ribbon plugs straight in. For an SWD-only design, wire only these header pins and leave the rest unconnected or grounded as UM1075 shows:
| 20-Pin Header Pin | Board Net | Note |
|---|---|---|
| 1 (and 2) | VDD (3.3v) | Sense input for the probe; your board supplies it |
| 7 | PA13 (SWDIO) | |
| 9 | PA14 (SWCLK) | |
| 13 | PB3 (SWO) | Optional, for SWV printf |
| 15 | NRST | Recommended, for connect under reset |
| 3, 5 | GND | UM1075’s SWD target wiring (noise reduction) |
| 4–20 even | GND | All of them |
| 19 | – | Leave unconnected |
Power the board from its own supply first, then plug in the ST-LINK/V2. STM32CubeProgrammer should then show the target voltage read on VAPP (about 3.3v) and connect.
ST-LINK/V2 On-Board Features
The genuine ST-LINK/V2 has two connectors, a USB port and one status LED. The COM LED tells you what the probe is doing (UM1075 section 4.3):
| COM LED | Meaning |
|---|---|
| Blinking red | First USB enumeration with the PC in progress |
| Red | Communication between the PC and the ST-LINK/V2 established |
| Blinking green / red | Data exchanged between the target and the PC |
| Green | The last communication was successful |
| Orange | Communication with the target failed |
| Part | What It Is |
|---|---|
| CN3 (STM32) | 2×10 2.54mm box header with a key notch, for the 20-pin JTAG/SWD ribbon |
| SWIM (STM8) | 4-pin connector for the SWIM cables |
| USB | Mini-B, USB 2.0 Full-Speed, powers the probe |
| COM LED | Red/green status LED (table above) |
| Buttons | None |
The clone dongles have no COM LED on the outside on most units (some have one inside the shell), so you only know a connection works when the software says so.
Getting Started With ST-LINK/V2
Getting the ST-LINK/V2 running takes three things: the USB driver, up-to-date probe firmware, and a tool that talks to it. Here’s the order I’d do it in:
- Install the driver: on Windows, install STSW-LINK009 (STM32CubeIDE and STM32CubeProgrammer install it for you). Linux and macOS need no driver.
- Update the firmware (genuine probe): use the “Firmware upgrade” button in STM32CubeProgrammer, or the stand-alone STSW-LINK007 upgrade tool. TN1235 notes that the ST-LINK/V2 starts in update (DFU) mode and the tools switch it to debug mode, so unplug and replug it before the next upgrade.
- Wire the target with the minimal SWD hookup above, and power the target.
- Connect: in STM32CubeProgrammer pick “ST-LINK”, port “SWD”, and click Connect. It reads the target voltage, the chip ID and the flash. In STM32CubeIDE, the debug configuration uses the ST-LINK GDB server by default.
- Other tools: OpenOCD ( -f interface/stlink.cfg), the open-source stlink tools ( st-flash, st-info --probe), Keil MDK, IAR EWARM, PlatformIO and the Arduino STM32 core all support the ST-LINK/V2.
For the full debugging workflow (breakpoints, live variables, the SWV trace), follow our STM32 SWD Debugging with ST-LINK/V2 tutorial.
ST-LINK/V2 Common Problems & Fixes
Why does my genuine ST-LINK/V2 say “Target voltage 0v” or “No STM32 target found”? VAPP (pin 1) isn’t connected to the target’s VDD, or the target has no power. The genuine probe never powers the target. Power the board and wire VAPP (ST Community).
Can I power my board from pin 19 of the ST-LINK/V2? No. Pin 19 is the probe’s own 3.3v, and UM1075 marks it “not connected” on the target side. Power the target from its own supply.
Why does my clone show 3.2v target voltage when my board is off? The clone measures its own 3.3v rail, not your board. Its reading tells you nothing about the target.
Why doesn’t RST on my clone reset my STM32? On most clones RST is the STM8 SWIM reset. Use a software reset, or hold the target’s reset button while connecting.
Which pin is SWDIO? My clone doesn’t match the picture. Clone labels vary between batches (variants A and B above). Wire from the print on your own dongle.
Why can’t I connect anymore after flashing my code? Your code probably reuses PA13/PA14 or enters a low-power mode. Use “Connect under reset” with NRST wired, or boot with BOOT0 = 1 and erase the flash.
Why did my clone stop working after a firmware update? ST’s upgrade tool doesn’t support clones and can brick them. Reflash it over its internal SWD pads with a second probe, or replace it.
Why does the connection keep dropping with jumper wires? Long or loose wires, or the pull-ups some clones put on SWDIO/SWCLK. Shorten the wires, add a solid GND, and lower the SWD frequency.
Why is the COM LED orange? The probe couldn’t talk to the target: check the wiring, the target power, VAPP, and whether the firmware has locked out the debug pins.
Genuine ST-LINK/V2 vs Clone
The genuine ST-LINK/V2 and the USB clone both flash STM32 chips over SWD, but they’re different hardware with different pinouts. Here’s how they compare:
| Feature | Genuine ST-LINK/V2 | Clone USB Dongle |
|---|---|---|
| Shape | White plastic case, USB Mini-B port | USB-stick, aluminium shell, USB-A plug |
| Debug connector | 20-pin ARM JTAG (CN3) + 4-pin SWIM | 10-pin header, labels vary |
| JTAG | Yes | No |
| SWO / SWV trace | Yes (pin 13) | No pin |
| STM32 NRST | Yes (pin 15) | Usually not (RST = SWIM reset) |
| Target voltage | Sensed on VAPP, 1.65v–3.6v | Not sensed, fixed 3.3v logic |
| Powers the target | No | 3.3v and 5v pins |
| Firmware updates | Supported by ST | May fail, be refused or brick |
| ST support | Yes | None (the ST logo on a clone is fake) |
How to spot a genuine ST-LINK/V2: ST’s probe comes only in the white plastic case with a Mini-B USB port, the 20-pin and SWIM connectors, and the cables in the box. Any USB-stick or metal-shell “ST-LINK V2” is a clone, whatever logo is printed on it. Buy the genuine probe from ST or an authorized distributor. ST’s genuine vs cloned ST-LINK/V2 article has more detail.
ST-LINK/V2 vs ST-LINK/V2-1 vs STLINK-V3
ST has made several ST-LINK versions since the ST-LINK/V2. The ST-LINK/V2-1 is the one built into Nucleo and many Discovery boards, and the STLINK-V3 family is the current stand-alone probe (TN1235).
| Feature | ST-LINK/V2 | ST-LINK/V2-1 (on Nucleo/Discovery) | STLINK-V3 (V3SET, V3MINIE) |
|---|---|---|---|
| Form | Stand-alone probe | Built into the board | Stand-alone probe |
| Debug connector | 20-pin JTAG + 4-pin SWIM | 6-pin SWD header (CN4 on Nucleo-64) | STDC14 (1.27mm) + adapters |
| Interfaces | JTAG, SWD, SWV, SWIM | SWD, SWV | JTAG, SWD, SWV (+ SWIM on V3SET) |
| Virtual COM port | No | Yes | Yes |
| USB mass storage (drag-and-drop) | No | Yes | Yes (off by default on V3MINIE) |
| Max SWD clock | 4MHz | 4MHz | 24MHz |
| USB | Full-Speed, Mini-B | Full-Speed | High-Speed |
Pick the ST-LINK/V2 when you need JTAG or STM8 SWIM on a budget, or already own one. A Nucleo board’s ST-LINK/V2-1 can debug an external STM32 too: remove the two CN2 jumpers and wire its CN4 SWD header (1 VDD_TARGET, 2 SWCLK, 3 GND, 4 SWDIO, 5 NRST, 6 SWO). For a new probe, the STLINK-V3 is faster and adds a virtual COM port; our STLINK-V3 pinout guide covers its STDC14 connector and adapter headers.
ST-LINK/V2 Pin Details
Here is every ST-LINK/V2 connector pin in physical order, with its function on the probe, its target connection in JTAG and SWD modes, and a short description. On CN3, pin 1 is on the key-notch row and the odd pins run along that row.
ST-LINK/V2 CN3 20-Pin JTAG/SWD Connector
Click to expand the full pin table (20 pins)
| Pin | CN3 Name | ST-LINK Function | Target (JTAG) | Target (SWD) | Typical STM32 Pin | Description |
|---|---|---|---|---|---|---|
| 1 | VAPP | Target VCC (input) | MCU VDD | MCU VDD | VDD | Senses the target voltage so the probe matches its signal levels; it doesn’t power the target. |
| 2 | VAPP | Target VCC (input) | MCU VDD | MCU VDD | VDD | Same net as pin 1. |
| 3 | TRST | JTAG TRST | NJTRST | GND (noise) | PB4 | JTAG test reset; tied to GND on the target cable in SWD mode. |
| 4 | GND | GND | GND | GND | – | Ground. |
| 5 | TDI | JTAG TDO (probe out) | JTDI | GND (noise) | PA15 | Named after the target’s TDI; carries the probe’s TDO output. |
| 6 | GND | GND | GND | GND | – | Ground. |
| 7 | TMS_SWDIO | JTAG TMS, SW IO | JTMS | SWDIO | PA13 | SWD data line (JTAG TMS in JTAG mode). |
| 8 | GND | GND | GND | GND | – | Ground. |
| 9 | TCK_SWCLK | JTAG TCK, SW CLK | JTCK | SWCLK | PA14 | SWD clock (JTAG TCK in JTAG mode). |
| 10 | GND | GND | GND | GND | – | Ground. |
| 11 | NC | Not connected | NC | NC | – | Not connected (RTCK on the ARM 20-pin standard). |
| 12 | GND | GND | GND | GND | – | Ground. |
| 13 | TDO_SWO | JTAG TDI (probe in), SWO | JTDO | TRACESWO (optional) | PB3 | JTAG TDO from the target, or the SWO trace for SWV printf. |
| 14 | GND | GND | GND | GND | – | Ground. |
| 15 | NRST | NRST | NRST | NRST | NRST | Target reset; needed for connect under reset. |
| 16 | GND | GND | GND | GND | – | Ground. |
| 17 | NC | Not connected | NC | NC | – | Not connected. |
| 18 | GND | GND | GND | GND | – | Ground. |
| 19 | VDD | VDD (3.3v) | Not connected | Not connected | – | The probe’s own 3.3v; leave it unconnected on the target. |
| 20 | GND | GND | GND | GND | – | Ground. |
ST-LINK/V2 SWIM 4-Pin Connector (STM8)
| Pin | Name | Function | Target | Description |
|---|---|---|---|---|
| 1 | VDD | Target VCC (input) | MCU VDD | Voltage reference input (1.65v to 5.5v); pin 1 is the right-hand pin with the STM8 label up. |
| 2 | DATA | SWIM | SWIM pin | Single-wire debug/programming line (PD1 on STM8S, PA0 on STM8L). |
| 3 | GND | Ground | GND | Ground. |
| 4 | RESET | Reset | NRST | STM8 reset; at the latch end of the connector. |
ST-LINK V2 Clone 10-Pin Header
Click to expand the full pin table (10 pins)
| Pin | Variant B Label | Variant A Label | Description (Variant B) |
|---|---|---|---|
| 1 | RST | RST | STM8 SWIM reset on most clones (not an STM32 NRST). |
| 2 | SWDIO | SWCLK | SWD data, to PA13 on the STM32. |
| 3 | GND | SWIM | Ground. |
| 4 | GND | SWDIO | Ground. |
| 5 | SWIM | GND | STM8 SWIM data. |
| 6 | SWCLK | GND | SWD clock, to PA14 on the STM32. |
| 7 | 3.3V | 3.3V | 3.3v output from the dongle’s LDO (shared with its MCU). |
| 8 | 3.3V | 3.3V | 3.3v output. |
| 9 | 5.0V | 5.0V | 5v output straight from USB VBUS. |
| 10 | 5.0V | 5.0V | 5v output. |
Wrap Up
To conclude this guide article, the ST-LINK/V2 is a very solid debugger and programmer for STM32 and STM8. It gives you JTAG, SWD, SWO trace, and SWIM in one probe. The clone dongle covers basic SWD flashing for a few dollars. Just remember the gotchas: VAPP only senses the target voltage, pin 19 isn’t for the target, the clone’s RST is a SWIM reset, and its 3.3v/5v pins must never meet another supply.
I hope you’ve found this guide helpful to wire your ST-LINK/V2 to your next project. For more boards, check out the Pinouts, Datasheets & Schematic Diagrams Library. Follow this STM32 Series of Tutorials to learn more about programming STM32 microcontrollers.
If you’re just getting started with STM32, you need to check out the STM32 Getting Started Ultimate Guide below.
The complete beginner’s guide to STM32 microcontrollers: the toolchain, your first project, and the STM32 tutorials series step by step.


