RIOT Tutorial
Intoducing embedded programming in C and Rust.
RIOT summit, 2024-09-05, Vienna
Brief intro
Tutorial by the RIOT community, images from Martine Lenders
Plan
- Short intro
- Embedded development
- RIOT OS
- Excercises on RIOT
- How-To
- Options
- Happy hacking
You?
Embedded systems
Embedded systems
Embedded systems: What we have
| PC |
embedded |
| CPU |
CPU |
| RAM |
less RAM |
| PCI express |
GPIO, SPI, I2C, PWM |
| video card, keyboard |
LED, accelerometer, servo |
| SSD |
built-in flash |
Embedded systems: How we talk
| PC |
embedded |
| Ethernet, WiFi, BLE |
+ 6LoWPAN, LoRA, … |
| IP |
IP |
| TCP, UDP |
UDP, TCP |
| HTTP, WebDAV |
CoAP, MQTT |
| HTML, JSON |
SenML, CBOR |
Embedded systems: Showtime
| PC |
embedded |
| > 100€ |
< 1€ |
| days in suspend |
years on coin battery |
| 2GLoC (Debian sid) |
500kLoC (RIOT) |
| may freeze for a moment |
real-time |
Embedded systems … running RIOT
RIOT OS: The OS
- Hardware abstraction
- Threads, IPC
- low-power support
- low latency
- real-time scheduler
… all in a few KiB of flash and RAM
RIOT OS: Network
- Standards
- Ethernet, WiFi, CAN, LoRA, 802.15.4, BLE
- IP (multiple), ICN
- CoAP, MQTT, SNTP
- Early adapters, research platform
Anatomy of a RIOT application
Rust applications on RIOT
- Add to Makefile
- Add Cargo.toml
- Code is in src/lib.rs
- Still built through make
Language choice
Tasks
- 01-hello-world: Just flash and see
- 02-timers: Loops to adjust, run code in interrupts
- 03-shell: Explore interactiveness
- 04-saul: Explore sensors and RGB LEDs
Tasks II
- Continue in sequence or seek around
- Exploring RIOT/examples/*? Make sure to make BOARD=feather-nrf52840-sense
- C: Many more examples.
- Rust: Example 5 can be run on different hardware.
Let's Play