Skip to content

Generic wiselib application contiki

Dimitrios Amaxilatis edited this page Jul 22, 2013 · 1 revision

Basic Requirements

Before compiling your first application, the appropriate paths must be set. Therefore the file

wiselib/applications/Makefile.template

must be copied to

wiselib/applications/Makefile.local

and the paths for the platforms to be used for compilation must be adapted.

Without an existing Makefile.local (see above), it is not possible to compile any application in the applications folder!

Once this is done, change to

wiselib/applications/example_app

There is already a Makefile included, so that you only need to call

make contiki_sky

for example.

Preparing the Environment

The latest tests have been done with mspgcc-4.4.4 and Contiki 2.4 . When compiling Contiki for Scatterweb MSBs, a few modifications must be done:

  • contiki-2.4/platfor/msb430/contiki-conf.h:55: Add an ifndef for detection if compiled with g++. Do:
      #ifndef __cplusplus
        typedef int bool;
      #endif
  • contiki-2.4/platform/msb430/dev/msb430-uart1.h:73: Remove extern declaration of uart_mode and uart_lockcnt Do:

    //extern volatile unsigned char uart_mode; //extern volatile unsigned char uart_lockcnt;

There is already modified version of Contiki 2.4 available:

In addition, a pre-compiled (on a Debian system) version of mspgcc 4.4.4 can be downloaded here:

Finally, the appropriate paths must be set:

  • In your Makefile.local, set CONTIKI_PATH to your local copy, e.g.: export CONTIKI_PATH=/home/tbaum/develop/sensor-os/contiki-2.4
  • If msp430-jtag should be used for flashing with the parallel Olimex JTAG adapter, set MSP430_JTAG, e.g.: export MSP430_JTAG=/home/tbaum/apps/mspgcc/python/msp430-jtag.py
  • Make sure your mspgcc4/bin directory is added to your PATH variable, if compiling for MSB or TelosB/Sky
  • Make sure your avrgcc/bin directory is added to your PATH variable, if compiling for MicaZ

Compile Application

There are currently three make targets supported for Contiki:

  • make contiki_sky compiles for TelosB/Sky motes
  • make contiki_msb compiles for ScatterWeb MSB nodes
  • make contiki_micaz compiles for MicaZ motes

Flash Application

When compilation has successfully finished, the program can be brought to the nodes. There are different targets available

  • make flash-sky PORT=/dev/ttyUSB1 flashes TelosB/Sky nodes at /dev/ttyUSB1 (if PORT is not set, /dev/ttyUSB0 is default)
  • make flash-jtag flashes a node via parallel Olimex JTAG adapter (with msp430-jtag.py)
  • make flash-micaz PORT=/dev/ttyUSB2 flashes a MicaZ mote via uisp, connected to /dev/ttyUSB2 (again, default value of PORT is /dev/ttyUSB0)

Known Bugs

With the current (and also with all known older versions) mspgcc version, there is a problem when templates get too many template parameters (resulting in linker errors "undefined reference ..."). However, the bug is already identified, and a workaround given in the corresponding [bug tracker entry] (https://sourceforge.net/tracker/?func=detail&atid=1177287&aid=3177314&group_id=277223) - the above downloadable MSPGCC version already contains the workaround.

Clone this wiki locally