Dear Yee Wei,

Long time ago we had a module for TinyOS 1.x on the Mica2 to debug
cases where the stack would overwrite your memory area. Here is the
code:

/tinyos-1.x/contrib/vu/tos/lib/PeaceKeeper

You might be able to port this to tinyos 2.x and use it.

Actually, I would just remove more and more functionality from your
code and test it separately. If just memory reduction solves your
problem, then it is memory overwrite or too fast interrupts filling
your stack. Otherwise you might be able to find the offending code by
bisection.

Best,
Miklos

On Fri, Oct 16, 2009 at 7:04 AM, Yee Wei Law <[email protected]> wrote:
> Dear all,
>
> This is a generic question, but I have to ask out of desperation. I
> have a sizeable TinyOS program (>40 KB, doesn't fit on TelosB), which
> keeps crashing and reseting itself on IRIS. Without a JTAG ICE, I am
> relying on printf for debugging.
>
> (1) I am not using any dynamic memory allocation;
> (2) I am using a global variable as a message buffer so as not to
> repeat the mistake in the thread "Mote crashes when sending"
> (http://www.mail-archive.com/[email protected]/msg29099.html);
> (3) I am not using any recursive function;
> (4) I have also read Levis and Gay's "TinyOS Programming" to watch out
> for potential pitfalls..
>
> ..in vain. I wonder if anybody can suggest an effective way to debug
> this kind of problem?
>
> Thanks in advance.
>
> Regards,
> Yee Wei
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to