2
\$\begingroup\$

I've got an Arduino Duemilanove and am programming it in C with AVR Studio. Is there any way to get a source level debugger to work with this setup?

\$\endgroup\$
3
  • \$\begingroup\$ While you may have valid reasons for wanting source level debug, I would recommend not to become reliant on it. Most microcontrollers do not support interactive debugging and relying on it may restrict your choices in future. JTAG debugging is slow, so will usually interfere with real-time tasks. Where possible, use LEDs and UARTs for debug. Write portable code so that the bulk of the logic can be debugged on a PC. \$\endgroup\$ Commented Oct 16, 2011 at 20:13
  • \$\begingroup\$ That is good advice Joby. I tend to treat source level debug as a nice to have, not an essential. I develop already like you say, keep it portable, debug most of the PC. Sometimes it's good to be able to just set a breakpoint and examine and change the variables there without having to add debug prints, recompile, redownload etc. \$\endgroup\$ Commented Oct 16, 2011 at 20:19
  • \$\begingroup\$ I hope this isn't off topic but AVR Studio is Visual Studio. The Arduino Plugin for Visual Studio Pro has a unique Arduino Debugger. It's free at the moment and doesn't require any additional hardware to work so it's easy to try it out. \$\endgroup\$ Commented Oct 21, 2012 at 1:09

2 Answers 2

1
\$\begingroup\$

Yes, some AVRs provide JTAG which can be used with AVR-GDB to do source level debug.

http://winavr.sourceforge.net/AVR-GDB_and_AVaRICE_Guide.pdf

http://www.larsen-b.com/Article/315.html

\$\endgroup\$
4
  • \$\begingroup\$ Thanks, so you definitely need an AVR chip with a JTAG interface to get src level debug? \$\endgroup\$ Commented Oct 16, 2011 at 19:29
  • \$\begingroup\$ I believe so, yes. \$\endgroup\$ Commented Oct 16, 2011 at 19:38
  • \$\begingroup\$ Do you know if any of the standard Ardunio boards have a JTAG port? \$\endgroup\$ Commented Oct 16, 2011 at 19:40
  • \$\begingroup\$ The microcontroller on the arduino.cc/en/Main/ArduinoBoardMega claims to support JTAG \$\endgroup\$ Commented Oct 16, 2011 at 20:04
0
\$\begingroup\$

Get a hardware debugger for atmel to use with your Due. AVROne is the current one. I bought a JTAGICE3 a ways back after the price drops and just got it working with an UNO and boy is it nice to get back to source debugging and hardware breakpoints. debugWIRE is plenty fast for upload and control. I debugged a port of some IR Receive interrupt driven code in minutes. I have a blog entry coming on setting it up. If you are building under AS you hare 1/2 way there.

Other choices in almost free hardware debugging where you get the hardware debug support with the development board have proliferated for a while. Just setup an STM8S Discovery and its great. Other great options are the TI selections, and ARMS, etc.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Not a Due, but a Duemilanove. \$\endgroup\$ Commented Dec 10, 2014 at 6:35
  • \$\begingroup\$ Bad time to abbreviate. Duemilanove should work as well as my UNO R3. The board needs one prep, discussed all over the web. You cut the RESET_EN trace to allegedly allow debugWIRE control over reset. The Duemilanove has what appears to be the same trace. However, I just looked at the schematic for both boards and it really doesn't make sense as there is trace illustrated running around the jumper anyway. Must be a schematic mistake. I installed a jumper so I could go back and forth between the Arduino IDE and debugWIRE. \$\endgroup\$ Commented Dec 10, 2014 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.