in Contiki-Os, Electronics, General, Programming, Wireless Sensor Networks


  • macOS 10.13.5
  • VM – VirtualBox
  • Guest OS: Ubuntu 16.04

Setup Contiki on the local machine:

Install the following packages. you might need sudo right.

# sudo apt-get remove gcc-arm-none-eabi gdb-arm-none-eabi binutils-arm-none-eabi
# sudo add-apt-repository http://ppa:team-gcc-arm-embedded/ppa
# sudo apt-get update

Compile Contiki hello-world for Native:

Native means that your code will compile and run directly on your host PC.
for me, it will run on the Ubuntu 16.04 OS on the VM.

cd into your development folder.

# git clone
# cd contiki/examples/hello-world
# make TARGET=native
mkdir obj_native
  CC        ../../core/ctk/ctk-conio.c
  CC        ../../platform/native/./contiki-main.c
  CC        ../../platform/native/./clock.c
  CC        ../../core/dev/leds.c
### output truncated ###
  AR        contiki-native.a
  CC        hello-world.c
  LD        hello-world.native

The target command tells the compiler to compile for the current system.
This is what is later changed for cross compiling to our target platform.

Type the following command to run the hello-world program.

# ./hello-world.native
Contiki-3.x-3343-gbc2e445 started with IPV6, RPL
Rime started with address
MAC nullmac RDC nullrdc NETWORK sicslowpan
Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708
Hello, world

if this is how it worked! your compilation worked!

Compiling Contiki-OS for CC13xx

The only thing to be changed is the target. make clean is an important step.

make clean
make TARGET=srf06-cc26xx BOARD=sensortag/cc1350

this says the compilation works if you see the following:

CC ../../cpu/cc26xx-cc13xx/lib/cc13xxware/startup_files/ccfg.c
CC ../../cpu/cc26xx-cc13xx/./ieee-addr.c
AR contiki-srf06-cc26xx.a
CC ../../cpu/cc26xx-cc13xx/./fault-handlers.c
CC ../../cpu/cc26xx-cc13xx/lib/cc13xxware/startup_files/startup_gcc.c
CC hello-world.c
LD hello-world.elf
arm-none-eabi-objcopy -O ihex hello-world.elf hello-world.i16hex
srec_cat hello-world.i16hex -intel -o hello-world.hex -intel
arm-none-eabi-objcopy -O binary --gap-fill 0xff hello-world.elf hello-world.bin
cp hello-world.elf hello-world.srf06-cc26xx
rm hello-world.i16hex obj_srf06-cc26xx/fault-handlers.o obj_srf06-cc26xx/startup_gcc.o

This error absolutely means that the installation of the compiler for cross-compilation wasn’t successful.

/bin/sh: 1: arm-none-eabi-gcc: not found

Next step would be to compile with contiki-ng since, there is active development is happening there and to base all developments to that repo.

# git clone
# cd contiki-ng
# git submodule update --init --recursive

navigate to the hello-world example and hit the following

# make clean make TARGET=srf06-cc26xx BOARD=sensortag/cc1350




Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.


  • Clock synchronisation in systems communication – #akrv

    […] The application framework used will be Contiki-OS [7]. I will use the latest version that is on development which also supports the SensorTag board and the launchpad [8]. A toolchain setup and compilation of the Contiki-OS is done in this post. […]