13.2.6.3 Serial Wire/JTAG Debug Port (SWJ-DP)
The Cortex-M4 embeds a SWJ-DP Debug port which is the standard CoreSight debug port. It combines Serial Wire Debug Port (SW-DP), from 2 to 3 pins and JTAG Debug Port (JTAG-DP), 5 pins.
By default, the SW-DP is active. If the host debugger wants to switch to the JTAG-DP, it must provide a dedicated JTAG sequence on TMS/SWDIO and TCK/SWCLK. This disables SW-DP and enables JTAG-DP.
When SW-DP is active, TDO/TRACESWO can be used for trace. The asynchronous TRACE output (TRACESWO) is multiplexed with TDO and thus the asynchronous trace can only be used with SW-DP.
SW-DP or JTAG-DP mode is selected when JTAGSEL is low. It is not possible to switch directly between SWJ-DP and JTAG boundary scan operations. A chip reset must be performed after JTAGSEL is changed.
| Pin Name | JTAG Port | Serial Wire Debug Port |
|---|---|---|
| TMS/SWDIO | TMS | SWDIO |
| TCK/SWCLK | TCK | SWCLK |
| TDI | TDI | – |
| TDO/TRACESWO | TDO | TRACESWO (optional: trace) |
