Get and compile a Contiki-NG firmware

 

Difficulty: Medium

 Duration: 20 minutes

Prerequisites: Configure SSH Access

Description: Contiki-NG is a real-time operating system designed for the Internet of Things (IoT). The aim of this tutorial is to understand how to setup your environment and how to compile a Contiki-NG firmware. Note that Contiki-NG can be used with IoT-LAB M3 and A8-M3 boards and others like nRF52DK and Zolertia Firefly.

    1. Setup your environment by cloning the iot-lab repository from GitHub
      ssh <login>@grenoble.iot-lab.info
      <login>@grenoble~$ git clone https://github.com/iot-lab/iot-lab.git
      Cloning into 'iot-lab'...
      ...
      <login>@grenoble~$ cd iot-lab
      <login>@grenoble:~/iot-lab$ make
      
        Welcome to the IoT-LAB development environment setup.
      
        targets:
      	setup-aggregation-tools
      	setup-cli-tools
      	setup-contiki
      	setup-iot-lab-contiki-ng
      	setup-iot-lab.wiki
      	setup-oml-plot-tools
      	setup-openlab
      	setup-riot
      	setup-wsn430
      	setup-zephyr
      
      
      	pull
    2. Setup Contiki-NG target
      <login>@grenoble:~/iot-lab$ make setup-iot-lab-contiki-ng
      make setup-iot-lab-contiki-ng
      git clone https://github.com/iot-lab/iot-lab-contiki-ng.git parts/iot-lab-contiki-ng
      Clonage dans 'parts/iot-lab-contiki-ng'...
      ...
      <login>@grenoble:~/iot-lab$ cd parts/iot-lab-contiki-ng
    3. Now that everything is in place, let’s build our first hello_world firmware.
      <login>@grenoble:~/iot-lab/parts/iot-lab-contiki-ng$ cd contiki-ng/examples/hello-world
      # For M3 nodes
      <login>@grenoble:~/iot-lab/parts/iot-lab-contiki-ng/contiki-ng/examples/hello-world$ ARCH_PATH=../../../arch make TARGET=iotlab BOARD=m3 savetarget
      # For A8-M3 nodes
      <login>@grenoble:~/iot-lab/parts/iot-lab-contiki-ng/contiki-ng/examples/hello-world$ ARCH_PATH=../../../arch make TARGET=iotlab BOARD=a8-m3 savetarget
      <login>@grenoble:~/iot-lab/parts/iot-lab-contiki-ng/contiki-ng/examples/hello-world$ ARCH_PATH=../../../arch make
      

 

  • The generated firmware is located in the build/iotlab/m3/ directory (eg. build/iotlab/a8-m3/ for A8-M3 nodes):
    <login>@grenoble:~~/iot-lab/parts/iot-lab-contiki-ng/contiki-ng/examples/hello-world$ ls build/iotlab/m3/
     hello-world.iotlab
    

    Use the .iotlab file to flash the nodes using the IoT-LAB tools (webportal or cli-tools)

 

Congratulations, you have completed the tutorial!