Step by step debugger?

Hello,

I quikly looked around in the Arduino IDE... I haven't seen a step by step debugger yet... Is there any available yet?

Thanks!

Not directly

but if you have an AVR Dragon you can open the project in AVR-Studio and do some low level debugging with it.

If you have a Diecimila you need to remove the auto-reset capacitor because the Dragon needs full control of the reset line (actually the DebugWire protocol used by it runs over the reset pin)

The arduino IDE is a basic environment mostly for beginners, but with avr studio you can even simulate the code and the rest... I dont think you'll have problems picking it up.

If you have a Diecimila you need to remove the auto-reset capacitor because the Dragon needs full control of the reset line (actually the DebugWire protocol used by it runs over the reset pin)

Massi, Do you loose any capabilities by removing that cap? I mean, the FT232 would still work and I can get data through my USB port, right?

How about the Duemilanove? I saw there are the RESET_EN sockets. I do not completely understand what they are good for. If I solder a connection does that in any way make a removal of the capacitor unnecessary?

Do you loose any capabilities by removing that cap? I mean, the FT232 would still work and I can get data through my USB port, right?

What you lose is the auto-reset that the Arduino uses just before uploading a new sketch to the board. In theory you can just manually do a reset with the push-button, but the timing can be a little tricky until you get the hang of it.

Lefty

I checked the AVR specs on the DRAGON development tool, and it seems to be limited to working with parts containing 32K of flash. Does DRAGON support breakpoints and step debugging with the Arduino Mega board?

The Arduino Mega supports JTAG debugging which is definately supporting breakpoints (also depends on your debugger, but with eclipse, and the avr-gdb you should be fine). I just got the Dragon a couple of days ago but haven't tried it yet. As far as I know the proprietary DebugWire mechanism is available in all 8bit Atmega chips.

If you have a dragon or a jtag debugger, you do not need the bootloader anymore. You can configure the IDE to use this programmer instead. Also any programmer can trigger a reset. So this is not a real loss at all.

Udo

Is there a software simulator for the Arduino?

AVR Studio can emulate most Atmels. However it is not 100% bulletproof. And of course it is not linked to the Arduino IDE. And in addition: most of the issues usually arise in conjunction with other components. So a software emulator would be only of limited use.

I think JTAG is the way to go. I would also like to learn how JTAG is done in a Linux / GNU Toolchain environment. Is there anyone out there who has done this and documented how to do it?

Udo

To use JTAG in linux, search for avrice. http://savannah.nongnu.org/projects/freeice/

As far as I understood it is not possible to debug the arduino/Atmega168 chips with JTAG but only the proprietary DebugWire interface. I ve been playing around with the Dragon a bit and must say I am not really satisfied. Stepping through the code takes ages for every line ... and it's not because of my desktop machine ... therefore its not really faster than try'n'error debugging or with println output. Nevertheless I found some bugs with it in my code, so it was worth the buy. And I was able to simultaneously debug desktop and device application, which gave me a lot more insight in what went wrong.

@senso: what I would need is a tutorial. @robatt: by chance I found this today: http://en.wikibooks.org/wiki/Embedded_Systems/Atmel_AVR#Simulation

Maybe this virtual breadboard is useful: http://www.virtualbreadboard.net/