[Tinyos-devel] SplitControl

Joe Polastre joe.polastre at gmail.com
Thu Jan 6 15:04:16 PST 2005


Currently interrupts are not enabled in the boot sequence for *both*
init and start, which IMHO is absolutely broken.

What if init() does something like calibrate the internal oscillator? 
Why wouldn't you want to use interrupts and fire an initDone()?  The
way we hack around things like that now is to add them to Main and
make sure everyone waits for them (like HPLPot which should have never
been there).

init() occuring with interrupts disables is also problematic in terms
of the task queue.  We've (Jonathan, Cory, and I) seen that when
interrupts are reenabled, the barage of interrupts causes the task
queue to overflow immediately after the "boot" sequence.

Also, Main (or whatever it is called in 1.2, 2.0, whatever version
number) should be able to have SplitControl wired directly to it (or
there should be a "Booter" component that supports SplitControl as we
talked about a few weeks ago)

-Joe


On Thu, 06 Jan 2005 15:10:43 -0800, Philip Levis <pal at eecs.berkeley.edu> wrote:
> On Jan 6, 2005, at 1:36 PM, Joe Polastre wrote:
> 
> > That's the intended use.
> >
> > If a call is outstanding, init, start, or stop should return FAIL.
> 
> OK. Sounds good.
> 
> After a bit of discussion with David G. and Phil B., I have another
> question: is it appropriate to have init() be split-phase?
> 
> The issue is that when init() is called, the component has no assurance
> that anything else is initialized, and almost certainly nothing is
> actually running yet. The theoretical reason why init() is split phase
> is that it might take a while for something (e.g., hardware) to
> initialize, and the component can let other things go on while this is
> happening.
> 
> The problem is that because nothing else is actually running, the only
> way it can provide a split phase interface is through a direct post; it
> can't, for example, schedule a timer in 30ms to post the task, as the
> Timer isn't running yet. But the posted task could run very soon, so
> there's no assurance of a significant amount of time elapsing. The
> component could use a post loop, but at that point why not just make
> init synchronous and block on certain pieces of hardware
> initialization? The idea that hardware might issue an interrupt to
> denote initDone() is kind of nice, but that has fundamental issues in
> that interrupts are not enabled in the boot sequence.
> 
> David G.'s proposal, which I agree with, is that SplitControl -- or
> some other similarly named interface that replaces it -- should have a
> synchronous init and split-phase start and stops:
> 
> interface SplitControl {
>    command error_t init();
>    command error_t start();
>    command error_t stop();
>    event void startDone(error_t err);
>    event void stopDone(error_t err);
> }
> 
> Thoughts?
> 
> Phil
> 
> -------
> 
> "We shall not cease from exploration
> And the end of all our exploring
> Will be to arrive where we started
> And know the place for the first time."
> 
> - T. S. Eliot,  'Little Gidding'
> 
>


More information about the Tinyos-devel mailing list