Skip to the content
PCBKitNew board
2 layers17.7 × 13.8 mmDebugger adapter, the printed circuit board in 3D

Aliexpress STLINKv2 debugger to standard connector adapters

Size
17.7 × 13.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
3
Nets
12
Pads
26
Tracks, vias
43, 3
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
16 Feb 2024
Updated
2 May 2026

Overview

Debugger adapter is an open-source printed circuit board by mdrobot7, from the mdrobot7/debugger-adapters repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 17.7 × 13.8 mm with 3 parts on 12 nets, routed with 43 tracks and 3 vias.

It is built around the CL-SB-13A-01T and SFH11-PBPC-D05-ST-BK. Its parts include 2 connectors and 1 switch. It belongs with the interfaces and adapters boards of this library.

Main components

2

README

README.md

debugger-adapters

Aliexpress STLINKv2 debugger to standard connector adapters

Hardware

All part links are built into the KiCad parts, just generate the BOM from within KiCad and order. Miscellaneous parts are below.

Assembly

The ribbon cable IDC connectors for the Cortex-Debug adapter are quite difficult to get exactly right. If the wire goes in at slightly the wrong angle, the conductors will bridge or connect to the wrong pins. After each connector is put on, check each pin with a multimeter to make sure it's not bridged to anything it shouldn't be.

Creating a Black Magic Probe

Black Magic Probe and Black Magic Debug are open-source SWD/JTAG debug projects for ARM Cortex microcontrollers. It gives you a bare GDB server and is platform-independent, so it will work on ARM Cortex microcontrollers regardless of brand or series.

To create a Black Magic Probe you need an existing debugger -- another Black Magic Probe, STLink (for ST-based debuggers), Atmel ICE (for Atmel chips), etc.

Resources

Supported Hardware

Wiring

Keep the SWD wires (between the BMP and the microcontroller) relatively short. SWD doesn't have a length spec, but under 30cm is a good rule of thumb. Slower baud rates will allow for longer lengths. It's recommended to extend the USB side instead of the SWD side.

Reprogramming the BMP

The Black Magic Probe project switched to Meson in current releases, which makes installation a little harder on Windows. On Windows, your best move is load up a Linux VM using VirtualBox or something similar. You can try to get MSYS2 to work, but no guarantees. Builds and uploads on Windows may need Zadig to manually assign Windows drivers to your BMP, you want to assign it to WinUSB.

Instructions for Linux/Mac:

  1. Install dependencies
    • Linux: sudo apt install meson ninja gcc-arm-none-eabi gdb-multiarch binutils-arm-none-eabi dfu-util libhidapi-dev libftdi1-dev libusb-1.0-0-dev
    • OSX: brew install meson ninja arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-gdb dfu-util hidapi libftdi libusb
  2. git clone https://codeberg.org/blackmagic-debug/blackmagic
  3. cd into the directory you cloned into
  4. Set up the build: meson setup build --reconfigure --cross-file cross-file/stlink.ini -Dtargets=cortexar,cortexm,sam,stm,nxp,ti -Dbmd_bootloader=true
    • Which targets you choose are up to you and your use case. The ones shown above are a general recommendation. See supported targets for others.
  5. Build the binary and bootloader: meson compile -C build; meson compile -C boot-bin
  6. Pull the metal shell off of your BMP-to-be by pulling it towards the USB port. Attach jumper wires to an existing BMP, and wire GND, VCC, SWDIO, and SWCLK to the pins/exposed pads on your BMP-to-be. You can wire it properly, or hold wires onto the pads until the next command is done.
  7. Flash the bootloader
    • With an existing BMP: arm-none-eabi-gdb -ex "tar ext [debugger device ID]" -ex "mon s" -ex "att 1" -ex "mon option erase" -ex "load" -batch build/blackmagic_stlink_bootloader.elf
      • Find the debugger device ID in /dev. Use /dev/whatever for the following commands.
      • This worked on some targets (Geehy micros), but not all. I've received knockoff STLinks from AliExpress that have flash protections set up such that it doesn't flash. If so, grab a stock STLink and try the steps below.
    • With an existing STLink (credit to this guide):
      • sudo apt install openocd stlink-tools
      • sudo vim /usr/share/openocd/scripts/target/stm32f1x.cfg and add set CPUTAPID 0 below line 35. This disables CPU ID checking (we're flashing a counterfeit).
      • Plug in your existing STLinkv2 and connect it to your BMP-to-be.
      • openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown" && st-flash erase && st-flash --flash=0x20000 --reset write build/blackmagic_stlink_bootloader.bin 0x8000000
  8. Plug your new BMP into your PC via USB, unplug your existing debugger.
  9. Check that your new BMP shows up: sudo dfu-util -l. It should say "found DFU" with some device information.
  10. Flash the BMP firmware: sudo dfu-util -s 0x08002000:leave:force -D build/blackmagic_stlink_firmware.bin

Upgrading Your BMP

All you need to do is git pull the updated BMP firmware (or make any changes you need to), and rebuild. Plug it in via USB and rerun step 11 above. The bootloader handles reflashing the firmware over USB.

Black Magic Probe releases official binaries as well, so you can also download the blackmagic-native BIN file from the Releases page and flash it over DFU. It covers a very similar set of debug targets and fits in the 128KB flash of our counterfeit STLinks.

Parts

3
QtyValueFootprintReferences
1~common-components:Slide_SP3TS1
1~common-components:0.05in_Ribbon_HeaderJ2
1~common-components:STLINK_HeaderJ1

Questions

How big is the Debugger adapter PCB?

It measures 17.7 × 13.8 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Debugger adapter use?

3 parts, built around the CL-SB-13A-01T and SFH11-PBPC-D05-ST-BK. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Debugger adapter KiCad files?

From the mdrobot7/debugger-adapters repository on GitHub, at the commit this page was made from: the board is cortex-debug/debugger-adapter.kicad_pcb and its schematic cortex-debug/debugger-adapter.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Debugger adapter design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers88.9 × 46.2 mmLed controller, the printed circuit board in 3D

    Led controller

    cruzsbrian/aurora

    An addressable LED controller with graphical interface, audio input, and patterns programmed on an SD card.

    84 parts3
  • 2 layersSKR CAN, the printed circuit board in 3D

    SKR CAN

    Polar-Ted/SKR_E3_V2_on_CANbus

    11 parts17
  • 4 layers80 × 93.6 mmTelemetry KiCAD Project, the printed circuit board in 3D

    Telemetry KiCAD Project

    MSTRocketDesignTeam/Avionics-Telemetry-PCB

    Rocket Telemetry PCB

    95 parts8GPL-3.0
  • 2 layers27.3 × 27.3 mmESPProg to altera, the printed circuit board in 3D

    ESPProg to altera

    wormyrocks/ESPProg-to-altera

    Adapter to turn an ESP-Prog into an inexpensive FPGA programmer for use with openFPGALoader.

    3 parts8
  • 2 layers86.6 × 71.8 mmVehicleControlUnit, the printed circuit board in 3D

    VehicleControlUnit

    lhr-solar/VCAT-VehicleControlUnit

    Vehicle Control Unit (VCU) for the 2026 Longhorn Racing Solar car

    142 parts2MIT
  • 2 layers82.3 × 79.4 mmPS ChargerInterfacePCB, the printed circuit board in 3D

    PS ChargerInterfacePCB

    lhr-solar/PS-ChargerInterfacePCB

    Interfaces the Elcon charger with the BPS/Battery over CAN

    140 parts1
  • 2 layers53.1 × 81.9 mmPTN PumpControlBoard, the printed circuit board in 3D

    PTN PumpControlBoard

    lhr-solar/PS-PumpController

    Controls speed of liquid cooling pump and fans for the main battery pack. Additionally, interprets data from temperature sensors and flowrate sensors for fan/pump control loop

    115 parts1