How to enable SWD debugging on PyBoard V1.1 #16782
Unanswered
projectgus
asked this question in
STM32 / Pyboard
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(This is partially a note-to-self for future me, but I've seen other people struggle with this as well.)
It's possible to use SWD to low-level debug the C firmware of a PyBoard V1.1 (PYBV11) and probably V1.0 as well, but it requires some fiddling.
Connections
The SWD pins are P4 (SWCLK) and P5 (SWDIO) as shown on the PyBoard Schematic. Plugged in it looks like this:

The SWCLK pin is the white pin header above X20, and the SWDIO pin is the white pin header above X21.
In this photo the RST pin is not connected from the SWD debugger, but it's recommended to connect this as well.
Custom MicroPython Build
Unfortunately P4 (GPIO PA14) and P5 (GPIO PA15) are also LED1 and LED2. These are set by the mboot bootloader on each boot to indicate the boot status. This re-muxes the SWD pins and effectively disables SWD.
It's possible to apply a temporary patch like this to re-assign LED1 and LED2, then build and flash a custom firmware:
Note: I also find the "connect-under-reset" option is generally necessary for establishing an SWD connection with MicroPython stm32 port.
Beta Was this translation helpful? Give feedback.
All reactions