# How can I take look at the inside of the atmega1280?

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


(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:

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:

• ... in fact that is what every arduino sketch looks like you simply implement setup and loop in a separate file than that one... – vicatcu Apr 4 '13 at 22:17
• 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. – Chris Stratton May 6 '13 at 1:19