@tamme is speaking about the Rust Embedded Ecosystem at the online Rust on Embedded - Elektor Academy Pro Conference on 16 July 2025!
Early-bird tickets here: https://elektor.scoocs.co/public/event/rust-on-embedded (until 18 June)
@tamme is speaking about the Rust Embedded Ecosystem at the online Rust on Embedded - Elektor Academy Pro Conference on 16 July 2025!
Early-bird tickets here: https://elektor.scoocs.co/public/event/rust-on-embedded (until 18 June)
Curious about Rust on Embedded? Sign up for "Rust on Embedded", the upcoming online Elektor Academy Pro Conference on July 16th. Juraj Michálek from #Espressif will showcase #Slint, #BevyEngine and more running on Rust with no_std.
https://www.youtube.com/watch?v=N_PrevR02kU
👉 https://www.elektormagazine.com/news/rust-on-embedded-conference
Lol, why adding rust vec! in completely logical part of program separated from ADC readout is causing malfunction 0 ADC readout lmao
@diondokter's RustWeek talk 'Codegen your problems away - device-driver toolkit' was recorded and uploaded to YouTube. Watch it now: https://www.youtube.com/watch?v=xt1vcL5rF1c
I wrote some ST7789 screen driver Rust code which just takes bytes from memory and flushes them into the screen. It seems to work but somehow the screen turns completely white less than one second after the memory write operation. This used to work fine, so I was wondering if maybe some other driver was interfering with the SPI, but nope, I disabled everything else and it still does that. I wrote a small test program which uses a different library to speak to the ST, and it works just fine. I am probably doing something wrong somewhere, BUT THEN WHY WAS IT WORKING OK BEFORE? I suspect some weird timing issues. Or maybe my driver code is being optimized by the compiler somehow, and things are not being done in the correct order?
I will probably plug in a logic analyzer tomorrow, but if anyone has any tips on how to debug it...
I tried to run the embedded #rust tutorial on my old #microbit v1. It failed, probably some linker settings are wrong, because I got SIGINTs immediately after start. Then I tried #ada on the same board and most things we're working. I would like to do more with Rust, but #embeddedrust is sometimes absurdly painful.
has anyone coaxed the #rp2350 into using PSRAM with embassy-rs? I couldn't find an obvious example in my searches this morning. I did find some arduino startup code that I can probably translate and adapt, but if someone has already done the heavy lifting, that would save me some effort! #rust #embeddedrust #rustembedded #pico2
@orhun hi there! As a rustean, I love your project and it have inspired me to create a minitel based system. I have a question about Rust on ESP32 (I will read the dedicated book before starting the project). I haven't any experience with ESP32, so there is my question : is it possible to install your project will keeping the basic firmware of the Iodeo dongle?
Omar Hiari is now presenting "The five pillars of Embedded Rust" at Rust In Paris.
Oo, remember last week when I said I didn’t think I had a project I’d like to use to learn #rust?
I may have one - #EmbeddedRust on an #Arduino
Hm. I think I have the various bits around…
https://blog.logrocket.com/complete-guide-running-rust-arduino/
From: @rmartinnielsen
https://mastodon.social/@rmartinnielsen/113970296851975261
Watch: @tamme presents 'Chips don't bite!' at RustLab 2024, giving 'a fearless introduction to µController programming for Rustaceans'!
I'm struggling with some Rust confusion ... specifically, esp-hal::dma. How does one idiomatically allocate a DmaTxBuff in PSRAM? ... At this point, the compiler is happy, but the ESP32s3 just seems to hang.... All I want is some 800x480 display. Am I being greedy?
@tamme is at RustLab 2024 in Florence, and will present "Chips don't bite! A fearless introduction to µController programming for Rustaceans" this Sunday!
#RustLab2024 #RustLab #rust #rustlang #embeddedrust #rustprogramming
Getting Started with CH32V003 Firmware in Rust
I have been working on a small project using the WCH CH32V003 and thought it would be fun to make a version of the firmware for it in Rust. I started by having a look around for hardware support and getting started guides. As it turns out, there is a HAL and hardware support by the ch32-rs project. Also, the chip is also supported by probe-rs (also see other posts tagged probe-rs). However, when it came to getting started guides, I found little other than the examples folder in the ch32-hal project. So here we are. I’m going to rely heavily on that examples folder, but provide the step-by-step guide I was missing.
TL;DR
Here is my blinky example project: https://github.com/albertskog/ch32v003-blinky-rust.
Hardware
I used CH32V003F4P6-EVT-R0 development board and the WCH-LinkE programmer. The steps below should also work for other boards, programmers and even other CH32V chips, but I haven’t tested any.
On the CH32V003F4P6-EVT-R0, connect
to PD6
. This connects the pin to the actual LED so we can control it later.LED1
Between CH32V003F4P6-EVT-R0 and WCH-LinkE, connect:
to VCC
3V3
to GND
GND
to PD1
SWDIO/TMS
0. Install Tools
First, we need to install Rust. If you came here, you probably already have (or can figure out how to do so).
We are also going to use probe-rs for uploading the binary to the device. There are different options for installing it depending on your operating system, see https://probe.rs/docs/getting-started/installation/
I’m on a mac so I went with:
brew tap probe-rs/probe-rsbrew install probe-rs
1. Project Setup
I learned we need to use Rust Nightly for some of the crates to work. I created a new project and set it up to use Nightly:
cargo new ch32v003-blinky-rustcd ch32v003-blinky-rustrustup install nightlyrustup override set nightly
We also need the source for the standard libraries in order to build
later on:core
rustup component add rust-src
2. Add Configuration Files
We need a few different files to work with embedded devices.
The first is a target specification file. (Because Rust does not yet have built-in support for the RISC-V variant we need, RISCV32ec.) The file is called riscv32ec-unknown-none-elf.json
and should be placed in the root of the project. I borrowed this one from the examples folder of ch32-hal:
{ "arch": "riscv32", "atomic-cas": false, "cpu": "generic-rv32", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:32:32-i64:64-n32-S32", "eh-frame-header": false, "emit-debug-gdb-scripts": false, "features": "+e,+c,+forced-atomics", "linker": "rust-lld", "linker-flavor": "gnu-lld", "llvm-target": "riscv32", "llvm-abiname": "ilp32e", "max-atomic-width": 32, "panic-strategy": "abort", "relocation-model": "static", "target-pointer-width": "32"}
riscv32ec-unknown-none-elf.json
Next, we need a Cargo configuration file. Create a folder called .cargo
in the root of the project and in that folder, create a file called config.toml
. This time, I started with the examples file but simplified as much as I could. Note that if you use a different chip, you may need to change the runner command.
[build]target = "riscv32ec-unknown-none-elf.json"[target.riscv32ec-unknown-none-elf]runner = "probe-rs run --chip ch32v003"rustflags = ["-C", "link-arg=-Tlink.x"][unstable]build-std = ["core"]
.cargo/config.toml
Finally, we add some dependencies and profile settings to Cargo.toml
. The ch32-hal crate is not yet published, so we grab it directly from Github. Here, the chip used is selected as a feature. Qingke is the name of the RISC-V core used in the CH32V chips, if you were wondering. We also add some profile settings. Without these, I found the binary would not fit on the chip. It is possible to add them under a separate release profile as is done in the ch32-hal examples, but then we have to remember to add --release
when uploading. I found this to be easier.
[package]name = "ch32v003-blinky-rust"version = "0.1.0"edition = "2021"[dependencies]panic-halt = "1.0.0"ch32-hal = { git = "https://github.com/ch32-rs/ch32-hal", features = [ "ch32v003f4u6", ] }qingke-rt = "0.4.0"qingke = "0.4.0"embedded-hal = "1.0.0"[profile.dev]strip = falselto = trueopt-level = "s"
Cargo.toml
3. Write Main File
Now we should have everything set up in order to write our blinky program. Here is, again, a simplified version of the ch32-hal example program:
#![no_std]#![no_main]use hal::delay::Delay;use hal::gpio::{Level, Output};use ch32_hal as hal;use panic_halt as _;#[qingke_rt::entry]fn main() -> ! { let config = hal::Config::default(); let peripherals = hal::init(config); let mut led = Output::new(peripherals.PD6, Level::Low, Default::default()); let mut delay = Delay; loop { led.toggle(); delay.delay_ms(1000); }}
src/main.rs
I took out some SDI print statements which i found made the code not run on my device. The binary would upload but the LED would not blink and no messages were printed. If I figure out why, I might add another note here!
4. Run
To compile and upload, simply run
cargo run
Project Files
This little blinky project is available on Github as a boilerplate and for future reference:
https://github.com/albertskog/ch32v003-blinky-rust
Hope this was helpful! 🦀
Anyone looking for an #embedded engineer? Full time remote strongly preferred. #getFediHired
I am experienced with #EmbeddedC and, to a lesser degree, #EmbeddedRust and #EmbeddedJava. I even wrote JNI bindings for Java in Rust to call into Tock:OS. I have some recent experience with a very large C++ code base, but I wouldn't call myself an expert with it. I also have experience building test automation frameworks written in #Python and #Rust.
Oh, sorry for the edit spam. But I almost forgot to mention that I have extensive experience with the #RISCV architecture and instruction set.
Writing some Rust on a pico with embassy and thus async/await really does feel like a superpower...
Akira Moroo will now present "Firmware in Rust: More Than Just 'Rewrite It In Rust'"
FML the #SSD1306 crate is not ready for async and the #oledasync does only support 1309.
Finally i got #Embassy working on my #ESP32c6 in #NixOS. By now it should be over 95% reproducible. The last parts have to wait until i finished my day job.
The litte bugger now runs #EmbeddedRust #RustLang.
I will share the flake, which is mostly the oxilica/rust-overlay flake with the corrected toolchain and stuff like #RustAnalyzer and `cargo espflash`.