J-Link EDU Mini to Metro M0 Express Connection
20 February 2019
The ATSAMD21G18 microcontroller on a Adafruit Metro M0 Express Arduino compatible board can be directly programmed and debugged by plugging a SEGGER J-Link EDU Mini JTAG/SWD debugger into the SWD header of the target board. With a J-Link connected to the board, it can be programmed and debugged using Atmel Studio or other programming tools. This article shows the SEGGER J-Link EDU Mini to Metro M0 Express connection using SWD (Serial Wire Debug).
J-Link EDU Mini
The J-Link EDU mini is a JTAG/SWD debugger from SEGGER for Cortex-M microcontrollers and can be seen in the image below. It is a small form factor version of the J-Link EDU debug probe. For more information, visit the J-Link EDU mini web page on the SEGGER website.
Adafruit METRO M0 Express
Below is an image of the Adafruit Metro M0 Express board that is compatible with Arduino and has an ATSAMD21G18 as its main microcontroller. Pin 1 of the SWD connector is highlighted in red in the image. For more information on this board, go to the Adafruit METRO M0 Express web page on the Adafruit website.
Connecting the J-Link EDU Mini to the Metro M0 Express
The following image shows how to connect a J-Link EDU mini debugger to an Adafruit Metro M0 Express board using the SWD header connector. The red wire of the J-Link ribbon cable must line up with pin 1 of the SWD header. Pin 1 is highlighted in the previous image.
The SWD connector on this board is a shrouded header with a key slot, so it is impossible to connect the ribbon cable the wrong way around – just make sure that the ribbon cable is inserted into the J-Link EDU mini the correct way around. The red wire of the ribbon cable must line up with the 1 silkscreened on the J-Link mini board.
In the image below, the red wire of the ribbon cable is highlighted with two red dots to make the connection between the J-Link and SWD header clearer.