Upgrading from TinyOS 1.x to TinyOS 2.x |
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
.
TinyOS-specific Tools
Tool | Windows/Cygwin | Linux | Command |
NesC | nesc-1.2.7a-1.cygwin.i386.rpm | nesc-1.2.7a-1.i386.rpm | rpm -Uvh |
tinyos-tools | 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) |
To preserve your old tinyos-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
.
TinyOS 2.x
Windows/Cygwin | Linux | |
TinyOS | tinyos-2.0.0beta2-3.cygwin.noarch.rpm | tinyos-2.0.0beta2-3.noarch.rpm |
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 |