The main Safe TinyOS page is here.

Installing Safe TinyOS

Install the Safe TinyOS Tools

You need to be running nesC 1.3.0 or later, TinyOS 2.1.0 or later, a recent Deputy, and recent versions of map430-gcc and/or avr-gcc. Either build these from scratch or grab the precompiled packages. See story here.

Our Deputy packages are mirrored at Stanford and can also be found here:

Building Deputy

NOTE: This is unnecessary if you can make one of our precompiled packages work

To compile from source, you first need OCaml 3.09 or newer installed and in your path. Precompiled OCaml packages are available for Cygwin and for many Linux distributions, or compile it yourself.

cd $SAFE_TINYOS_HOME
svn checkout svn://hal.cs.berkeley.edu/home/svn/projects/trunk/deputy 
cd $DEPUTY_HOME
wget -O $DEPUTY_HOME/deputy.patch http://www.cs.utah.edu/~coop/safetinyos/files/deputy.patch
patch -p0 < deputy.patch
./configure --prefix=$SAFE_TINYOS_HOME/tool-install
make
make install

Patch an avr-gcc header file

NOTE: This is unnecessary if you're using the TinyOS 2.1 tools

cd /usr/avr/include/avr
wget -O sfr_defs.patch http://www.cs.utah.edu/~coop/safetinyos/files/sfr_defs.patch
patch -p0 < sfr_defs.patch

Patch an msp430-gcc header file

NOTE: This is unnecessary if you're using the TinyOS 2.1 tools

cd /opt/msp430/msp430/include/msp430 
wget -O adc12.patch http://www.cs.utah.edu/~coop/safetinyos/files/adc12.patch 
patch -p0 < adc12.patch 

Sanity check: Test unsafe TinyOS

tos-check-env

cd $TOSROOT/apps/Blink
make mica2
make micaz
make telosb

cd $TOSROOT/apps/MultihopOscilloscope 
make mica2
make micaz
make telosb

All apps should build without errors.

Test Safe TinyOS

cd $TOSROOT/apps/Blink
make mica2 safe
make micaz safe
make telosb safe

cd $TOSROOT/apps/MultihopOscilloscope 
make mica2 safe
make micaz safe
make telosb safe

All apps should build without errors.