Using serial wire and releasing the unused debug pins as GPIOs
To use the serial wire DP to release some GPIOs, the user software must set
SWJ_CFG=010 just after reset. This release PA15, PB3 and PB4 which now become
available as GPIOs.
When debugging, the host performs the following actions:
● Under system RESET, all SWJ pins are assigned (JTAG-DP + SW-DP)
● Under system RESET, the debugger host sends the JTAG sequence to switch from the
JTAG-DP to the SW-DP.
● Still under system RESET, the debugger sets a breakpoint on vector reset
● The System Reset is released and the Core halts.
● All the debug communications from this point are done using the SW-DP. The other
JTAG pins can then be reassigned as GPIOs by the user software.