See https://github.com/RIOT-OS/RIOT for more information.
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
andplugdev
groups:
$ sudo adduser <login> plugdev dialout
- Tested boards:
- AVR MCU Family:
- ARM MCU Family:
There are a few package that needs to be installed on the Ubuntu developpement system.
- Common packages
$ sudo apt install build-essential g++-multilib openocd gtkterm
- AVR MCU
$ sudo apt install gcc-avr gdb-avr avr-libc binutils-avr
- ARM MCU Family
$ sudo apt install gcc-arm-none-eabi gdb-arm-none-abi binutils-arm-linux-gnueabi
- 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
We suppose all the code is located in ~/work
.
- Clone RIOT code (or your fork)
$ cd ~/work $ git clone git@github.com:RIOT-OS/RIOT.git
- Clone this repository (or your fork)
$ cd ~/work $ git clone git@github.com:aabadie/riot-apps.git
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.
- Build errors of type:
undefined reference to 'i2c_init_master'
(or any function from a module added in your Makefile with theFEATURES_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.
- 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