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