szymonh / SWDscan

Identify Serial Wire Debug (SWD) clock and io lines using your favorite Arduino.
GNU General Public License v3.0
47 stars 6 forks source link

SWDscan

This Arduino-based Platformio project allows quick identification of SWD ports.

How does it work?

The app iterates through microcontroller gpio pins following the definition specified using PIN_MASK to find SWD clock and io lines. Pins are enabled by setting corresponding bits of PIN_MASK, i.e. pins 2-8 are enabled for PIN_MASK of 0b111111100 or 0x1fc.

Besides PIN_MASK predefined at build time you can also set the pin mask at runtime using the m command. Entering 508 or 0x1fc will result in pin_mask set to 0b111111100 so you can update the configuration without the need to rebuild the project.

How to use it?

How to configure it?

What is test mode for?

Test mode allows to check if target SWD IO and CLK lines are connected to specified pins.

How does it look like?

Nothing found?

In case the target fails to switch to SWD mode:

No Platformio?

No problem, just copy the contents of src/main.cpp to a new Arduino project, remove the Arduino.h import from the first line and you're ready to go.

Need JTAG?

Check JTAGscan to identify JTAG TMS, TCK, TDO and TDI pins.