Evaluation of Rust usage in space applications

Rust safety features and its growing usage make this programming language a viable option in the space sector. This activity is to push the state of the art by taking a first step in creating a real-time operating system in Rust dedicated to safety-critical space systems. The design of the system will focus on simplicity, portability, low memory footprint, and will be based on the mature features of the Rust language to contribute to a robust flight-software development ecosystem. In order to achieve these goals, its scheduler will execute tasklets instead of traditional threads. Tasklets are fine-grained units of execution which can be used to share stack, avoid context switches and provide constrained concurrency patterns which may be more predictable than the ones which can be created using traditional threads. Their concept fits nicely with the constraints enforced by Rust and formalizes the patterns already used in flight-software and MBSE solutions such as TASTE.

The proposed activity is to evaluate the usage of Rust programming language in space applications, by providing an RTOS targeting ARM Cortex-M7 SAMV71 microcontroller, a BSP (Board Support Package) and a Demonstration Application. RTOS will be implemented in the form of an tasklet executor instead of a classic scheduler. The enforced concurrency pattern will be compliant with patterns observed in flight-software developed by N7S (e.g., PROBA3 Payload ASW or ARM BSW for SAMV71) and MBSE solutions such as TASTE. Basic functionality required to create a working system will be provided – tasklet priorities, recurring and time-based execution, as well as communication facilities such as queues and events. Additionally, execution time statistics will be reported to facilitate scheduling analyses and discovery of real-time related issues.

Creating a real time operating system will validate in practice Rust features mentioned in the section above, evaluate Rust viability in space applications and additionally check compatibility with ECSS software development process. The created operating system will be released as open source, on MIT/Apache dual license.

Main focus of the BSP part of the project will be to provide a minimal set of functionalities for peripherals required to create the RTOS and interact with the board as well as example sensors. The scope of the BSP includes SysTic, WDT, SCB, NVIC, PMC, FPU, XDMAC, PIO, UART and SPI.

In the second part of the activity, a small demonstration application software will be developed, providing a minimal feature-set representative of a CubeSat class project – UART communication, mode management and sensor handling. This demonstration will provide input to a Lessons Learned report, describing the encountered issues, potential problem and improvement areas, usage recommendations and proposed way forward.

Disclaimer: This work performed during this project was carried out under a programme of, and funded by, the European Space Agency. The views expressed here can in no way be taken to reflect the official opinion of the European Space Agency.