TinyOS Plugin for the Eclipse Platform

TinyDT Primer

We present a primer that guides the user through the initial setup of the TinyDT  development environment, which includes


It is assumed that Eclipse 3.1.0 (or later) is installed, and the TinyDT plugin set up correctly. Furthermore, TinyDT requires a working TinyOS installation (versions 1.1.0 through 1.1.14 are supported). Since TinyDT invokes the C preprocessor on the nesC source files in order to resolve C macros, the path to the C preprocessor execuatble (for all target platforms) needs to be set by the user.

Notice that Eclipse would not let you click OK until a valid executable is set for all platforms. If you never compile to an avr platform and you do not have avr-gcc installed, you may just specify here any executable (it would never be invoked, anyway).

Creating a new TinyOS project

Select File/New/Project... and select TinyOS/TinyOS Project from the project selector window. Click next to continue.

Creating anew project using the context menu

Enter the project name and select the project directory. As of now, we require that the project directory contain a working TinyOS installation. You should most probably unclick the "Use default" checkbox, and select the root of your TinyOS installation (i.e. the directory which contains apps, doc, tools, tos and a Makefile). After clicking "Finish" Eclipse will import the contents of the directory structure, which may take some time.

Specifying the application

The applications within a project can be specified through the project properties window. To add an application, select the "TinyOS Applications" tab, and click the "Add.." button.

The application is specified by its top level configuration. Let us use Blink as an example: in this case, the top level configuration is Blink.nc. This is the source file we select from the file selection window.

Specifying the target platform and sensor board, as well as additional search directories and compiler options, is done in the application properties window. Select the application from the list (Blink in our case), and click "Properties". Select your target platform from the list, set sendor board to none. Blink does not need any extra search directories, nor any compiler options (like defines).

Click OK on the application properties window, then click OK on the project properties window as well. If everything went fine, Eclipse should be building the workspace now, and you should see a progress bar in the bottom right corner of the Eclipse window.

Editor features

Beside context highlighting, one of the most powerful features of TinyDT is the TinyOS component view of the application.  The TinyOS view is open by default in the TinyOS perspective. To open it manually, use Window/Show view/Other and select TinyOS view from the list.

Double clicking elements in the TinyOS view opens up the corresponding file, and jumps to the corresponding code location. Notice that the hierarchy this view displays is specific to the actual application configuration, including the target platform, search paths and compiler settings.