Home
About Contiki
Download
Instant Contiki
Install and Compile
Documentation
Publications and Talks
Contiki Projects
Mailing lists
Changelog
uIPv6 FAQ
Statistics
Visitors: 1946116
Article Categories
Current Events
Developers
Events
News
Perspective
Platforms
Projects
Tutorials
All
User Menu
Profile
Login
Syndicate
Tutorial: Installing and Using Contiki for the TelosB/Tmote Sky on an Intel-based Mac Print
Written by Adam Dunkels, Thursday, 05 April 2007
Image

The following tutorial shows how to install Contiki for the TelosB/Tmote Sky on the Intel-based Mac OS X, and compile and run the example "Hello World" program. It was written by Markus Anwander from the University of Bern, Switzerland. Read on for details.

Update 17 July 2008: Andrew Pullin have contributed a new tutorial, complete with installer package!

# This is a modification of
# http://www.dcs.bbk.ac.uk/~ettore/howtocontikiosx.html


### Step 1: ###########
# Check tmote sky USB driver
ls /dev/ > before
ls /dev/ > after
diff before after
8a9
> cu.usbserial-M4AETB1R
154a156
> tty.usbserial-M4AETB1R
rm before after

# Otherwise:
# Install FTDI driver for OS X from http://www.ftdichip.com/Drivers/VCP.htm.

# check for wget
wget
wget: URL fehlt
Syntax: wget [OPTION]... [URL]...

# Otherwise:
# Install wget with fink (sudo apt-get install wget) (fink install wget) or http://www.gnu.org/software/wget/



### Step 2: ###########

date
# Thu Mar 29 21:38:09 CEST 2007
# In case of different cvs repositories, I saved the actual repositories as tar.gz on my homepage.

cd /tmp
mkdir mspgcc
cd mspgcc

wget http://mirror.switch.ch/ftp/mirror/gnu/binutils/binutils-2.17.tar.bz2
tar xjvf binutils-2.17.tar.bz2
cd binutils-2.17
./configure --prefix=/opt/msp430 --target=msp430
make
make install
cd ..

export PATH=$PATH:/opt/msp430/bin

wget http://mirror.switch.ch/ftp/mirror/gnu/gcc/gcc-3.3.6/gcc-core-3.3.6.tar.bz2
tar xjvf gcc-core-3.3.6.tar.bz2
cvs -z3 -d:pserver:anonymous@mspgcc.cvs.sourceforge.net:/cvsroot/mspgcc co gcc/gcc-3.4
# wget http://www.iam.unibe.ch/~anwander/mspgcc/msp430-gcc.tgz
# tar -zxf msp430-gcc.tgz
cd gcc-3.3.6
cp -R -L -p ../gcc/gcc-3.4/* .
./configure --prefix=/opt/msp430 --target=msp430
make
make install
cd ..

cvs -z3 -d:pserver:anonymous@mspgcc.cvs.sourceforge.net:/cvsroot/mspgcc export -D now msp430-libc
# wget http://www.iam.unibe.ch/~anwander/mspgcc/msp430-libc.tgz
# tar -zxf msp430-libc.tgz
cd msp430-libc/src
wget http://www.iam.unibe.ch/~anwander/mspgcc/mspgcc-Makefile.patch
patch Makefile mspgcc-Makefile.patch
mkdir msp1
mkdir msp2
make
make install
cd ../..

### Step 3: ###########

cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x/tools/src/mspgcc-pybsl
cd tinyos-1.x/tools/src/mspgcc-pybsl
# wget http://www.iam.unibe.ch/~anwander/mspgcc/bsl.py
# wget http://www.iam.unibe.ch/~anwander/mspgcc/serial.tgz
wget http://www.iam.unibe.ch/~anwander/mspgcc/bsl.patch
patch bsl.py bsl.patch
cp bsl.py /opt/msp430/bin/msp430-bsl
cp -r serial /opt/msp430/bin/

#########
# GDB If needed:
#
# wget http://mirror.switch.ch/ftp/mirror/gnu/gdb/gdb-6.0.tar.bz2
# tar xjvf gdb-6.0.tar.bz2
# cvs -z3 -d:pserver:anonymous@mspgcc.cvs.sourceforge.net:/cvsroot/mspgcc co gdb/gdb-current
# cp -r gdb/gdb-current/* gdb-6.0/
# cd gdb-6.0
# ./configure --prefix=/opt/msp430 --target=msp430
# make
# make install

### Step 4: ###########
# change from user ROOT to normal user:

cd ~/
# Add to the ~/.profile file the following lines:

echo "export MOTEPOS='/dev/tty.usbserial-*'" >> .profile
echo "chmod 666 \$MOTEPOS" >> .profile
echo "export PATH=\$PATH:/opt/msp430/bin:contiki-2.x/platform/sky" >> .profile
source .profile


### Step 5: ###########
# checkout contiki
cvs -z3 -d:pserver:anonymous@contiki.cvs.sourceforge.net:/cvsroot/contiki co contiki-2.x

# Test:
cd ../../examples/hello-world
make TARGET=sky
# works


### Step 6: ###########
# Modify the USB Port
# FROM:
# COMPORT := /dev/ttyUSB0
# TO:
# MacOS X: COMPORT := $(MOTEPOS), COMPORT := /dev/tty.usbserial-M4AETB1R

# I use this patch in the contiki-root directory 'contiki-2.x' :
cd ~/contiki-2.x #
wget http://www.iam.unibe.ch/~anwander/mspgcc/usbport.patch
patch -p0

cd examples/hello-world
make TARGET=sky
make TARGET=sky hello-world.u
#
#
#
# MSP430 Bootstrap Loader Version: 1.39-telos-7
# Debug level set to 1
# Python version: 2.4.2 (#1, Nov 20 2006, 21:00:17)
# [GCC 4.0.1 (Apple Computer, Inc. build 5363)]
# using serial port '/dev/tty.usbserial-M4AETB1R'
# Preparing device ...
# Mass Erase...
# Transmit default password ...
# Actions ...
# Invoking BSL...
# Transmit default password ...
# Autodetect successful: f16c -> F1x family
# Current bootstrap loader version: 1.61 (Device ID: f16c)
# Current bootstrap loader version: 0x0161
# Changing baudrate to 38400 ...
# TODO list:
# actionProgram
# Program ...
# Program starting at 0x4000, 224 bytes ...
# Program starting at 0x40e0, 224 bytes ...
# Program starting at 0x41c0, 224 bytes ...
# Program starting at 0x42a0, 224 bytes ...
#
#
#
# Program starting at 0x8d00, 224 bytes ...
# Program starting at 0x8de0, 168 bytes ...
# Program starting at 0xffe0, 32 bytes ...
# 20136 bytes programmed.
# Reset device ...
# rm hello-world.co hello-world.firmware hello-world.ihex

# -> YES
 
< Prev   Next >

Adam Dunkels (contact)