Arduino Zero & Debugging

Hello all, I wish to experiment with the Arduino IDE 2.2.2 debug capability but an unsure as to what hardware to purchase. As I understand it, the Zero can use the debugger with no additional hardware. Is that correct?

However, if so, the Arduino web site always seems to show the Zero as being "sold out" for the Americas etc. and, the European option does not facilitate shipping to non-European or African countries (I'm in Canada).

Adafruit in the US shows the Zero as "discontinued". Are there any other purchase options for obtaining a genuine Zero? or, will any other Arduino processor options work for debugging without additional hardware?

Thanks much for any assistance..

You can take a look at Setting up the Arduino Zero Built-in Debugger Interface. You can contact Arduino Distributors (Distributors — Arduino Official Store) in your country to see if they have stock.

Hello, I'm currently having trouble debugging Arduino Zero. The operating system is Windows 11, using Arduino IDE 2.3.2, and connecting Arduino Zero via a Micro USB data cable. I followed the official tutorial you provided, but I couldn't debug successfully.
([2024-07-02T13:20:50.175Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
"C:\Users\21099\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/bin/openocd" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "d:\301301301\NiryoConveyor" -f "D:/Anaconda/Arduino IDE/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl" -f "C:\Users\21099\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.14/variants/arduino_zero/openocd_scripts/arduino_zero.cfg"
Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
CDRTOSConfigure
Info : auto-selecting first available session transport "swd". To override use 'transport select '.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Error: unable to find CMSIS-DAP device

[2024-07-02T13:20:50.221Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...)

Hi @ying_ivan. The Zero board has two USB sockets:

📷

Zero_Usb_Ports.jpg by Arduino - CC BY-SA 3.0

You must connect the USB cable to the "Programming Port" in order to use the Zero board with the Arduino IDE debugger. Did you connect it that way, or did you instead use the "Native USB Port"?

Thank you for your reply. Indeed, that is the issue I'm facing. Upon reviewing the schematics, I found that my hardware does not have the AT32UC3A4256HHB chip, so I cannot debug via the programming port. Following the official "Debugging with Segger J-Link" tutorial, I attempted to debug using J-LINK. I soldered SWDIO to PA31, SWCLK to PA30, and ensured correct connections of GND and 3v3 to my J-Link debugger.
According to the tutorial, my debug_custom.json (located in the project folder) contains the following:

[
  {
    "configId": "arduino:samd:arduion_zero_native:programmer=jlink",
    "server": "jlink",
    "servertype": "jlink",
    "device": "ATSAMD21G18",
    "interface": "SWD",
    "serverPath": "D:/software/Arduino IDE/J_link/JLink_V796q/JLinkGDBServerCL",
    "serverpath": "D:/software/Arduino IDE/J_link/JLink_V796q/JLinkGDBServerCL"
  }
]

After preparation, I connected the hardware's Native USB Port using a Micro USB data cable and connected the corresponding interface on the hardware to the J-Link debugger via SWD. However, when I attempt to debug by clicking the debug button, I encounter the following issue.
Waiting for gdb server to start...[2024-07-03T03:49:21.718Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
"D:/software/Arduino IDE/J_link/JLink_V796q/JLinkGDBServerCL" -singlerun -nogui -if SWD -port 50000 -swoport 50001 -telnetport 50002 -device ATSAMD21G18
SEGGER J-Link GDB Server V7.96q Command Line Version

JLinkARM.dll V7.96q (DLL compiled Jun 28 2024 12:36:40)

Command line: -singlerun -nogui -if SWD -port 50000 -swoport 50001 -telnetport 50002 -device ATSAMD21G18
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 50000
SWO raw output listening port: 50001
Terminal I/O port: 50002
Accept remote connection: localhost only
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: ATSAMD21G18
Target device parameters: none
Target interface: SWD
Target interface speed: 4000kHz
Target endian: little

Connecting to J-Link...
Connecting to J-Link failed. Connected correctly?
GDBServer will be closed...
Shutting down...
Could not connect to J-Link.
Please check power, connection and settings.[2024-07-03T03:49:21.972Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

How should I proceed to resolve this problem?