Bare Metal Rust is a software developer’s view to the world of microcontrollers.
On Bare Metal Rust we learn to work in the space between operating systems and the hardware. We take an in-depth look into the smartest Rust tools available for creating platform drivers and embedded applications. We work with bits and bytes, pins and voltages, and interrupts and critical sections. In addition to learning about the ecosystem as a whole, we also delve in the actual work of programming a microcontroller by building several programs in the form of course challenges.
This year’s iteration builds on the premier implementation of Autumn 2020. While last year we had students writing small essays, this year is much more about real exercises and scaffolded programming work. Spoiler alert: the first challenge is ‘rustlings’, familiar to last year’s students. Former candidates are free to re-submit last year’s solutions 🙂
Besides being a primarily hands-on programming course, the course is built on the principles of extreme apprenticeship: model, scaffold, fade. On each week of the course, we create a mental model of our objectives by taking a new perspective on the subject matter. This new perspective is then supported by an exercise scaffold: a bi-weekly challenge published on Moodle. Each week builds on what was learned last week to support effective learning. While the challenges are not necessarily easy to everyone, the student is supported by course staff and a network of peers.
For a passing grade, each student must only complete the series of fully online challenges in Moodle (3 cr, a credits’ upgrade from last year), which may or may not be nationally available through Fitech. In parallel with the online implementation, the student may also choose to complete a free-form embedded course project for 1-2 credits on an agreed upon schedule. The only requirements for the embedded project are that it’s mainly written in Rust and without the facilities of a desktop operating system. Support for choosing an interesting project and its scheduling is provided on the course. We also have an exciting RISC-V development board available for use in student’s projects and practice.
Here’s a demo of an advanced project from last year:
Full source available (with a… permissive license…) at: https://github.com/teo3n/BMR_WirelessGame
This year’s topics are as follows:
– C, Rust, and embedded programming
– Basic embedded Rust skills
– The anatomy of a binary ELF: how to turn a Rust program into flashable binary for any processor
– From ‘just metal’ to RTOS: the embedded Rust stack
– Rust drivers in the wild: advanced control of systems on chip
– How to write a HAL-driver for your application?
I was thinking of finishing my dissertation, so despite this course being the most fun thing, we may or may not go on a break next year 😛 I’ll be working on Rust for embedded systems regardless. I recommend taking this implementation if you’re still considering.
Link to course brochure: https://sis-tuni.funidata.fi/student/courseunit/otm-80081dfb-63f8-41d3-8d73-141aef69e1af/brochure
–  Vihavainen, A., Paksula, M., & Luukkainen, M. (2011, March). Extreme apprenticeship method in teaching programming for beginners. In Proceedings of the 42nd ACM technical symposium on Computer science education (pp. 93-98).
–  Fitech. https://fitech.io/en/. However, our Fitech implementation is currently lost in bureaucracy, so it may or may not be currently available.
–  any := architectures specified at https://doc.rust-lang.org/rustc/platform-support.html. The course does also provide some ideas on how to create a binary that’s executable on non-supported platforms 🙂