swd-openocd

glasgow run swd-openocd

Expose SWD via a socket using the OpenOCD remote bitbang protocol.

Note (2024-07-22): SWD remote bitbang support has not yet been a part of an OpenOCD release, and OpenOCD must be built from source to use this applet.

Usage with TCP sockets:

glasgow run swd-openocd tcp:localhost:2222
openocd -c 'adapter driver remote_bitbang; transport select swd' \
    -c 'remote_bitbang port 2222'

Usage with Unix domain sockets:

glasgow run swd-openocd unix:/tmp/swd.sock
openocd -c 'adapter driver remote_bitbang; transport select swd' \
    -c 'remote_bitbang host /tmp/swd.sock'
usage: glasgow run swd-openocd [-h] [-V SPEC] [--swclk PIN] [--swdio PIN]
                               [--srst PIN] [-f FREQ]
                               ENDPOINT
endpoint

listen at ENDPOINT, either unix:PATH or tcp:HOST:PORT

-h, --help

show this help message and exit

-V <spec>, --voltage <spec>

configure I/O port voltage to SPEC (e.g.: ‘3.3’, ‘A=5.0,B=3.3’, ‘A=SA’)

--swclk <pin>

bind the applet I/O line ‘swclk’ to PIN (default: A0)

--swdio <pin>

bind the applet I/O line ‘swdio’ to PIN (default: A1)

--srst <pin>

bind the applet I/O line ‘srst’ to PIN

-f <freq>, --frequency <freq>

set SWCLK frequency to FREQ kHz (default: 100)