Have you ever wanted to debug your microcontroller over USB-C?

(I’m talking JTAG/SWD, not just USB!) If you already have a USB-C connector, there’s no need to have an additional connector to program!

This started as a twitter thread years ago, but I've cleaned it up, and added tons of new information. Let me know what you think!

alvarop.com/2025/03/swd-to-usb

@alvaro One more spec-compliant option that may be worth mentioning that doesn't require an on-board plug as DAM does is PD Alternate Mode - at least in case you already do PD on the target, otherwise it may be overkill 😁

I made an STM32G0-based board to trigger custom alt-modes with power and USB passthrough some time ago; instead of JTAG it breaks UART out, but the principle is the same: gitlab.com/dos1/debubo

@dos nice! Thanks for sharing :D

Would that work if the target is unresponsive though? Or would a separate PD controller handle that?

Follow

@alvaro Yeah, that depends on the device's design. The one that prompted me to make this board uses TPS65982 which handles muxing autonomously, so that would work; but with something like FUSB302 - not really.

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml