rtic
cortex-m
Our great sponsors
rtic | cortex-m | |
---|---|---|
14 | 6 | |
1,589 | 735 | |
4.3% | 3.0% | |
8.8 | 7.1 | |
7 days ago | 14 days ago | |
Rust | Rust | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
rtic
-
Is rust used for microchip coding?
There's also RTIC which is another framework that makes concurrency trivial.
- Would generators be useful for embedded?
-
Are there universities that teach Rust?
At Telecom Paris, one of the top engineering schools in France, we teach Rust to undergraduate and graduate students who specialize in Embedded Systems. They get to use Rust and RTIC on STM32 based boards, and they also use Embassy for some projects.
-
In which circumstances is C++ better than Rust?
RTIC is still going strong, they are working on a 2.0 release at the moment :). There's also now embassy which provides an async runtime (and a ton of other nice things) for embedded as well :)
-
eskarp: Custom design using ergogen, 3D printed case, RP2040 with Rust firmware
RTIC - RTOS and task scheduling
-
My negative views on Rust
That's completely incorrect. The existing ecosystem focuses on web/IO because that's were Async/Await is already being used in other languages so everyone started there. There is significant interest in writing frameworks using async rust in embedded, but the required compiler features for it are still not stable. Check out embassy. Even RTIC has experiments with async.
-
Question: Elegant way of getting a 'static reference?
But neither of them might be usable in you case. Since it looks like you're running bare-metal, a framework like RTIC can give you a initialization function and then pass "static" data to a struct that is shared between all tasks.
-
Is crate Drone already dead? Are there any alternatives? rtfm?
FYI, RTFM has been renamed to RTIC
-
My first embedded project: OpenEMC -- an embedded management controller written in Rust
The GPLv3 firmware is written in Rust using RTIC while the Linux drivers are implemented in C.
-
Multitasking to Arduino
In Rust there is https://embassy.dev which is an async Rust framework for embedded. It has been shipping in products for years. Can be made real-time (for some definitions of it).
There is also RTIC https://rtic.rs which is a concurrency framework for real-time systems using interrupts. IIRC the car industry is interested in it.
cortex-m
-
Rust fact vs. fiction: 5 Insights from Google's Rust journey in 2022
I do not have as strong of feelings as your parent, but:
1. A lot of the APIs make use of the typestate pattern, which is nice, but also very verbose, and might turn many people off.
2. The generated API documentation for the lower level crates relies on you knowing the feel for how it generates the various APIs. It can take some time to get used to, especially if you're used to the better documentation of the broader ecosystem.
3. A bunch of the ecosystem crates assume the "I am running one program in ring0" kind of thing, and not "I have an RTOS" sort of case. See the discussion in https://github.com/rust-embedded/cortex-m/issues/233 for example.
- Advisory: Miscompilation in cortex-m-rt 0.7.1 and 0.7.2
-
Any frameworks in Rust for developing on SiFive / ST / NXP boards?
For cortex-m support, check out the cortex-m crate
-
A GPIO Driver in Rust
I don't think so. Once a function is compiled, it basically becomes a black box with a type signature so unless sleeping in a function affects its signature, that information is erased. If you pass in some kind of a sleep token that has to be used to sleep, then yeah I think you could enforce it by only being able to get that token in a non-atomic context and making it leak proof.
The Cortex-M crate does something similar, but for proving that you are in an atomic context. Another function that expects a CriticalSection type is then assured that it's running without interrupts enabled.
https://github.com/rust-embedded/cortex-m/blob/master/src/in...
- Would it be possible to run Rust on the new Raspberry Pi Pico?
What are some alternatives?
embassy - Modern embedded framework, using Rust and async.
tock - A secure embedded operating system for microcontrollers
avr-hal - embedded-hal abstractions for AVR microcontrollers
nettu-scheduler - A self-hosted calendar and scheduler server.
cortex-m-rt - Minimal startup / runtime for Cortex-M microcontrollers
cortex-m-quickstart - Template to develop bare metal applications for Cortex-M microcontrollers
pico-examples
wyhash-rs - wyhash fast portable non-cryptographic hashing algorithm and random number generator in Rust
stm32-hal - This library provides access to STM32 peripherals in Rust.
stm32-rs - Embedded Rust device crates for STM32 microcontrollers
blisp - A statically typed Lisp like scripting programming language for Rust.
zero-copy-pads - Padding/aligning values without heap allocation