This tutorial is based on TinyOS 2.1.0 version. It assumes that your TinyOS environment is correctly set up. If not, please first have a look to this TinyOS tutorial.

We are going to compile the RadioCountToLeds TinyOS example for TelosB. This program broadcasts a 4Hz counter value (every time it changes). When a node is in RX mode and received a valid packet that contains a counter value, it displays the lowest three bits on its leds.

Go to the RadioCountToLeds folder and compile it for TelosB platform:

$cd ./apps/RadioCountToLeds/
$make telosb

The main.exe binary program is generated into the .apps/RadioCountToLeds/build/telosb folder. You can use it with WSim by renaming it into a *.elf file.

However TinyOS examples programs are compiled without debug infos, so if you proceed as previously, you won't be able to use the debugger with WSim.

To avoid this drawback, you just have to compile manually with mspgcc the Nesc generated app.c file, which has been created in the ./apps/RadioCountToLeds/build/telosb/ folder :

$msp430-gcc app.c -mmcu=msp430x1611 -g -o radiocounttoleds.elf