-
Notifications
You must be signed in to change notification settings - Fork 55
Generic wiselib application contiki
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.
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 anifndeffor detection if compiled with g++. Do:
#ifndef __cplusplus
typedef int bool;
#endif
-
contiki-2.4/platform/msb430/dev/msb430-uart1.h:73: Removeexterndeclaration ofuart_modeanduart_lockcntDo://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_PATHto your local copy, e.g.:export CONTIKI_PATH=/home/tbaum/develop/sensor-os/contiki-2.4 - If
msp430-jtagshould be used for flashing with the parallel Olimex JTAG adapter, setMSP430_JTAG, e.g.:export MSP430_JTAG=/home/tbaum/apps/mspgcc/python/msp430-jtag.py - Make sure your
mspgcc4/bindirectory is added to yourPATHvariable, if compiling for MSB or TelosB/Sky - Make sure your
avrgcc/bindirectory is added to yourPATHvariable, if compiling for MicaZ
There are currently three make targets supported for Contiki:
-
make contiki_skycompiles for TelosB/Sky motes -
make contiki_msbcompiles for ScatterWeb MSB nodes -
make contiki_micazcompiles for MicaZ motes
When compilation has successfully finished, the program can be brought to the nodes. There are different targets available
-
make flash-sky PORT=/dev/ttyUSB1flashes TelosB/Sky nodes at/dev/ttyUSB1(ifPORTis not set,/dev/ttyUSB0is default) -
make flash-jtagflashes a node via parallel Olimex JTAG adapter (withmsp430-jtag.py) -
make flash-micaz PORT=/dev/ttyUSB2flashes a MicaZ mote viauisp, connected to/dev/ttyUSB2(again, default value ofPORTis/dev/ttyUSB0)
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.