Starting Point

A few kilobytes of RAM and non-volatile storage of at most 1 MB are prominent restrictions when working with a microcontroller on an embedded system. In addition, the clock most certainly is below 200 MHz, which means the firmware must be efficient. Predominantly C or sometimes C++ is used as the programming language of choice. Another implication of embedded systems is reliability. An electronic locking system runs for years without a reset and still has to perform its task without failure. The firmware therefore must be deterministic and memory safe. This is where C passes the responsibility to the developer. Void pointer casting, pointer management and memory freeing are error prone, leading to runtime errors. These errors are expensive to find and fix.

The solution for many of these problems might lie in a fairly new programming language. Rust is a system programming language focused on memory-safety and thread-safety at compile time [21]. Removing the chance for data races and a strong type system help to reduce runtime errors. Because Rust enforces its rules at compile time no overhead is added at runtime, which results in the same performance as code written in C/C++. Thread-safety might seem irrelevant on a single core microcontroller, but comes in use whenever an interrupt service routine is called.

With increasing complexity of an embedded system application it becomes harder to manage all tasks and resources. A real-time operating system (RTOS) helps to organize and synchronize them. It also allows scheduling tasks to a specific time in the future deterministically. As the number of native Rust RTOS is fairly limited, there is an opportunity to develop new Rust RTOS with a new concept.