Device Programming

Last updated 03 Sep 2003

The TinyOS development environment includes features to ease programming devices.  First, it directly supports a variety of device programmers, including:

The second key feature permits programming each device with a unique address attribute without having to compile the application each time.

This document describes how to use these features in TinyOS-1.1.

Using Programmers

The standard programming software used in TinyOS is the µ In-System Programmer or 'uisp'.  This program, which comes as a part of the TinyOS release, takes various arguments according to the programmer hardware and the particular programming action desired (erase, verify, program, etc..).  To simplify using this tool, the TinyOS environment invokes uisp for you with the correct arguments whenever you issue an 'install' or 'reinstall'.  You only need specify the type of device you are using and how to communicate with it.  This is done using environment variables.

MIB500/Parallel Port Programmers

This is the default programmer device.  No additional command line parameters need to be specified when using this programmer.

MIB510

Define: MIB510=<dev> where <dev> is the name of the serial port where the device is attached (i.e. /dev/ttyS0).

example:
      bash% MIB510=/dev/ttyS1 make install mica

AVRISP

Define: AVRISP=<dev> where <dev> is the name of the serial port where the device is attached (i.e. /dev/ttyS0).

example:
      bash% AVRISP=/dev/ttyS1 make install mica

EPRB

Define: EPRB=<host> where <host> is the DNS name or IP address of the EPRB device.

example:
     bash% EPRB=123.45.67.89 make install mica

 

Note that the defining a default programmer can also be done from the Makelocal file to eliminate having to retype it.

Device Addressing

The programming tools also include a method of programming unique node addresses without having to edit the TinyOS source code directly.  To set the node address during program load, use the following install syntax:

make [re]install.<addr> <platform>

where <addr> is the desired device address and <platform> is the target platform. Do not use the reserved values TOS_BCAST_ADDR (0xFFFF) or TOS_UART_ADDR (0x007E).

install - Compile the application for the target platform, set the address and program the device.

reinstall - Set the address and program the device ONLY (does not recompile). This option is significantly faster.


Tutorial Index