**** Advance Notice ****

This site will be closed on 31 December 2015,

Important Information for users of NXP LPCXpresso

This site is for users of Code Red branded products.

NXP LPCXpresso users should visit the LPCXpresso FAQ's for up-to-date information relevant to that product.

Redirected from page "CM3_SWD"

Clear message

SWD / JTAG Connectors and Pinout

JTAG was the traditional mechanism for debug connections for ARM7/9 parts, but with the Cortex-M family, ARM introduced the Serial Wire Debug (SWD) Interface. SWD is designed to reduce the pin count required for debug from the 5 used by JTAG (including GND) down to 3. In addition, one of the pins freed up by this can be used for Single Wire Viewing (SWV), which is a low cost tracing technology (which is used by the "Red Trace" functionality within Red Suite).

The SWD/SWV pins are overlaid on top of the JTAG pins as follows:


SWD Mode





Clock into the core

Use 10K-100K Ohm pull-down resistor to GND



JTAG Test Data Input

Use 10K-100K Ohm pull-up resistor to VCC



JTAG Test Data Output / SWV trace data output

Use 10K-100K Ohm pull-up resistor to VCC



JTAG Test Mode Select / SWD data in/out

Use 10K-100K Ohm pull-up resistor to VCC





Usually, MCUs do not include pull-up or pull-down resistors on JTAG/SWD pins. Resistors should be added externally onto the board as detailed above. You may use resistors between 10K and 100K for these signals. This will prevent the signals from floating when they are not connected to anything.

Note that Cortex-M0 does not support SWV trace.

Other signals to note

Connector Pinouts

ARM has defined three debug connector pinouts that are in common use with Code Red's tools, a "traditional" 20 pin connector, a Cortex 10 pin connector and a Cortex 20 pin Debug+ETM connector...

"Traditional" 20-pin 0.1" JTAG/SWD Connector Pinout


Cortex 10-pin 0.05" JTAG/SWD Connector Pinout


Suitable connector headers include :

The 10-pin Samtec FTSH-105-01 connector has the dimensions: 0.25" x 0.188" (6.35mm x 4.78mm).

Some boards use un-shrouded 10-pin headers. Always ensure that you connect your cable correctly, typically by matching the "1" marked on the board to the red -stripe on the cable.

The 10-pin cable is Samtec part number FFSD-05-D-12.00.01-N

Cortex 20-pin 0.05" JTAG/SWD/ETM Connector Pinout


This small 20-pin (0.05") connector provides access to SWD, SWV, JTAG, and ETM (4-bit) signals available on Cortex-M3/M4 devices.

The 20-pin header (Samtec FTSH-110-01) has the dimensions: 0.50" x 0.188" (12.70mm x 4.78mm).

Although Code Red's tools do not currently support the direct use of the ETM (Embedded Trace Macrocell), a number of boards use this form of connector as their main debug connector (for example Freescale Kinetis TWR boards, as well as Code Red's RDB4078 board).

A special Cortex 10-pin debug -> Cortex 20-pin debug+ETM connector cable will typically be required to debug such boards. Such a cable is supplied with the RDB4078.


10 to 20 pin adapter

Code Red's Red Probe+ is supplied fitted with a "Traditional" 20-way cable. Adapters to convert to a 10 pin header are available from various sources, including http://embeddedartists.com/products/acc/acc_jtag_adapter_kit.php.


Alternatively the Red Probe+ does have a 10-pin header inside the case onto which you can connect a suitable 10-way cable. If you do this, then it is recommended that you remove the original 20-way cable, and certainly do not connect both cables to boards at the same time!

Switching between JTAG and SWD modes of debug

Some Cortex-M based MCUs support both SWD and JTAG, others support only SWD (such as NXP LPC11xx and LPC13xx). Where both are supported, there are special sequences defined to switch from JTAG mode (default) to SWD mode (and vice versa) that can sent to the core. This switch sequence uses TMS (SWDIO), and this line is connected for any SWD/JTAG connection

Normally where both modes are supported, Red Suite will default to using SWD mode. However this can be modified by editing the launch configuration for a project.

Logic Levels and Ground

Red Probe+ attempts to adjust logic levels based on the voltage it sees on Vtref referenced to whatever GND it has to work with. The voltage at Vtref is coming from your hardware, thus you need a good GND, shared with your target hardware.

Red Probe+ (and LPC-Link) can be killed (like most USB devices) by excessive over current through ground of the probe and back through the PC used for debugging. The usual cause of this is that your target has it's own PSU and has a ground differential slightly different from your debug PC. Please do not rely on Red Probe+ / LPC-Link to ground your PC to the same potential as your target.


If you have designed your debug circuit according to the specification, you should also check that sufficient power is being supplied to your target. If you are using a USB port on your PC to power your target, make sure that your PC is able to supply the required power over USB - many PC USB ports do not meet USB power requirements.

HardwareDebugConnections (last edited 2013-10-22 13:38:23 by CrSupportAb)