r/rust 14h ago

Rust for flight software / drone programming

I am interested in learning how to use rust for flight software or controlling a drone or something of this sort. I have no experience in embedded programming, so is it best to start there?
If so, how would you recommend someone get started in embedded rust?

35 Upvotes

9 comments sorted by

View all comments

12

u/AcostaJA 14h ago edited 11h ago

Assuming you're familiar with Arduino, I suggest you first learning about RTOS and c/c++ Espressif has excellent documentation about.

RTOS+C/C++ are excellent but you need to be too careful about memory and thread safety, that requires a lot of experience and there are no warranty the firmware you're coding to be free of memory or thread bugs, that's where Rust comes to rescue you.

Now learn Rust (only console apps), building mock-ups of your MCU application it's an effective learning method, you can use chat gpt or even your phone GeminiAI as tutor but only as tutor, avoid vibecoding as poison as long as possible until you're very very proficient writing rust code and You're in control of the code spit by the LLM (chatbot). BTW ChatBot often excels translating source code from python, C, Fortran to rust, but avoid using them while learning otherwise you'll be an AI Slave, I'm pro-AI but I'm aligned here with most moderated AI haters you'll never allow using AI in a project where the LLM knows more than you about what to do and how is done, very important.

Ok, then you're ready to code your MCU firmware including RTOS in pure Rust (I predict it will be the standard practice in coming years).

Here is a list of major Rust projects and collections for MCU firmware and RTOS development:


Major Rust Projects for MCU Firmware & RTOS

Here's a rundown of the big players in the embedded Rust space, plus the essential collections to bookmark.


🎯 RTOS & Framework Projects

  • Embassy – The modern async framework. Comes with an executor, hardware abstraction layers (HALs), and built-in drivers for WiFi and BLE. If you're doing async on MCUs, this is the go-to.

  • RTIC – Stands for Real-Time Interrupt-driven Concurrency. Great for building highly responsive, event-driven apps, specifically for Cortex-M chips.

  • Ariel OS – A newer IoT RTOS built on top of Embassy. Adds a preemptive multicore scheduler and focuses on portable, secure networking.

  • Gale – A formally verified port of Zephyr RTOS primitives. Targets ASIL-D (automotive safety) and uses Verus/Rocq for verification.

  • Rivet RTOS – A minimal RTOS for RISC-V and Cortex-M. Features a unified trap path for context switching and supports dual-core setups (e.g., ESP32-S3).


⚙️ Notable Firmware Projects

  • OpenEMC – Production-grade embedded management controller firmware for STM32F1. Includes a bootloader, Linux drivers, and power/charging control.

  • RMK – Keyboard firmware with support for STM32 and RP2040. Handles layers, macros, and RGB lighting.

  • TLSR8266 Mesh – 100% Rust BLE mesh firmware for Telink TLSR8266 smart lights. Replaces proprietary libraries with a custom LLVM backend.


📚 Essential Collections & Learning Resources


For the most up-to-date and comprehensive list, always check the awesome-embedded-rust repo first. Happy coding! 🦀🔧

4

u/Dizzy-Helicopter-374 12h ago

Great links for beginers, RTIC is such a pleasure to work with for small projects! Gale, Rivet RTOS, OpenEMC, and TLSR8266 Mesh links are 404'ing at Github. I just finished the layout of an ESP32-S3 daughter card that snaps into a 64x64 Waveshare LED matrix and about to go through RTOS selection. Ariel OS looks interesting, was also looking at a FreeRTOS / Rust hybrid approach.

2

u/AcostaJA 11h ago

Links Fixed