-
Notifications
You must be signed in to change notification settings - Fork 57
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 anifndef
for detection if compiled with g++. Do:
#ifndef __cplusplus
typedef int bool;
#endif
-
contiki-2.4/platform/msb430/dev/msb430-uart1.h:73
: Removeextern
declaration ofuart_mode
anduart_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, setMSP430_JTAG
, e.g.:export MSP430_JTAG=/home/tbaum/apps/mspgcc/python/msp430-jtag.py
- Make sure your
mspgcc4/bin
directory is added to yourPATH
variable, if compiling for MSB or TelosB/Sky - Make sure your
avrgcc/bin
directory is added to yourPATH
variable, if compiling for MicaZ
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
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
(ifPORT
is not set,/dev/ttyUSB0
is default) -
make flash-jtag
flashes a node via parallel Olimex JTAG adapter (withmsp430-jtag.py
) -
make flash-micaz PORT=/dev/ttyUSB2
flashes a MicaZ mote viauisp
, connected to/dev/ttyUSB2
(again, default value ofPORT
is/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.