If our board only has 4 interfaces: V3.3, SWDIO, SWDCLK, GND. Then the connection relationship with JTAG is shown in the figure below:
Pay attention to the direction of the notch. Then GND can be connected to any pin on the left (except for the bottom pin).
The 20-core to 4-core wire should be short; otherwise, high speed may cause errors.
A 20-core wire, with ground in the middle, can achieve high speed.