Skip to the content
2 layers20.5 × 11 mmSwd2usbc programmer, the printed circuit board in 3D

Swd2usbc programmer

alvarop/swd2usbc29

Have you ever wanted to debug your device over USB-C? Sometimes there's not enough room for a JTAG/SWD connector, or even Tag-Connect pads!

Size
20.5 × 11 mm
Copper layers
2
Thickness
1.6 mm
Parts
4
Nets
10
Pads
26
Tracks, vias
60, 6
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
5 Jan 2025
Updated
16 Mar 2025

Overview

Swd2usbc programmer is an open-source printed circuit board by alvarop, from the alvarop/swd2usbc repository on GitHub, published under the CC0-1.0 licence. It is a 2-layer board of 20.5 × 11 mm with 4 parts on 10 nets, routed with 60 tracks and 6 vias.

It is built around the 30306-6002HB and TYPE-C-31-G-06. It belongs with the interfaces and adapters boards of this library.

Main components

2

README

README.md

SWD2USBC Project

Have you ever wanted to debug your device over USB-C? Sometimes there's not enough room for a JTAG/SWD connector, or even Tag-Connect pads!

For history and all of the details, check out my detailed write up here.

SWD2USBC

SWD2USBC

Full featured adapter with Debug Accessory Mode support. Includes an ATTiny microcontroller to set the correct pull-up resistors on CC1/CC2 to provide accurate charge current to the target. Has a USB-C plug so no extra USB-C cable required

SWD2USBC Firmware

The ATTiny firmware doesn't do much. It reads the voltage on the CC1/CC2 line that is pulled up and determines the available charge current. It then pulls up CC1 and CC2 to provide the charge current to the device under Debug Accessory Mode.

SWD2USBC Basic

SWD2USBC Basic Simple adapter with no Debug Accessory Mode. Assumes target SWD lines wired up directly to TX1/2 as listed above. Requires USB3/Thunderbolt C to C cable to connect to target.

Sample Target

Sample Target

Example target device. Fully featured with CC1/2 comparators to connect/disconnect SWD lines if Debug Accessory Mode is active. Target is an RP2040 instead of STM32 since it's easier to source.

Sample Target Firmware

The sample target firmware does basic USB charge detection using the CC lines. When the Debug Accessory Mode is enabled, both CC1/CC2 are used, otherwise, the single CC line is used. There's an LED (D3) which lights up when Debug Accessory Mode is enabled.

The charge current is printed out over UART, but it is also displayed using the two LEDs. The blink patterns are:

  • 500mA - LED1 (D1) blinks
  • 1500mA - LED2 (D2) blinks
  • 3000mA - Both LED1 (D1) and LED2 (D2) blink at the same time
  • Other/Error - Both LED1 (D1) and LED2 (D2) alternating blink

Sample Target Basic

Sample Target Basic

Basic example target. Similar to the sample target above, but does not include any comparators/switches. SWD lines are directly connected to the USB-C connector.

SWD2USBC Programmer

Simple adapter PCB to connect the AVRISP V2 connector to USB-C to program the ATTiny in the SWD2USBC device.

SWD2USBC Programmer

Parts

4
QtyValueFootprintReferences
2TestPointTestPoint:TestPoint_Pad_D2.5mmTP1, TP2
1AVR-ISP-6Connector_IDC:IDC-Header_2x03_P2.54mm_VerticalJ1
1USB_C_Plugalvarop:TYPE-C-31-G-06P1

More from alvarop/swd2usbc

4
  • 4 layers51.8 × 20 mmSample target, the printed circuit board in 3D

    Sample target

    alvarop/swd2usbc

    Have you ever wanted to debug your device over USB-C? Sometimes there's not enough room for a JTAG/SWD connector, or even Tag-Connect pads!

    57 parts29CC0-1.0
  • 2 layers43 × 20 mmSample target basic, the printed circuit board in 3D

    Sample target basic

    alvarop/swd2usbc

    Have you ever wanted to debug your device over USB-C? Sometimes there's not enough room for a JTAG/SWD connector, or even Tag-Connect pads!

    46 parts29CC0-1.0
  • 4 layers25.8 × 16 mmSwd2usbc, the printed circuit board in 3D

    Swd2usbc

    alvarop/swd2usbc

    Have you ever wanted to debug your device over USB-C? Sometimes there's not enough room for a JTAG/SWD connector, or even Tag-Connect pads!

    17 parts29CC0-1.0
  • 4 layers27 × 13 mmSwd2usbc basic, the printed circuit board in 3D

    Swd2usbc basic

    alvarop/swd2usbc

    Have you ever wanted to debug your device over USB-C? Sometimes there's not enough room for a JTAG/SWD connector, or even Tag-Connect pads!

    6 parts29CC0-1.0

Similar boards

  • 2 layers20.5 × 11 mmSwd over c pogo, the printed circuit board in 3D

    Swd over c pogo

    alvarop/debugotron

    Debugotron is a collection of debugging/automation tools I've wanted in the past but didn't have access to. Currently, the tools include:

    6 parts52BSD-3-Clause
  • 2 layers20.5 × 11 mmSwd over c pogo, the printed circuit board in 3D

    Swd over c pogo

    kitspace-test-repos/kicad6-file-collection

    4 partsMIT
  • 2 layers18.5 × 26 mm24g2usb rp2350zero, the printed circuit board in 3D

    24g2usb rp2350zero

    joypad-ai/joypad-os

    Universal controller firmware for building adapters, dongles, and custom controllers.

    4 parts1.7kApache-2.0
  • 2 layers116 × 33 mm966595-1 and 963356-1, the printed circuit board in 3D

    966595-1 and 963356-1

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    4 parts1.2k
  • 2 layers19 × 18 mmDaughter board, the printed circuit board in 3D

    Daughter board

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    4 parts915
  • 2 layers24.8 × 24.8 mmNrf24 breakout, the printed circuit board in 3D

    Nrf24 breakout

    tardate/LittleArduinoProjects

    a collection of "Little Electronic & Arduino Projects", most involving electronics or an Arduino in one way or another!

    4 parts803MIT
  • 2 layers26 × 20 mmCap chain, the printed circuit board in 3D

    Cap chain

    drandyhaas/KiCadRoutingTools

    A set of Python/Rust tools to aid routing in KiCad

    4 parts744MIT
  • 2 layers34.7 × 20 mmXG Station Power MSI, the printed circuit board in 3D

    XG Station Power MSI

    osy/XG_Mobile_Station

    Open source eGPU dock for ROG Ally and ROG Flow

    4 parts712CC-BY-4.0

Questions

How big is the Swd2usbc programmer PCB?

It measures 20.5 × 11 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Swd2usbc programmer use?

4 parts, built around the 30306-6002HB and TYPE-C-31-G-06. 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 Swd2usbc programmer KiCad files?

From the alvarop/swd2usbc repository on GitHub, at the commit this page was made from: the board is swd2usbc-programmer/swd2usbc-programmer.kicad_pcb and its schematic sample-target-basic/sample-target-basic.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Swd2usbc programmer design in my own project?

Its repository publishes it under the CC0-1.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).