Boomerang Tmote Windows install

From TinyOS Wiki
Jump to: navigation, search

This document describes how to download and install the software and tools necessary to develop for Tmote using TinyOS in Microsoft Windows.

Cygwin

Cygwin is a Linux-like environment in Windows. It provides the basic development environment for TinyOS and Tmote. Cygwin's setup program downloads and installs necessary packages. It doesn't hurt to install every package, it just takes a little more space and time to download.

Initial Environment

This install guide uses certain environment variables which are listed here with their defaults. Double check their values before using them in this guide. They must be defined using unix-style paths and not as windows paths like "c:/" or "c:\".

export JDKROOT=/cygdrive/c/j2sdk1.4.2_07
export MSPGCCROOT=/cygdrive/c/mspgcc
export TOSROOT=$HOME/tinyos-1.x

Java

Java is used for the tools that interface between a mote and your PC. The TinyOS tools have been tested on the Java 2 Platform, Standard Edition v 1.4.2 (J2SE).

After installing the JDK, ensure that JDKROOT is set for your installation, such as:

export JDKROOT=/cygdrive/c/j2sdk1.4.2_07

JavaComm

JavaComm is an additional package for Java that provides access to serial ports, required for tools like SerialForwarder. JavaComm for Windows is available directly from Sun; JavaComm for Linux requires more effort. Both require some command-line effort to correctly install, feel free to read the instructions, though these commands work nicely to get JavaComm installed for Windows:

unzip javacomm20-win32.zip
cp commapi/win32com.dll $JDKROOT/jre/bin/
cp commapi/comm.jar $JDKROOT/jre/lib/ext/
cp commapi/javax.comm.properties $JDKROOT/jre/lib/

FTDI VirtualComm USB Drivers

FTDI provides Windows drivers to communicate with their USB-to-RS232 chips as a standard COM port; Linux drivers have been available as part of the kernel since 2.4.0. Use the drivers Microsoft WHQL certified version currently dated 20 Apr 2004.

TinyOS CVS Repository

The TinyOS CVS repository is hosted by the TinyOS SourceForge project. To get the latest, bleeding edge version of the code, enter the following commands at a shell prompt; just press Enter when prompted for a password:

cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/tinyos login
cvs -z3 -d:pserver:anonymous@cvs.sf.net:/cvsroot/tinyos co tinyos-1.x

After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:

export TOSROOT=$HOME/tinyos-1.x

MSPGCC

MSPGCC is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler its supporting tools is necessary for Tmote Rev B. The easiest way to install MSPGCC for Cygwin is to use the MSPGCC RPM provided on the Tmote Tools CD found in the ?upgrade? folder. This RPM installs the tools into /usr/local/mspgcc and requires a Cygwin installed or updated on or after December 4, 2004.

As an alternative, both Cygwin and Linux users can use the build-mspgcc script found in the tools/mspgcc folder on the Tmote Tools CD. The build script by default installs into /opt/msp430, though this can be easily changed by setting an environment variable before building. To use that script, copy the entire contents of the tools/mspgcc directory and its subdirectories containing source archives to a local working directory. Then as root run:

bash build-mspgcc install

If you don't have the Tmote Tools CD available, it can be found in the TinyOS CVS in the directory tinyos-1.x/tools/src/mspgcc/. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.

If the build-mspgcc script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README in the same directory as build-mspgcc. After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as:

export MSPGCCROOT=/opt/msp430

Patched MSP430 Assembler

The MSP430 assembler patched for TinyOS and nesC is now built as a part of the build-mspgcc script, instructions above.

MSP430-BSL for Tmote

msp430-bsl is the programmer, or "Boot Strap Loader", for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. Go to $TOSROOT/tools/src/mspgcc-pybsl/ and follow the instructions detailed in README.msp430-bsl-tmote. For Tmote sky, msp430-bsl version 1.39-tmote-7 or later is required.

As an alternative to manually compiling msp430-bsl.exe, Moteiv provides a precompiled version of msp430-bsl that you may download and install:

wget http://moteiv.com/support/msp430-bsl.zip
unzip -o -d $MSPGCCROOT/bin msp430-bsl.zip msp430-bsl.exe python23.dll lib/\*

MoteList

Motelist is a command-line utility that displays which serial ports have Tmote motes attached. Run it with "motelist"; try "motelist -h" for additional options. To compile and install, enter the following command:

cd $TOSROOT/tools/src/motelist/ && make && make install

As an alternative to manually compiling motelist.exe, Moteiv provides a precomiled version of Motelist that you may download and install:

wget http://moteiv.com/support/motelist.zip
unzip -o -d /usr/local/bin motelist.zip motelist.exe

TinyOS Scripts

Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:

cd $TOSROOT/tools/scripts/ && make install prefix=/usr/local

Environment

Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.

# /usr/local/bin
export PATH="/usr/local/bin:$PATH"

# Java
export JDKROOT=/cygdrive/c/j2sdk1.4.2_05
export PATH="$JDKROOT/bin:$PATH"
# MSPGCC
export MSPGCCROOT=/opt/msp430
export PATH="$MSPGCCROOT/bin:$PATH"

# TinyOS
export TOSROOT=$HOME/tinyos-1.x
export TOSDIR=$TOSROOT/tos
export CLASSPATH="`$TOSROOT/tools/java/javapath`"
export MAKERULES=$TOSROOT/tools/make/Makerules

Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.

nesC

nesC is the programming language used for TinyOS, and it requires its own front-end compiler. Download the nesC 1.1.3 source archive from SourceForge. Then, to compile and install nesC, enter the follow command at the shell prompt:

./configure && make && make install

TinyOS Java Tools

The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:

cd $TOSROOT/tools/java; make; make