Which Arduinos can you debug on?

I haven't been able to find a good resource as to which Arduino boards its possible to perform debugging on (if any) and how?

All of them - with Serial.print

If you meant which Arduino's support a debugger, that's a different question. Google has some answers, and you might want to checkout http://playground.arduino.cc/Main/DevelopmentTools

In general Serial.print plus an oscilloscope will cover most scenarios.

I beg your pardon, I did mean which Arduinos support debugging.

I was hoping there was a IDE-like solution of inspecting various registers etc. as in Atmel Studio and CodeWarrior.

No, there is no such functionality in the arduino ide.

I believe there in in embedXcode which I use but I am not sure which boards support it

For future readers, from here:

Debugging requires boards with a built-in hardware debugger.

Only the LaunchPads from Texas Instruments feature a built-in debugger.

There's an optional chipKIT PGM programmer-debugger for the chipKIT boards.

As at today, debugging has been tested successfully on the following boards: Most of the LaunchPad boards, including MSP430G2, MSP430F5529, Stellaris LM4F120 now Tiva C Series TM4C123, WiFi with CC3200, Experimenter Board MSP430FR5739, chipKIT Uno32 with external chipKIT PGM programmer/debugger —release 160 Arduino M0 Pro Intel Edison board with the Yocto environment connected with either WiFi or Ethernet over USB Most of the mbed-enabled boards —drivers for some mbed boards may be incompatible with Mac OS X Yosemite.

[u]None of the Arduino boards feature a debugger except the Arduino M0 Pro.[/u]

You actually can debug with Arduinos, just not with the Arduino IDE.

I've personally done it using MATLAB (works like a charm) and I think other IDEs such as Visual Studio and MPLABX also have realtime debugging for Arduinos.

It's not recommended, seeing that using prints to debug is the most conventional way of doing it.

It’s not recommended, seeing that using prints to debug is the most conventional way of doing it.

That’s good to know. I may as well form good habits now if that functionality is not going to be available across multiple platforms.

Well actually the Arduino teaches bad habits in this particular area. The boards all support JTAG debugging, even on the 16u2 support chips. The Due board actually has several different headers for different debugger hardware.

But that's hardware that you don't need to buy to make an LED blink, so nobody does and there's no pathway to learning that skill.

Paul Stoffregen, the creator of the Teensy has said that his next project after the Teensy 3.6 (any day now!) will be a proper debugger integrated in the Arduino IDE.

The AVRFreaks forum is probably a better place to ask. They should not get offended if you ask for their recommendations on software or hardware to debug an Arduino.

It is possible to debug Arduino using an ATMEL-ICE (~$40), through debugWire and Atmel Studio. See: DEBUGGING ARDUINO SKETCHES WITH ATMEL STUDIO 7

It is possible to cobble up something to do source level debugging with gdb on top of Aduino h/w using the IDE.

I was using this collection of tools:

  • IDE to build & upload the f/w image requires patching a few of the build rules and some wrapper scripts to do the upload.

  • eternal editor

  • ddd on top of gdb for a gui interface on top of gdb Or you can simply use the gdb commandline

  • AVaRICE to communicate between gdb and an AVR dragon

This worked with both ISP and debugwire debugging.

It is pretty cool to be source level debugging code inside a 8 pin attiny85.

This was not on Windows as that OS is very hostile to command line tools which makes doing many things related to embedded development very difficult or impossible.

--- bill

I was hoping there was a IDE-like solution of inspecting various registers etc.

The boards all support JTAG debugging, even on the 16u2 support chips.

No; the smaller AVRs only support "Debugwire", which is an Atmel-proprietary low-pin-count debug protocol. The Arduino auto-reset circuitry also interferes with this at the hardware level. The larger AVRs (Arduino MEGA, ATmega1284-based boards) have JTAG interfaces, but the debugging commands sent via JTAG are still proprietary. This means that the IDE that can be used for "real" debugging of the AVRs is limited to Atmel Studio (and perhaps some of the higher-priced commercial IDEs.)

The ARM Arduinos support the standard ARM debugging protocols, over some variation of JTAG or SWD.

Your best bet for "real debugging" of Arduino Uno code is probably to buy an Atmel "ATmega328p Xplained Mini" board and use it with Atmel Studio.

It is ... very annoying ... that the debug protocols are so proprietary and undocumented :-(