1
\$\begingroup\$

I want take a look at the memory and at the elements inside the atmega1280. I compiled Ardupilot sketch and I uploaded it with an arduino.

I started avarice with the following command:

$ avarice --mkII --capture --jtag usb :4242

and I started avr-gdb

$ avr-gdb /tmp/build5831285936308447966.tmp/ArduPilotMega.cpp.elf 

I typed:

(gdb)target remote localhost:4242

and this is the answer:

(gdb) target remote localhost:4242
Remote debugging using localhost:4242
0xfffffffe in ?? ()

when I do list it show me

#include <WProgram.h>

int main(void)
{
    init();

    setup();

    for (;;)
        loop();

    return 0;
}

That is not my ardupilot!

I don't understand why I get the ?? symbol after the target command and why I get a different source after the list command.

Could someone explain where is my error, how they work and the reason of those symbols? More important, how can I take a look inside of the atmega1280?

P.S.: I compiled with Arduino, so I compiled with the -g flag.

Edit: I used an unofficial jtagice mkii:

enter image description here

and I follow this guide for the setting http://www.diydronesafety.com/topic/72-articleundocumented-apm2x-jtag-technique-and-jtag-for-apm1x-using-only-the-redboard/

So mine is presented like this:

enter image description here

\$\endgroup\$
  • 4
    \$\begingroup\$ ... in fact that is what every arduino sketch looks like you simply implement setup and loop in a separate file than that one... \$\endgroup\$ – vicatcu Apr 4 '13 at 22:17
  • \$\begingroup\$ As viactcu suggests, everything looks fine. Try tracing into the setup() or loop() calls and see if it's as you expect. up. If not, you may have told the development-machine-side gdb to reference the wrong elf object. \$\endgroup\$ – Chris Stratton May 6 '13 at 1:19
-1
\$\begingroup\$

You should think about investing in JTAGICE MKII, it supports many Atmel device. When you use it with Atmel AVR Studio, debugging is a breeze and it allows you to look inside all the devices.

\$\endgroup\$
  • \$\begingroup\$ So, are you saying that i can't do it without atmel avr studio? \$\endgroup\$ – DarkCoffee Apr 5 '13 at 15:25
  • \$\begingroup\$ AVR Studio is free and is easily the best debugging interface for Atmel chips. I would peruse through AVRfreaks.net too if you're looking for more help with this; I bet the forums there have what you're looking for. As a side note I have the JTAGICE3 and it was probably the best money I ever spent on a debugger. \$\endgroup\$ – tmwoods Apr 8 '13 at 3:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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