I wanted to compare the debug output of the Arduino Zero when connecting via two different debug paths.
- Via the embedded debugger (EDBG) connected to Arduino IDE via USB
- Via the JTAG hardware connector J100 to a Black Magic Probe and GDB
The two paths being compared are shown on the Zero Schematic:
Using the Blink.ino compiled for debug, the EDBG works as expected into the Arduino IDE 2.0.4 debugger via USB.
However using the same sketch with the JTAG hardware port to a black magic probe fails to connect, reporting "Target voltage: 1.0V".
rowan@rowan-ThinkPad-X1-Carbon-4th:/tmp/arduino/sketches/1EBCACBEAD6C08902D692E87F523B56E$ arm-none-eabi-gdb Blink.ino.elf
GNU gdb (GNU Arm Embedded Toolchain 10.3-2021.10) 10.2.90.20210621-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from Blink.ino.elf...
(gdb) target extended-remote /dev/ttyACM1
Remote debugging using /dev/ttyACM1
(gdb) monitor jtag_scan
Target voltage: 1.0V
JTAG device scan failed!
Failed
(gdb)
The same probe and setup successfully debugs an Arduino Due. Acknowledging different processors on the two boards.
The JTAG connector is correctly oriented.
Is a switching action needed to enable one debug path or the other, or is something else wrong?
Update 2023-04-01: I bought an SWD breakout board so I could get some test leads on without risking bent pins (it took a couple of weeks to arrive). The VREF pin on the Zero is 0V when running the debug version of Blink.ino. In comparison the same test rig connected to Due running debug Blink.ino VREF is 3.3V as expected.
Tracing back the Zero JTAG VREF pin connection on the PCB, the connection is as expected compared to the published PCB Layout. It connects to a pin on the Atmel EDBG chip (IC3).
At J100 the schematic (snippet above) labels this connection VCC_P3V3. However it seems to connect to VCC_EDBG_P3V3.
I'm going to spend some time with the Atmel EDBG User Guide
Update 2023-04-01 #2: During successful debugging using the USB EDBG to Arduino IDE method, the JTAG (J100) VREF pin remains at 0V.
Update 2023-04-01 #3: Refering to the EDBG datasheet section 5. The pin on the EDBG chip (IC3) to which the JTAG Vref pin is connected is (K9) EDBG_TCK. Noting the orientation is inverted compared to the PCB image. EDBG_TCK is described as "JTAG Test Clock pin for EDBG device", and is in the EDBG manufacturing programming group of pins.
OK, it's clear to me now, that this isn't the JTAG I was looking for, I'll write it up as an answer.