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(你可以不要這個復位pin,直接關電源再上電來復位)
ST-Link/V2 可以自己做一些轉接PCB板子,現在USB四線的可以用起來。做一個現在智能手機usb接口,接四根線就好
SWD不單單可以下載還可以單步調試,速度比JTAG快。有人問,那為什么要發明JTAG這個20pin的接口呢?因為JTAG標準制定不是為了下載程序調試程序用的 ,它用來做“邊界掃描”用的,什么是邊界掃描不知道的可以 搜搜一些,在國內谷歌需要翻墻軟件才好用。百度搜索專業術語類不好用,最近我發現好多東西搜搜比百度好用不少。