2 Mode 3: debug interface pinout detector
sys64738 edited this page 2021-08-17 22:21:44 +00:00

Mode 3 provides a tool to scan for JTAG and SWD pinouts on a board.

The implementation is lifted from JTAGenum and SWDscan, for which we are very grateful.

Pinout

Any pin marked as "test pin" below can be probed. Actual pins probed depends on the command used to scan, see dpctl.

Raspberry Pico

On the Raspberry Pico, 20 pins can be used:

Pin number Usage Usage Pin number
GP0 stdio UART TX VBUS
GP1 stdio UART RX VSYS
GND <ground> <ground> GND
GP2 Test pin 3V3 EN
GP3 Test pin 3V3 OUT
GP4 Test pin ADC VREF
GP5 Test pin GP28 / ADC2
GND <ground> <ground> GND / AGND
GP6 Test pin GP27 / ADC1
GP7 Test pin GP26 / ADC0
GP8 Test pin RUN
GP9 Test pin Test pin GP22
GND <ground> <ground> GND
GP10 Test pin Test pin GP21
GP11 Test pin Test pin GP20
GP12 Test pin Test pin GP19
GP13 Test pin Test pin GP18
GND <ground> <ground> GND
GP14 Test pin Test pin GP17
GP15 Test pin Test pin GP16
<end> <bottom> <bottom> <end>

Usage

This mode is controlled entirely through dpctl.

Time spent scanning is proportional to n_pins_probed nCr n_pins_in_itf, i.e. n_pins_probed!/(n_pins_probed-n_pins_in_itf)!. For JTAG, n_pins_in_itf is equal to 5, for SWD, it is 2. n_pins_probed depends on the start and end arguments passed to dmctl.