[Tinyos Core WG] SPI discussion

Philip Levis pal at cs.stanford.edu
Fri May 11 14:45:52 PDT 2007


At the last telecon, there was a discussion about the issues David  
Moss has been running with power management in the CC2420 stack.  
Here's a brief recap:

The problem stems when duty cycling the radio. Currently the CC2420- 
specific SPI bus abstraction (e.g., reading/writing registers) has an  
AsyncStdControl interface. If you call stop() while in the middle of  
an operation, chaos can ensue, as the SPI resource is released, this  
can power down the bus can cause the in-progress operation to enter a  
never-terminating spin loop on a status flag.

Currently, the way David solves this is to, on stop, prevent any  
further operations from starting, and to wait until any current  
operations complete before releasing the resource. There was a great  
deal of discussion whether this was the right thing to do. The  
general consensus was yes, essentially because release() is not split- 
phase. One idea tossed out was to have release() be split-phase, such  
that you call release(), but if you're in the middle of an operation,  
releaseDone() might come back later. There was general agreement this  
was a bad idea: complexity for a tiny corner case.

I brought up a simple question: why is it that there's a control  
interface? Resource should be automatically handling power management  
of the bus. It looks like the control interface comes from before  
there was a resource management architecture in the OS. So I  
suggested we just remove this functionality entirely, thereby  
removing the problem.  Doing so would obviate the need for the task- 
spin check for when the bus goes idle, would require fewer status  
codes, etc.

David -- does that seem feasible?

Phil




More information about the Tinyos-2.0wg mailing list