The SAMD51 and ESP32 both have "JTAG" debugging connections. The SAMD51 has its SWD broken-out to the inner 0.05" header, and the ESP32 is connected to SAMD51 GPIO.

The inner 0.05" header is designed to interface directly with Segger J-link (or similar) pinouts.

Connection to a J-Link EDU mini looks like this:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/dfe8840d-7256-4114-83d3-d01ab00850dc/Untitled.png

More specifically, I use a 2x2 block of male 0.05" headers in combination with any 0.05" cable I can get my hands on. Close-up with annotations below:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/065097de-0f10-488b-b9da-7c4021b6d199/Untitled.png

If you're using a Segger J-Link with 0.1" headers, it's convenient to use something like the Adafruit J-Link breakout board to set-down to 0.05" pitch:

https://www.adafruit.com/product/2094

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c1ac6526-8068-49a7-a4f3-93769fc87810/Untitled.png