stm32-rs
rustc-perf
stm32-rs | rustc-perf | |
---|---|---|
8 | 26 | |
1,174 | 592 | |
2.2% | 0.0% | |
8.7 | 9.6 | |
7 days ago | 5 days ago | |
Python | Rust | |
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.
stm32-rs
-
STM32F4 Embedded Rust at the PAC: svd2rust
Developing code at the PAC, well, requires a PAC crate for the targeted controller. For the STM32 there exists a repo for all the supported PACs. These PACs are all generated using a command line tool called svd2rust. svd2rust grabs what is called an svd file and converts it into a PAC exposing API allowing access to peripheral registers. An SVD file is an Extensible Markup Language (XML) formatted file describing the hardware features of a device, listing all the peripherals and the registers associated with them. SVD files typically are released by microcontroller manufacturers.
-
Next Rust Compiler
In real world software, 99% of code is gluing preexisting lower-level functions together. In C/C++, the unsafe is implicit and needlessly covers everything. In Rust, the unsafe is only needed for the 1%.
You can safely implement a doubly-linked list in Rust, using unsafe, and that list can offer a safe interface so that the next higher level of code does not need to use unsafe. In fact, one doubly-linked list implementation that provides a safe interface is in the Rust standard library: https://doc.rust-lang.org/std/collections/struct.LinkedList.... . Most people do not rewrite std::list in C++ either.
Much of the Linux kernel really is the same: normal C code (maybe slightly more complicate than average userspace code, and definitely more carefully reviewed, but definitely not magic), that depends on extra carefully written lower level primitives that are _much_ more complicated internally than they appear from the outside (like the memory allocator, printk, RCU, etc.).
Rust is powerful enough to have libraries for register level access to micro-controllers (e.g. https://github.com/stm32-rs/stm32-rs), that encode moderately complex access rules safely in the type system (e.g. which specific set of bits is read-only or write-only, with which particular values (with nice human-readable names, even!), in which particular states of a state machine depending on other bits), all while allowing bypassing the restrictions with a simple unsafe keyword without even giving up on the nice API.
On the C/C++ side, I've used libopencm3, MBED, CMSIS, and everyone's favorite toy, Arduino. They're, in different ways, all much more mature and complete than anything Rust has today, but nothing comes even remotely close to Rust in terms of safety and long term potential.
-
NVIDIA Security Team: “What if we just stopped…
Packages: Where would I start with e.g. running Ada on a stm32? Resources are just a bit tough to find, and there's only a single stm32 package on Alire (which was inspired by cargo). But Rust has easy to find PACs and HALs for everything in the family, plus an official guide to setting up a project, including HIL debugging and unit testing on qemu, that takes about 15 minutes.
-
Cloning a Rare ISA Card to Use a Rare CD Drive
> (I threw out all my C/C++ books about 15 years ago - oops!).
The future is here for STM32: https://github.com/stm32-rs/stm32-rs
- Is there a database of peripheral implementations for different STM32 MCU parts?
-
Writing embedded firmware using Rust
Specifically these Rust register definitions are being auto-generated using SVD files published by the chip vendors (https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html). For stm32 for example there are the auto-generated register definitions: https://github.com/stm32-rs/stm32-rs and then the HAL layers on top that try to build easy to use tools on top of the registers (e.g. an SPI or USART type with write and read functions). e.g. https://github.com/stm32-rs/stm32f4xx-hal for the stm32f4xx line
-
Any frameworks in Rust for developing on SiFive / ST / NXP boards?
For STM32, check out the Peripheral Access Crates by the stm32-rs ream. For higher-level access, I wrote This HAL library for STM32. Works on most newer variants, and includes examples for specific peripherals, and simple applications.
-
CMSIS libraries
Patches: https://github.com/stm32-rs/stm32-rs/tree/master/devices
rustc-perf
-
Adding runtime benchmarks to the Rust compiler benchmark suite
> what do people use to run benchmarks on CI?
Typically, you purchase/rent a server that does nothing but sequentially run queued benchmarks (and the size/performance of this server doesn't really matter, as long as the performance is consistent), then sends the report somewhere for hosting and processing. Of course, this could be triggered by something running in CI, and the CI job could wait for the results, if benchmarking is an important part of your workflow.
But CI and benchmarks really shouldn't be run on the same host.
> What does the rust project use?
It's not clear exactly where the Rust benchmark "perf-runner" is hosted, but here are the specifications of the machine at least: https://github.com/rust-lang/rustc-perf/blob/414230abc695bd7...
> What do other projects use?
Essentially what I described above, a dedicated machine that runs benchmarks. The Rust project seems to do it via GitHub comments (as I understand https://github.com/rust-lang/rustc-perf/tree/master/collecto...), others have API servers that respond to HTTP requests done from CI/chat, others have remote GUIs that triggers the runs. I don't think there is a single solution that everyone/most are using.
- [rustc-perf] Runtime benchmarks got finally merged
-
Ask HN: Was programming more interesting when memory usage was a concern?
A lot of effort is spent to reduce the size of structs in the Rust compiler
https://nnethercote.github.io/2023/03/24/how-to-speed-up-the...
3% and 6% of improvement doesn't seem like much, but at the level of rustc those big wins
Performance of Rustc must be continously tracked (here https://perf.rust-lang.org/) because if you don't proactively fight against bloat, the tendency is that the code will become slower over time (due to new features etc)
-
Can Rust's compile time match its runtime performance?
hmm really really hard to answer :'), it's tradeoffs I think, no matter what you think Rust (cmiiw, I'm not qualified to say this) has (and probably in the future will adds more with guards on compiler metrics https://perf.rust-lang.org/) several phases that given the diffs to other language, might not available to any language compiler out there, if it's available I think rustc already did their best in here (some already being parallized etc etc, might be wrong since I can't refs any reference MRs, but it does exists though labels regarding this)
-
How to catch performance regressions in Rust
About a year ago I was looking for a tool like Rust perf for my application code. I did some research and found a lot of prior art. However, nothing checked all the boxes I was looking for, so I built Bencher!
- Rust – Are We Game Yet?
-
Next Rust Compiler
https://www.pingcap.com/blog/rust-compilation-model-calamity... is a good overview. In general it varies depending on the crate but we track the performance at https://perf.rust-lang.org/ - if you look at cargo, for example, over 60% of the time is spent in codegen through LLVM: https://perf.rust-lang.org/detailed-query.html?commit=222d1f...
- Data-driven performance optimization with Rust and Miri
-
Generic associated types to be stable in Rust 1.65
Something like https://perf.rust-lang.org/?
-
This Week in Rust #463
The performance full-report link is dead: https://github.com/rust-lang/rustc-perf/blob/master/triage/2022-10-04.md
What are some alternatives?
libopencm3 - Open source ARM Cortex-M microcontroller library
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
stm32-hal - This library provides access to STM32 peripherals in Rust.
glTF-Sample-Models - glTF Sample Models
stm32f4xx-hal - A Rust embedded-hal HAL for all MCUs in the STM32 F4 family
unreal-rust - Rust integration for Unreal Engine 5
probe-run - Run embedded programs just like native ones
rusty-dos - A Rust skeleton for an MS-DOS program for IBM compatibles and the PC-98, including some PC-98-specific functionality
hubris - A lightweight, memory-protected, message-passing kernel for deeply embedded systems.
RustPython - A Python Interpreter written in Rust
esp32 - Peripheral access crate for the ESP32
nanoserde - Serialisation library with zero dependencies