Installing and Configuring T2 for iMote2 on Windows XP

From TinyOS Wiki
Jump to: navigation, search

This article assumes that you are performing a clean install of TinyOS 2.x on Windows XP

Install Java

  1. Download and install Sun's Java Development Kit from http://java.sun.com.

Install Cygwin

This is only necessary if you don't have Cygwin installed already.

  1. Obtain the latest cygwin version from [1].
  2. Install cygwin where you please, but we will assume you have installed it at C:\cygwin
  3. Select options for “install for all users” and “use unix file types”.
  4. By default, the Devel option doesn’t include the CVS options. Make sure you go to the Devel list, and change the "cvs, cvsps and cvsutil" sublists from skip to install. Also, select the "make" sublist because it will be needed.
  5. Also choose to install an editor, Vim and Emacs are handy (make sure to select them under editors)
    1. Aside: You can always just use a unix line ending compatible texteditor (like http://www.scintilla.org/SciTE.html or if you like the Eclipse environment you can go ahead and use that: the latest nesC grammar doesn't have any plugins but you can use the basic Eclipse framework rather neatly.
  6. Make sure you choose to install the "rpm" option as you will need it to install the packages provided on sourceforge.
  7. Cygwin might (the latest versions do not seem to have this problem) point your home directory to "c:\Documents and Settings\your_login\name". This is liable to create some conflicts with other apps, so look in /etc/passwd, scroll down to the line that starts with "your_login_name" and if the string is /cygdrive/c/Documents and Settings/your_login_name" change it to "/home/your_login_name". Restart cygwin and check your home directory
  • For those you of who are not familiar with a *nix style environment, this site has some nice links to help you start off: [2]

Download the TinyOS 2.x Tree

Since TinyOS is ever evolving, we recommend that you download the latest version from the CVS repository on SourceForge.

  1. To download the TinyOS 2.x tree from scratch, type "cd /opt" and type the following
    cvs –z3 –d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co –P tinyos-2.x
    If you have an account on sourceforge, replace anonymous with your login name and “pserver” with “ext”. When prompted for password enter your password (or no password for the anonymous account, just press Enter key)
  • This will take a few minutes.

Download the TinyOS 2.x Contrib Tree

The contrib tree is very important for all iMote2 users. The current maintainers of the iMote2 have created a folder in tinyos-2.x-contrib/intelmote2 . Please read the README located there after following these instructions for the latest updates.

  1. To download the TinyOS 2.x Contrib tree from scratch, type "cd /opt" and type the following:
    cvs –z3 –d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co –P tinyos-2.x-contrib
    If you have an account on sourceforge, replace anonymous with your login name and “pserver” with “ext”. When prompted for password enter your password (or no password for the anonymous account, just press Enter key)
  • This will take a few minutes.

Downloading and Installing NesC from CVS

This method is optional, if you choose to install from binaries that will be explained below

  1. To download the NesC tree from scratch, type
    cd /opt
    cvs –z3 –d:pserver:anonymous@nescc.cvs.sourceforge.net:/cvsroot/nescc co –P nesc
    If you have an account on sourceforge, replace anonymous with your login name and “pserver” with “ext”. When prompted for password enter your password (or no password for the anonymous account, just press Enter key)
  2. To build and install NesC run
     cd /opt/nesc
    ./Bootstrap
    ./configure
    make
    make install
    
  • This will take a few minutes.

Downloading and Installing NesC from RPM

If you followed the above step installing NesC from CVS go ahead and skip to the next step

  1. Download the appropriate NesC RPM by referring to the TinyOS Installation Instructions step 4.
  2. Go to the folder you downloaded the RPM to and type
    rpm --ignoreos -ivh ./nesc-XXXX.rpm
    where XXXX is the rest of the filename you downloaded

Setting up the Intel Mote 2 debug board drivers

  1. The Intel Mote 2 debug/programming board contains a dual port FTDI chip to map two of the mote UART ports to USB on your pc. Before connecting Intel Mote 2 debug board to your pc, download the drivers from [3] (for Windows XP). Current version is 2.02.04.
  2. Unzip the file to a folder.
  3. Connect the debug board to your computer via a USB cable. When prompted for a driver, follow the installation instructions, specify the folder that you just unzipped to look for a driver.

Downloading and Installing GraphViz

GraphViz is necessary for using nesDoc and generating the wiring diagrams in the documentation

  1. Download and install Graphviz from [4]

Downloading and Installing the Xscale GCC Binaries

This step is crucial! This is where you install the cross-compiler environment Binaries.

  1. Download the Xscale packages from [5] (there are 3 RPMs to download)
  2. Go to the directory you downloaded the packages to and run
    rpm --ignoreos -ivh ./xscale-elf-binutils-2.15-1.cygwin.i386.rpm
    rpm --ignoreos -ivh ./xscale-elf-gcc-3.4.3-1.cygwin.i386.rpm
    rpm --ignoreos -ivh ./xscale-elf-newlib-1.11.0tinyos-1.cygwin.i386.rpm 

Configuring your Environment

This step is the most dependent on where you've installed all of your packages and downloaded the trees. These instructions assume you installed most things in /opt besides programs meant for windows.

Example .bash_profile additions

echo "TINYOS 2.x"
#TINYOS 2.x
#Defines the TOSROOT variable necessary for the rest of the variables
export TOSROOT=/opt/tinyos-2.x
#Defines TOSDIR
export TOSDIR=$TOSROOT/tos
#Used to specify the type of jtag programming cable you are using
export PXA27X_JTAG_DEV="\"INTEL(R) JTAG CABLE\""
#Defines the paths to various system tools
PATH=/cygdrive/c/Programmi/Java/jdk1.6.0_06/bin:/opt/jflashmm/:/bin:/opt/tinyos-2.x/tools/tinyos/misc:/cygdrive/c/Programmi/Graphviz/bin:${PATH}
#Defines the classpath
export CLASSPATH="c:\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar;."
#Defines the variable used by the java libraries to connect to the motes, your com port will vary!
export MOTECOM=serial@COM19:115200
#Tells make to use the makerules file in tos
export MAKERULES=$TOSROOT/support/make/Makerules

--Still a work in Progress-- --Fspadini 12:31, 20 May 2008 (EDT)