Upgrading from TinyOS 1.x to TinyOS 2.0.2
Last updated 30 July 2007

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:

  1. Upgrade your external tools (compilers).
  2. Upgrade your Tinyos-specific tools.
  3. Install the Tinyos 2.x source tree.

Step 1: Upgrade your external tools.

The 1.2 toolset uses the same Java JDK and ATT Graphviz versions, so those do not need to be upgraded. What does need to be upgraded are your compiler tools. Install the appropriate version of the following (Windows or Linux) with the rpm command 'rpm -Uvh rpm'.

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
If you receive an rpm error that indicates that you have a newer version already installed, try rpm -Uvh --force

TI MSP430 Tools
Tool Windows/Cygwin Linux
base msp430tools-base-0.1-20050607.cygwin.i386.rpm msp430tools-base-0.1-20050607.i386.rpm
python tools msp430tools-python-tools-1.0-1.cygwin.noarch.rpm msp430tools-python-tools-1.0-1.noarch.rpm
binutils msp430tools-binutils-2.16-20050607.cygwin.i386.rpm msp430tools-binutils-2.16-20050607.i386.rpm
gcc msp430tools-gcc-3.2.3-20050607.cygwin.i386.rpm msp430tools-gcc-3.2.3-20050607.i386.rpm
libc msp430tools-libc-20050308cvs-20050608.cygwin.i386.rpm msp430tools-libc-20050308cvs-20050608.i386.rpm
jtag Not yet available msp430tools-jtag-lib-20031101cvs-20050610.i386.rpm
gdb Not yet available msp430tools-gdb-6.0-20050609.i386.rpm

Step 2: Upgrade your TinyOS-specific tools.

The TinyOS-specific tools are the NesC compiler and a set of tools developed in the tinyos-2.x/tools source code repository. They are also installed using rpms. Due to file conflicts between the new version of the tinyos-tools and older NesC installations, you must upgrade your NesC installation before you upgrade tinyos-tools. Also, if you plan on maintaining a tinyos-1.x tree simultaneously with a tinyos-2.x tree, the tinyos-tools installed for the 1.x versions must remain installed so use 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. If you get strange errors when you try to compile TinyOS programs, such as the error message "the procedure entry point basename could not be located in the dynamic link library cygwin1.dll", this is likely due to a Cygwin version incompatibility: try the "Other" Windows/Cygwin RPM. If you are using Cygwin and installing the nesC RPM causes an error that the RPM was built for Cygwin, add the --ignoreos option.

TinyOS-specific Tools
Tool Recommended Windows/Cygwin Other Windows/Cygwin Linux Command
NesC nesc-1.2.8a-1.cygwin.i386.rpm nesc-1.2.8b-1.cygwin.i386.rpm nesc-1.2.8a-1.i386.rpm rpm -Uvh
rpm -Uvh --ignoreos (if Cygwin complains)
Tool Windows/Cygwin 32-bit Linux 64-bit Linux Command
tinyos-tools tinyos-tools-1.2.4-2.cygwin.i386.rpm tinyos-tools-1.2.4-3.i386.rpm tinyos-tools-1.2.4-3.i686.rpm rpm -ivh --force (1.x tree)
rpm -Uvh (no 1.x tree)

Step 3: Install the TinyOS 2.x source tree.

Now that the tools are installed, you need only install the tinyos 2.x source tree and then set your environment variables.

Switching back to a TinyOS 1.x tree

Since the tools are backwardly compatible, you need only change your environment variables to point to the 1.x settings. Assuming that your old tree was in /opt/tinyos-1.x, you would use the following values:

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.