Functional Description
189
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
JTAG Interface
4. Perform steps 1 and 2 of the SWD-to-JTAG switch sequence on
.
5. Perform steps 1 and 2 of the JTAG-to-SWD switch sequence.
6. Perform steps 1 and 2 of the SWD-to-JTAG switch sequence.
7. Perform steps 1 and 2 of the JTAG-to-SWD switch sequence.
8. Perform steps 1 and 2 of the SWD-to-JTAG switch sequence.
9. Perform steps 1 and 2 of the JTAG-to-SWD switch sequence.
10. Perform steps 1 and 2 of the SWD-to-JTAG switch sequence.
11. Perform steps 1 and 2 of the JTAG-to-SWD switch sequence.
12. Perform steps 1 and 2 of the SWD-to-JTAG switch sequence.
13. Release the RST signal.
14. Wait 400 ms.
15. Power-cycle the microcontroller.
3.3.4.4
Arm Serial Wire Debug (SWD)
In order to seamlessly integrate the Arm Serial Wire Debug (SWD) functionality, a serial-wire debugger
must be able to connect to the Cortex-M4F core without having to perform, or have any knowledge of,
JTAG cycles. This integration is accomplished with a SWD preamble that is issued before the SWD
session begins.
The switching preamble used to enable the SWD interface of the SWJ-DP module starts with the TAP
controller in the Test-Logic-Reset state. From here, the preamble sequences the TAP controller through
the following states: Run Test Idle, Select DR, Select IR, Test Logic Reset, Test Logic Reset, Run Test
Idle, Run Test Idle, Select DR, Select IR, Test Logic Reset, Test Logic Reset, Run Test Idle, Run Test
Idle, Select DR, Select IR, and Test Logic Reset states.
Stepping through this sequence of the TAP state machine enables the SWD interface and disables the
JTAG interface. For more information on this operation and the SWD interface, see the Arm Debug
Interface V5 Architecture Specification.
Because this sequence is a valid series of JTAG operations that could be issued, the Arm JTAG TAP
controller is not fully compliant to the IEEE Standard 1149.1. This instance is the only one where the Arm
JTAG TAP controller does not meet full compliance with the specification. Due to the low probability of this
sequence occurring during normal operation of the TAP controller, it should not affect normal performance
of the JTAG interface.
3.3.4.4.1 JTAG-to-SWD Switching
To switch the operating mode of the Debug Access Port (DAP) from JTAG to SWD mode, the external
debug hardware must send the switching preamble to the microcontroller. The 16-bit TMS/SWDIO
command for switching to SWD mode is defined as b1110.0111.1001.1110, transmitted LSB first. This
command can also be represented as 0xE79E when transmitted LSB first. The complete switch sequence
should consist of the following transactions on the TCK / SWCLK and TMS / SWDIO signals:
1. Send at least 50 TCK / SWCLK cycles with TMS / SWDIO High to ensure that both JTAG and SWD
are in their reset states.
2. Send the 16-bit JTAG-to-SWD switch command, 0xE79E, on TMS/SWDIO.
3. Send at least 50 TCK / SWCLK cycles with TMS / SWDIO High to ensure that if SWJ-DP was already
in SWD mode before sending the switch sequence, the SWD goes into the line reset state.
To verify that the DAP has switched to the Serial Wire Debug (SWD) operating mode, perform a SWD
READID operation. The ID value can be compared against the device's known ID to verify the switch.