[Tinyos-help] telosb Debug
urs.hunkeler at epfl.ch
Tue Nov 30 08:03:19 PST 2010
If I can predictably repeat an error, I usually use the LEDs to find out
where the code crashes.
It often also helps to disable parts of the code or replace parts with
dummy code (e.g., instead of reading a sensor just use a constant), and
try to find the part of the code that is responsible for the crash.
You could also insert printf debugging statements:
The TelosB platform has a different microcontroller but uses the same
radio as the MicaZ platform. Maybe you can compile your program for
TOSSIM (simulating the MicaZ platform) and find your problem like this.
General programming practices:
* It is always a good idea to check return values. I reserve an LED to
indicate that an error condition has occurred (e.g., call Leds.led2On(); ).
* One nasty error I had in the past was that I would try to send
messages which were too big (at least on one of the platforms I used).
When you try to get a pointer to the data portion, make sure you also
verify that the pointer is not NULL.
* If you have a recursive function, maybe you get a stack overflow. You
can have all sorts of hidden infinite loops.
* If, when you compile the program, it indicates that it needs almost
all of the RAM, remember that function calls and such allocate
additional memory on the stack that is not accounted for in the memory
requirement list shown by the TinyOS make environment. Maybe you're
running out of memory.
If you'd like more ideas, could you describe your problem in more
details? What does your application do? When does it crash, e.g., at
boot-up, when exchanging data with other motes, when accessing sensors
or other peripherals?
On 11/30/2010 04:10 PM, wasif masood wrote:
> I am trying to use gdb, but when I compile using make telosb debug, it
> give me vector overwrite error since my code is too big to fit with
> debug flag enable. Can anyone please give me a hint what else can be done.
> On Tue, Nov 30, 2010 at 1:47 PM, wasif masood <rwmasood at gmail.com
> <mailto:rwmasood at gmail.com>> wrote:
> Hi All,
> Is there any way I can debug my actual telosb install file on my PC.
> I have written a code which is showing very strange behaviour, it
> seems that at some point during execution, the code just crashes.
> What could be the best option to check at which point my code gets
> Wasif Masood
> Wasif Masood
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
More information about the Tinyos-help