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

Sample target

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
51.8 × 20 mm
Copper layers
4
Thickness
1.6 mm
Parts
57
Nets
79
Pads
240
Tracks, vias
458, 81
Pours
3
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
5 Jan 2025
Updated
16 Mar 2025

Overview

Sample target 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 4-layer board of 51.8 × 20 mm with 57 parts on 79 nets, routed with 458 tracks and 81 vias.

It is built around the RP2040, LM358QT and W25Q128JVSIQ, with the MIC5504-3.3YM5-TR, SN74AHC1G08DBVR and CL05B104KB54PNC among its other parts. Its parts include 20 capacitors, 12 resistors, 7 ICs, 3 diodes and 2 connectors. It belongs with the RP2040 boards of this library.

Main components

9

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

57
QtyValueFootprintReferences
140.1uFCapacitor_SMD:C_0402_1005MetricC3, C4, C7, C9, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20
9, , , , , , , ,
51kResistor_SMD:R_0402_1005MetricR3, R6, R7, R8, R12
41uFCapacitor_SMD:C_0402_1005MetricC1, C2, C8, C10
35.1kResistor_SMD:R_0402_1005MetricR1, R2, R11
3LEDLED_SMD:LED_0603_1608MetricD1, D2, D3
215pCapacitor_SMD:C_0402_1005MetricC5, C6
227Resistor_SMD:R_0402_1005MetricR4, R5
2SW_Pusheasyeda:SW-SMD_L3.9-W3.0-P4.45SW1, SW2
2TMUX1511PWRsnapeda:SOP65P640X120-14NU6, U7
110kResistor_SMD:R_0402_1005MetricR10
1240kResistor_SMD:R_0402_1005MetricR9
1ABM8-272-T3Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ2
1LM358_DFNPackage_DFN_QFN:DFN-8-1EP_2x2mm_P0.5mm_EP1.05x1.75mmU4
1MIC5504-3.3YM5Package_TO_SOT_SMD:SOT-23-5U1
1RP2040Package_DFN_QFN:QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mmU3
1SN74AHC1G08DBVRsnapeda:SOT95P280X145-5NU5
1USB_C_Receptaclealvarop:UT11113-11602-7HJ1
1W25Q128JVSPackage_SO:SOIC-8_5.23x5.23mm_P1.27mmU2

The 56 most common of 57 parts.

More from alvarop/swd2usbc

4
  • 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
  • 2 layers20.5 × 11 mmSwd2usbc programmer, the printed circuit board in 3D

    Swd2usbc programmer

    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!

    4 parts29CC0-1.0

Similar boards

  • 2 layers73 × 79 mmUWABA, the printed circuit board in 3D

    UWABA

    uSANMA/pcb-uwaba-prototype

    123 parts2Apache-2.0
  • 2 layers73.5 × 47.5 mmEinkBadge, the printed circuit board in 3D

    EinkBadge

    Las-Vejas/badge

    An E-ink badge run by RP2040, with NFC capabilities.

    67 partsGPL-3.0
  • 4 layers51 × 45 mmFlight controller atlas, the printed circuit board in 3D

    Flight controller atlas

    williamjroche/Drone_Flight_Controller

    This is a GPS-Denied Autonomous Drone that uses computer vision to fly with radio transmission override. Autonomy is a work in progress.

    66 parts1MIT
  • 2 layers34.1 × 45 mmSnes fpc, the printed circuit board in 3D

    Snes fpc

    fliperama86/superpico-digital

    SuperPico Digital is a digital-to-digital HDMI mod for 2-chip SNES consoles using the Raspberry Pi Pico 2 (RP2350)

    12 parts41
  • 2 layers85.8 × 94.2 mmFault Latch 2, the printed circuit board in 3D

    Fault Latch 2

    LSUTigerRacing/Electronics

    This repository contains all of the KiCad Schematics for the 2026 TigerRacing Formula SAE's Electronics Subsystem.

    123 parts8
  • 2 layers100.3 × 100.3 mmECE315, the printed circuit board in 3D

    ECE315

    mfrisch3/ece315_project

    LED button game

    67 parts
  • 4 layers82 × 55 mmSpark, the printed circuit board in 3D

    Spark

    ratmuds/spark

    The PCB files for this project. The gerber and other PCBA files are in the production folder.

    202 parts1

Questions

How big is the Sample target PCB?

It measures 51.8 × 20 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Sample target use?

57 parts, built around the RP2040, LM358QT, W25Q128JVSIQ and MIC5504-3.3YM5-TR. 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 Sample target KiCad files?

From the alvarop/swd2usbc repository on GitHub, at the commit this page was made from: the board is sample-target/sample-target.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 Sample target 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).