Sign up ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

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?

share|improve this question
    
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. –  Toby Jaffey Oct 16 '11 at 20:13
    
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. –  fred basset Oct 16 '11 at 20:19
    
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. –  Visual Micro Oct 21 '12 at 1:09

2 Answers 2

up vote 1 down vote accepted

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

share|improve this answer
    
Thanks, so you definitely need an AVR chip with a JTAG interface to get src level debug? –  fred basset Oct 16 '11 at 19:29
    
I believe so, yes. –  Toby Jaffey Oct 16 '11 at 19:38
    
Do you know if any of the standard Ardunio boards have a JTAG port? –  fred basset Oct 16 '11 at 19:40
    
The microcontroller on the arduino.cc/en/Main/ArduinoBoardMega claims to support JTAG –  Toby Jaffey Oct 16 '11 at 20:04

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.

share|improve this answer
1  
Not a Due, but a Duemilanove. –  Ignacio Vazquez-Abrams Dec 10 '14 at 6:35
    
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. –  Doug Dec 10 '14 at 14:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.