The standard JTAG connector for ARM processors is the huge 20 pin IDC header. It has a whole bunch of unused pins and takes up a lot of board space. There are a several alternatives that reduce the pin count but, for a bare minimum, you can use Serial Wire Debug (SWD)…
It is often stated that SWD needs only two wires to connect to the processor but that overlooks the need for a common ground. Actual implementations are also likely to want a power connection to drive level converters or to tell the programming/debug hardware that the device is present and powered up. Then there is the reset line. While not strictly needed, your debug hardware and software may need to be able to reset the processor to overcome issues caused by reassigning the SWD pins in your target code. If you don’t need the reset though, you can easily manage just 4 pins to the target.
My current development tools are the Rowley Crossworks for ARM suite. I run that on a mac so all the following is predicated upon use of a OSX and I have no idea how it all behaves under Windows. Just lately, Rowley added support for the STLINK/V2 programmer. You can buy these quite readily but don’t get the earlier STLINK. It will work fine with other tools but not Crossworks on a mac. The STLINK/V2 is probably one of the cheapest debugger/programmers available – it can be had from Farnell for about £34. It is small and neat and connects to the PC using a common mini-USB lead. Best of all, for the Mac, it needs no drivers. Crossworks sees it automatically. All you need to remember is to set it up to use SWD rather than JTAG. As an extra benefit, the new STM32F4Discovery has an STLINK/V2 built in which can aso be used as a slightly less elegant stand-alone debugger/programmer for other targets.
The connector provided on the STLINK/V2 for STM32 targets is the standard 20-pin header so you will need to make an adaptor to bring out just the SWD signals to your target. The minimum requirement is four wires and it is quite easy to use four separate wires into a standard IDC connector directly. Be sure to use suitable wires for this – they need an outside diameter of no more than 1mm if you are to avoid accidentally connecting to the pins either side. On the target board side, use whatever is convenient.
For my breadboarded test rig, I used a four pin Harwin M20 connector. Even on a half size micromouse, this will not take up much room and I may use it as the only debug/programming connector.
The pins on the 20-pin standard JTAG connector to use are:
- Pin 1 – VCC:
- This is the traget board Vcc. It is used by the STLINK/V2
- Pin 7 – TMS/SWDIO:
- The SWD Data signal
- Pin 8 – GND:
- Be sure there is a common ground
- Pin 9 – TCK/SWCLK
- The SWD Clock Signal
- Pin 15 – nSRST/RESET
- System reset – probably optional
You can find out more about JTAG/SWD connectors here:
Incoming search terms:
- stm32 swd (48)
- SWD stm32 (35)
- swd connector (33)
- stm32 swd pinout (32)
- crossworks stlink v2 swd (22)
- SWD отладка STM32 (13)
- swd programmer (12)
- stm32 swd connector (11)
- swd connector stm32 (11)
- stm32 swd interface (9)