Edgar Charry a écrit :
>   Hi all,
>  
> I am trying to debug my nesC codes using GDB (for TinyOS1.x using 
> Mica2Dot and Mica2). Bunch of naive questions, so I think you know this 
> for sure:
>  
> 1) avr-gdb and gdb are used for .exe (srec?) symbols reading. For the 
> Mica2Dot ATMega128L do I necessarily need to use the 1st one? Or the 
> latter one can also be used? What would be their difference by the way?

exe are elf binary possibly including debug symbols
avr-gdb is a gdb to use for avr binaries
"gdb" is usually the debugger for your host platform binaries (x86, 
x86_64, ppc ... ) so using the plain gdb on a avr binary will not work ...

> 2) Why can I read these symbols only by compiling with the debug command 
> (make mica2dot install debug mib520,com3)?

the debug command adds the -g and or -ggdb flags to the compiler, this 
adds the debug symbols, without them the debugger can't know function 
names / variables names /types etc...
You can inspect symbols names/addresses/sections/disassembly  with 
avr-objdump
With  "PFLAFS='-v' make micaz ..." you can see the exact command line 
passed to gcc .

> 3) For on-chip debugging i need necessarily the JTAG interface to be 
> connected with the MIB520 programming board. Avarice will carry out the 
> interconnection of the JTAG-ICE interface (which is connected to the 
> programming board+Mica2/Mica2Dot of course) and the avr-gdb through the 
> serial port. So that means is 100% certain that I can do step-by-step 
> on-chip debugging using avr-gdb 

yes but it's painfull to use as there is no native support for nesc in 
gdb so you are actually debugging on the plain c code generated by nesc 
(ie. build/micaz/app.c) moreover nesc's $ are ugly to read and prevent 
completion to work under gdb (can be replaced by "__" see 
tinyos-2.x/support/make/avr/avr.rules)

> (or even using the WinAvr Insight graphical GUI).
never tried

 > Can I also see the assembly code and the correspondant
> nesC code side-by-side on that Insight GUI? Has anyone have this sort of 
> experience? 
probably asm <-> C code, at least it works with gdb tui mode

> Is Avarice also compatible with JTAG-ISP 
yes but for programming only it's better to use avrdude
 > or just with the  JTAG-ICE?
what worked best for me was cvs version with patches present on 
sourceforge project page... it's then quite reliable and fast...

> Didn't really want to waste my money....
It's not a waste of money as long as you are aware that it can be 
sometimes painfull and slow to setup and having it running properly.
It's probably of very little use if you have no idea of where or what 
the bug is or the bug happens only very randomly. On the other hand if 
you want to inspect values of i/o / registers/ memory... step by step or 
upon precise conditions or events then it can be very helpful.
You can find some more hints there: 
http://planete.inrialpes.fr/~francill/stuff/AvrJtagIce.pdf

Cheers
Aurélien

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to