make use of "Atmel’s Embedded Debugger (EDBG)"

One of its most important feature is Atmel’s Embedded Debugger (EDBG), which provides a full debug interface without the need for additional hardware, significantly increasing the ease-of-use for software debugging.

OK, but I can not use this debugging feature with the arduino IDE, right ? Do I have to use "Atmel Studio" instead ?


we are working to add debugging to the Arduino IDE, in the meantime any IDE that can connect to gdb may possibly work (so Atmel Studio, but I know that also Eclipse successfully run debugging on the Zero, maybe @jantje can say more on that).

I've gotten the command line GDB working with the Zero on both my Windows and Mac machines (the latter does it trivially, the former took a little coaxing). This site has good instructions, though you'll need to adapt it for the real Zero, as the site refers to the Zero Pro from the company-which-must-not-be-named:

If you poke through your Arduino installation directory (Mac, Linux), or your AppData\Roaming\Arduino15 directory (Windows), you can find the executables for OpenOCD and GDB.

You can then write a script (or batch file for Windows) to invoke OpenOCD and GDB. My Mac has one shell script that invokes OpenOCD, then starts gdb and passes the arduino sketch directory of the sketch I want to debug, the connection and initialization commands, and the .elf file for the sketch. I unfortunately don't have my Mac here, so I can't share it with you yet, but if I remember I'll post it this afternoon.

There's still no date to inclusion of debugging capabilities into Arduino IDE??? Thanks

I can't manage to get debugging work on the Arduino CC Zero, while everything runs fine on the Arduino ORG M0 Pro.

  • A first terminal window for OpenOCD.

~/Library/Arduino15/packages/arduino/tools/openocd/0.9.0-arduino/bin/openocd -d2 -s ~/Library/Arduino15/packages/arduino/tools/openocd/0.9.0-arduino/share/openocd/scripts/ -f ~/Library/Arduino15/packages/arduino/hardware/samd/1.6.2/variants/arduino_zero/openocd_scripts/arduino_zero.cfg

  • A second terminal windows for GDB.
(gdb) file path/to/executable.elf
(gdb) monitor reset halt
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc
(gdb) load
Loading section .text, size 0x2b24 lma 0x2000
Loading section .data, size 0x94 lma 0x4b24
Start address 0x2cbc, load size 11192
Transfer rate: 3 KB/sec, 5596 bytes/write.
(gdb) monitor reset init
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc
(gdb) continue
at91samd21g18.cpu -- clearing lockup after double fault
Program received signal SIGINT, Interrupt.
0xfffffffe in ?? ()

Note the SIGINT and the strange address 0xfffffffe!

Any clue?

We have debugging for the Zero working in Visual Studio 2015. Correctly translates line offsets of multiple .ino files (that were combined into .cpp during compile)

An update was released a few weeks ago that makes things even easier. If you have the C++ and the Android tools for Visual Studio installed it is just a matter of selecting the Zero board and clicking Debug>Start Debugging.

If a program is already running on a Zero then click "Debug>Attach to process" which avoids the build and upload process.

Read more


Is this the software debugger or the hardware debugger?