Skip to content

aabadie/riot-apps

Repository files navigation

Sample applications using RIOT-OS

RIOT-OS

See https://github.com/RIOT-OS/RIOT for more information.

Prerequisites

All samples applications here have been tested with the following setup:

  • Developpement computer running Ubuntu 15.10, Wily Werewolf, 64bits. The login used for flashing the boards must be part of dialout and plugdev groups:
$ sudo adduser <login> plugdev dialout

There are a few package that needs to be installed on the Ubuntu developpement system.

  1. Common packages
$ sudo apt install build-essential g++-multilib openocd gtkterm
  1. AVR MCU
$ sudo apt install gcc-avr gdb-avr avr-libc binutils-avr
  1. ARM MCU Family
$ sudo apt install gcc-arm-none-eabi gdb-arm-none-abi binutils-arm-linux-gnueabi
  1. MSP430 MCU Family (but not tested yet)
$ sudo apt install gcc-msp430 mspdebug msp430-libc binutils-msp430

More information is available on the RIOT documentation : https://github.com/RIOT-OS/RIOT/wiki/Introduction#compiling-riot

Getting the code

We suppose all the code is located in ~/work.

  1. Clone RIOT code (or your fork)
$ cd ~/work
$ git clone [email protected]:RIOT-OS/RIOT.git
  1. Clone this repository (or your fork)
$ cd ~/work
$ git clone [email protected]:aabadie/riot-apps.git

Samples

This repository contains 5 self-documented sample applications:

  • The usual "Hello World" shows how to use the build system and display terminal
  • "Serial to serial" is a little more complex example showing how messages can be forwared from one UART interface to another UART interface. This example uses IPC and IRQ concepts of RIOT.
  • "Bluetooth module configuration tool" is a tool showing how to play with threads and the shell os RIOT-OS in order to configure a bluetooth module connected to one of the UART of a board.
  • "GPIO to serial" shows how to use the GPIO API. This application has only been tested on a SAMR21-xpro board and will require some adjustement to make it work on other boards (use different ports and pins).
  • "I2C temperature" shows how to use the I2C API to read the temperature on a sensor. The application is designed to work with a SAMR21-xpro and its Xplained extension, which provides the temperature sensor.
  • "I2C temperature 2" which is a variant of the previous one allowing to control on demand the read of the temperature sensor from the uart interface.
  • "Point to point network" which is an advanced sample application showing how to transfert data via udp other a wireless connection. It reuses parts of the serial to serial and I2C temperature examples.

Troubleshooting

  1. Build errors of type: undefined reference to 'i2c_init_master' (or any function from a module added in your Makefile with the FEATURES_REQUIRED variable): Verify that you don't have a read message displayed at the beginning of the build:
$ make RIOTBASE=~/work/RIOT BOARD=arduino-due
There are unsatisfied feature requirements: periph_i2c
EXPECT ERRORS!
[...]
main.c:62: undefined reference to `i2c_init_master'
...i2c_temperature/bin/arduino-due/i2c_temperature.a(main.o): In function `read_temperature':
...i2c_temperature/main.c:37: undefined reference to `i2c_read_bytes'
collect2: error: ld returned 1 exit status

I2C is not yet implemented on arduino-due, so you cannot use periph_i2c with this board.

  1. Spurious Build errors with module not related to the ones added in your Makefile: It's possible that you previously built your application with some modules and removed some of them after. Then the build system is still trying to build against them but they couldn't be found. The solution is to first clean the build in your application directory:
  $ make clean