This document describes how to upgrade your TinyOS 1.x environment to a TinyOS 2.x environment. This requires that you not only install the TinyOS 2.x rpm, but also that you upgrade your tools from the toolset distributed with TinyOS 1.1.0 and used with all 1.x TinyOS versions up through and including TinyOS 1.1.14. The new toolset was created for use with TinyOS 1.x beyond 1.1.14 as well as TinyOS 2.x. We call this new tooset version the '1.2' toolset.
Because we expect many developers to maintain a 1.x and 2.x tree simultaneously, we will also explain what parts of your environment need to be reconfigured if you switch from TinyOS 2.x to TinyOS 1.x. The 1.2 toolset is backwards compatible with the 1.x TinyOS tree, so switching back and forth requires only a few variable changes. You can find those directions at the bottom of the page.
There are 3 steps to upgrading from 1.x to 2.x:
At this time, we have available compiler toolsets for Atmel AVR and TI MSP430 platforms.
All of the tools are in the http://www.tinyos.net/dist-1.2.0/
and the http://www.tinyos.net/dist-2.0.0
distribution trees, but are linked below for convenience.
Atmel AVR Tools
Tool | Windows/Cygwin | Linux |
avr-binutils† | avr-binutils-2.15tinyos-3.cygwin.i386.rpm | avr-binutils-2.15tinyos-3.i386.rpm |
avr-gcc | avr-gcc-3.4.3-1.cygwin.i386.rpm | avr-gcc-3.4.3-1.i386.rpm |
avr-libc | avr-libc-1.2.3-1.cygwin.i386.rpm | avr-libc-1.2.3-1.i386.rpm |
avarice | avarice-2.4-1.cygwin.i386.rpm | avarice-2.4-1.i386.rpm |
insight (avr-gdb) | avr-insight-6.3-1.cygwin.i386.rpm | avr-insight-6.3-1.i386.rpm |
rpm -Uvh --force
TI MSP430 Tools
rpm -ivh
. If you are
only installing a 2.x tree, you can use rpm -Uvh
.
If you using the Cygwin version recommended
in these install
instructions, you should install the "Recommended" Windows/Cygwin
nesC RPM.
Try installing it and if it does not work (e.g., you
get strange errors when you try to execute it), this may be due
to a Cygwin version incompatibility: try the "Other" Windows/Cygwin
RPM (1.2.7a).
TinyOS-specific Tools
Tool | Recommended Windows/Cygwin | Other Windows/Cygwin | Linux | Command |
NesC | nesc-1.2.7b-1.cygwin.i386.rpm | nesc-1.2.7a-1.cygwin.i386.rpm | nesc-1.2.7a-1.i386.rpm | rpm -Uvh rpm -Uvh --ignoreos (if Cygwin complains) |
tinyos-tools | tinyos-tools-1.2.2-1.cygwin.i386.rpm | tinyos-tools-1.2.2-1.cygwin.i386.rpm | tinyos-tools-1.2.2-1.i386.rpm | rpm -ivh --force (1.x tree)rpm -Uvh (no 1.x tree) |
If you have an existing 1.x tree, we strongly recommend that you use
the install (-i
) rpm argument when installing the tinyos-2.x rpm rather
than the upgrade (-U
) argument. The difference is that the -U
will
first remove the tinyos-1.x tree while -i
will not remove previously installed
files. Said another way, we recommend using rpm -ivh
.
If you have an existing 2.x tree which you want to keep unchanged, then you will need to move it to make space for the new one. For example, if you have an existing tree in /opt/tinyos-2.x/, then you can move it to /opt/tinyos-2.x-old. Once you have moved it, we recommend performing a forced installation of the 2.0 tree.
If you have an existing 2.x tree which you do not care about, then we recommend removing it before installing the new one with a forced install.
TinyOS 2.x
Windows/Cygwin | Linux | Command | |
TinyOS | tinyos-2.0.0-1.cygwin.noarch.rpm | tinyos-2.0.0-1.noarch.rpm | rpm -Uvh (to upgrade) rpm -ivh (to install) rpm -ivh --force (to force install) |
In TinyOS 1.x, much of your environment was set by the rpm installation process by copying a tinyos.sh file into /etc/profile.d which was subsequently run anytime a shell was started. Because this was deemed unnecessarily invasive, the 2.x rpm does not do this. Rather, you need to set these variables yourself. Ideally, you'll put them in a shell script that will run when your shell starts, but you needn't put such a script under /etc/profile.d.
Please take note of the current settings since you'll need those if you want to work in your current 1.x tree sometime in the future.
The example settings below assume that the tinyos-2.x installation is in /opt/tinyos-2.x. Change the settings to be correct for where you've put your tinyos-2.x tree. Note that the windows CLASSPATH must be a windows-style path, not a cygwin path. You can generate a windows style path from a cygwin-style path using 'cygpath -w'. For example:
export CLASSPATH=`cygpath -w $TOSROOT/support/sdk/java/tinyos.jar` export CLASSPATH="$CLASSPATH;."
TinyOS 2.x
Environment Variable | Windows | Linux | |
TOSROOT | /opt/tinyos-2.x | same as in Cygwin | |
TOSDIR | $TOSROOT/tos | same as in Cygwin | |
CLASSPATH | C:\tinyos\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar;. | $TOSROOT/support/sdk/java/tinyos.jar:. | |
MAKERULES | $TOSROOT/support/make/Makerules | same as in Cygwin | |
PATH† | /opt/msp430/bin:$PATH | same as in Cygwin |
In addition to the above environment variables, do the following on Linux machines:
chown -R <your uid> /opt/tinyos-2.x
chmod 666 /dev/<devicename>
TinyOS 1.x
Environment Variable | Windows | Linux | |
TOSROOT | /opt/tinyos-1.x | same as in Cygwin | |
TOSDIR | $TOSROOT/tos | same as in Cygwin | |
CLASSPATH | `$TOSROOT/tools/java/javapath` | same as in Cygwin | |
MAKERULES | $TOSROOT/tools/make/Makerules | same as in Cygwin |
Switching between the two should require switching only these environment variables.