Get and compile firmware for M3 and A8-M3 nodes


Difficulty: Medium

 Duration: 20 minutes

Prerequisites: Configure SSH Access

Description: RIOT is an operating system designed for the particular requirements of Internet of Things (IoT) scenarios. The aim of this tutorial is to understand how to setup your environment and how to compile and use RIOT with M3 nodes. For these nodes, RIOT needs the toolchain arm-none-eabi-gcc. The frontend SSH servers site provide this toolchain, hence we can use it.

  1. Setup your environment
    ssh <login>@<site>
    <login>@<site>~$ git clone
    Cloning into 'iot-lab'...
    <login>@<site>~$ cd iot-lab
    <login>@<site>:~/iot-lab$ make
      Welcome to the IoT-LAB development environment setup.
  2. Setup RIOT target
    <login>@<site>:~/iot-lab$ make setup-riot
    make setup-riot
    git clone -b 2019.01-branch parts/RIOT
    Cloning into 'parts/RIOT'...
    <login>@<site>:~/iot-lab$ cd parts/RIOT
  3. We run a first example provided in parts/RIOT/examples/default. View and analyse the source code of this example.
    <login>@<site>:~/iot-lab/parts/RIOT$ cd examples/default
    <login>@<site>:~/iot-lab/parts/RIOT/examples/default$ cat
    <login>@<site>:~/iot-lab/parts/RIOT/examples/default$ cat main.c
  4. Load the required version of GNU ARM embedded toolchain in your current environment:
    <login>@<site>:~/iot-lab/parts/RIOT$ source /opt/riot.source

    RIOT requires a version of arm gcc >= 7, that’s why you’ll have to use this command each time you need to build a RIOT firmware on the IoT-LAB SSH frontend.

  5. Compile the example for M3 board target. The generated binary files are in parts/RIOT/examples/default/bin/iotlab-m3/
    <login>@<site>:~/iot-lab/parts/RIOT/examples/default$ BOARD=iotlab-m3 make all
    <login>@<site>:~/iot-lab/parts/RIOT/examples/default$ ls bin/iotlab-m3/
    ...  default.elf default.hex ...
  6. Compile the example for A8-M3 board target. The generated binary files are in parts/RIOT/examples/default/bin/iotlab-a8-m3/
    <login>@<site>:~/iot-lab/parts/RIOT/examples/default$ BOARD=iotlab-a8-m3 make all
    <login>@<site>:~/iot-lab/parts/RIOT/examples/default$ ls bin/iotlab-a8-m3/
    ...  default.elf default.hex ...