u/Independent_Egg_630

Image 1 — Embedded Rust Software development environment setup
Image 2 — Embedded Rust Software development environment setup

Embedded Rust Software development environment setup

To help people to get the best out of the code examples in my book (Manning), I have just written a summary of all of the various tools and configuration steps needed to do some embedded Rust development.

This include setting up cross-compiling targets, Arm embedded tool-chain, QEMU, gdb-multiarch, OpenOCD, probe-rs, st-link tools, serial communication tools, PICSimLab, and all that jazz. This setup can be use as a base for any embedded Rust development although currently its assuming that you are using a Cortex-M based MCU and Ubuntu as an OS. I hope this might help some of you getting started.

https://github.com/dcabanis/Embedded-Software-With-Rust-Book/blob/main/embedded-rust-ubuntu-setup.md

u/Independent_Egg_630 — 2 days ago
▲ 52 r/learnrust+1 crossposts

Wrote a book on embedded Rust based on years of teaching the language, looking for learner feedback on the early chapters.

I teach Rust at a training company called Doulos. Two courses, one on the fundamentals and one on embedded systems, both running for about six years now. After enough engineers come through those classes you start to notice the same problems coming up, often not the things the books and tutorials spend most of their time on. That eventually became a book, and Manning have just put the first four chapters on early access.

It's called Embedded Software with Rust. Now, embedded is a fairly niche thing in this sub, so I should be honest about who this is for: the book assumes you already know some embedded C or C++. If Rust is your first systems language and microcontrollers aren't on your radar, this isn't the book for you, and I'd rather say so than have anyone spend money on something that doesn't fit.

The reason I'm posting here anyway is that some of what the early chapters cover comes up for any Rust learner eventually. What no_std actually means. Why the toolchain looks the way it does. How a Rust program starts up before main() runs at all. Several students over the years have told me that working through embedded examples is what finally made Rust's design decisions make sense to them.

What I'd find useful from this sub: if you've tried embedded Rust and bounced off it, or wanted to try and didn't know where to start, tell me what would have helped. The unwritten chapters are easier to reshape than the ones already through editing, and that's the entire reason MEAP exists.

reddit.com
u/Independent_Egg_630 — 6 days ago

Writing an embedded Rust book, MEAP just went live, looking for feedback from people actually doing this work.

I've been working on a book called Embedded Software with Rust with Manning, and the first four chapters went live on MEAP this week. I'm not posting this to sell you anything (the discount at the bottom is incidental). I'm posting because MEAP exists for a specific reason: the book isn't finished, and the feedback I get during the early access window is what fixes things while there's still time to fix them.

Some context. The material grew out of two Rust courses I've developed and been teaching at Doulos for the last six years, one on the fundamentals of the language and one on embedded systems. Many cohorts of engineers have been through those classes, mostly people with deep embedded C or C++ backgrounds who were trying to work out where Rust actually helps them and where it just gets in the way. The book is structured around the questions those students kept asking, more or less in the order they kept coming up.

The four chapters available now:

  1. Why embedded Rust now, including the regulatory angle (UNECE, NIS), which I think gets less attention in the Rust community than it deserves
  2. Setting up the toolchain: rustup, cargo, GDB, OpenOCD, probe-rs, the Knurling tools
  3. Project structure from scratch — Cargo.toml, memory.x, linker scripts, PACs and HALs, without leaning on a runtime crate to hide it all
  4. Bare-metal startup, the vector table, and safe interrupt handling in no_std

Coming next: memory-mapped I/O and register abstractions, peripherals, async, debugging, and production-readiness.

What I'd actually like from this community:

If you've read the early chapters, tell me what I got wrong, or what I glossed over that deserves more space. If you haven't read them yet but might, tell me what topic in your day-to-day embedded Rust work you wish someone had explained well when you started. I would rather rework a planned chapter now than figure out after publication that I missed the obvious thing. And if there's a board, an MCU family, or a workflow conspicuously absent from the outline above, say so. The Cortex-M and RISC-V focus is fixed, but everything inside that is still up for negotiation.

Questions about the book, the writing process, or how MEAP works as a format, fire away in the comments.

Manning is running 50% off site-wide until May 28. Link in the comments rather than the post body, in case the autofilters care.

reddit.com
u/Independent_Egg_630 — 6 days ago