On Apr 26, 2007, at 9:44 AM, Philip Levis wrote:
After investigating the tossim and tinyOS code, I found new clues. I
still don't understand what's going on, but it may be related to a
change in VirtualizeTimerC.
I have a component that uses a Timer array, wired to
VirtualizeTimerC.
I wire VirtualizeTimerC.updateFrom to TinySchedulerC.TaskBasic,
because it used to use the TaskBasic interface, but it seems it is
not
the case anymore...
I don't even understand how my application compiles without errors. I
tried to comment the TaskBasic wired, it compiled, but didn't change
the problem. Maybe that was a completely different issue...
Also after browsing tossim code, I tend to think that it is more a
tinyos problem than a tossim problem, but that's just a guess.
If all this makes any of you have an idea, please tell me, I'm quite
in a hurry to fix that.
Thanks for the data.
The issue probably stems from the rewrite of the atm128 timer
stack. David Gay completely rewrote the stack and so I completely
rewrote the TOSSIM part of it. I tested it a week before the
release and it worked, but now it looks like those tests do not pass.
As a band-aid solution, if you move the file platforms/mica/sim/
HilTimerMilliC.nc to have another name, then TOSSIM should default
to the hardware-independent implementation in tos/lib/tossim.
I found the bug. Somehow, a checkin was lost when cutting the RPM.
The bug is in tos/chips/atm128/atm128_sim.h; this is the fix:
22,23c22,23
< #define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) + 0x20)
< #define _SFR_IO16(io_addr) _MMIO_WORD((io_addr) + 0x20)
---
> #define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) )
> #define _SFR_IO16(io_addr) _MMIO_WORD((io_addr) )
That is, the _SFR macros should not add 0x20. When they do so, then
the timer hardware emulation breaks. The timer system becomes
confused with the overflow settings of the timer, such that it thinks
the counter does not reset on compare when it actually does.
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help