RIOT is an open-source microkernel-based operating system, designed to match the requirements of Internet of Things (IoT) devices and other embedded devices. These requirements include a very low memory footprint (on the order of a few kilobytes), high energy efficiency, real-time capabilities, support for a wide range of low-power hardware, communication stacks for wireless and communication stacks for wired networks.
RIOT provides a microkernel, multiple network stacks, and utilities which include cryptographic libraries, data structures (bloom filters, hash tables, priority queues), a shell and more. RIOT supports a wide range of microcontroller architectures, radio drivers, sensors, and configurations for entire platforms, e.g. Atmel SAM R21 Xplained Pro, Zolertia Z1, STM32 Discovery Boards etc. (see the list of supported hardware. Across all supported hardware (32-bit, 16-bit, and 8-bit platforms). RIOT provides a consistent API and enables ANSI C and C++ application programming, with multithreading, IPC, system timers, mutexes etc.
IntroductionIn this practice we will use in a very simple way the RIOT OS, using a BastWAN board and a JLink EDU for the programming of the board. In addition to the initial configuration of RIOT OS for ARM devices on Linux.
ProcessConsiderations
RIOT OS can only run on systems such as Linux/FreeBSD/OSX. On operating systems like windows it is not possible to use RIOT for our embedded devices, yet.
Go to terminal and write:
- sudo apt-get update
- sudo apt-get update
Install dependencies
- sudo apt-get install build-essential git make gcc pkg-config autoconf automake libtool libusb-dev libusb-1.0-0-dev libhidapi-dev libftdi-dev g++-multilib gcc-multilib python3-serial cppcheck curl doxygen graphviz pcregrep python python3 python3-flake8 unzip wget
Clone repository of RIOT OS
- git clone git://github.com/RIOT-OS/RIOT.git
Install ARM toolchainDownload "arm-none-eabi-gdb" which is included on the "gcc-arm-none-eabi" from ARM Developer
Linux Exception
Linux users will need to download the pre-compiled version instead of "apt-get install arm-none-eabi" in order to get the arm gdb
Install JLink software to linux
https://www.segger.com/downloads/jlink/
There are two ways to install the J-Link software, by the Ubuntu installer and by terminal commands.
Once the Jlink software is installed, open a terminal and go to the folder where the jlink is located.
In my case it is: PC:/opt/SEGGER/JLink_V756a
Inside the folder we write the command "ls" and look for the file "JFlashLiteExe", we execute the file with./JFlashLiteExe.
And this opens a tab where we choose the microcontroller we are using, in this case the BastWAN uses an ATSAMR34J18, and we use a SWD protocol and a baud rate of 4000 kHz.
A new window opens from where the bin file will be added and the previous program will be deleted from the board.
Open a new terminal and go to the RIOTOS repo examples
Look for blinky and move to that folder
Inside the blinky folder, type the command “make all BOARD= bastwan” and wait for the code to compile.
A file with extension ".bin" was created and this file is used to program our BastWAN.
We return to the JFlash lite window and click on “erase chip”.
We load the ".bin" file to flash it on the board.
The address where we find the file depends on where we store the RIOT repo, after the RIOT folder the address is /RIOT/examples/blinky/bin/bastwan
The address where we find the file depends on where we store the RIOT repo, after the RIOT folder the address is /RIOT/examples/blinky/bin/bastwan
After selecting the ".bin" file, click on the "Program Device" button.
Once the program has been downloaded to the BastWAN, press the reset button twice in quick succession on the board and the integrated LED on the BastWAN will start flashing.
We return to the terminal from where we compiled the program and type the command "make term". And we will see how the code runs in the terminal.
This concludes the small and simple tutorial on how to use RIOT OS on the BastWAN board. Remembering that in the official RIOT OS documentation you can find which chips you can use it with, if you don't have a BastWAN board.
If you want to know more about RIOT OS you can consult the documentation of its official website "https://doc.riot-os.org/index.html"
.
And about the BastWAN board you can get it from the Electronic Cats page "https://electroniccats.com/store/bastwan/"
.
and for more information about the board you can check the github wiki "https://github.com/ElectronicCats/BastWAN/wiki”
.
Comments
Please log in or sign up to comment.