r/programming • • 8h ago

Embedded Rust from Scratch

https://rodrigodd.github.io/2026/12/05/rust-embedded-from-scratch.html

I recently got a small microcontroller, and I thought it was a good opportunity to learn more about how ARM-based microcontrollers work under the hood and how Rust works on embedded devices. In this blog post, I go over how to implement a very basic example application in Rust from scratch, covering everything from runtime initialization to how to build memory-safe abstractions for peripherals.

Hopefully, preexisting knowledge of Rust or embedded development is not required to follow the post.

5 Upvotes

2 comments sorted by

View all comments

2

u/suda50 6h ago

I skimmed your post and it looks great. I didn’t see any mention of the Embedded Rust Book. It looks like it goes over a lot of the same topics as your post. Did you use that as a reference?

1

u/Rodrigodd_ 3h ago

I mention it at the very end of the post, as well as the Embedonomicon, which also covers a good chunk of what I covered in the post, although I only found out about it halfway through writing the post.

I didn't use them as references, at least not directly. I wrote each section of the post as I researched and implemented it in code, focusing more on the microcontroller datasheet and the ARM Cortex-M0+ Manual as source, although I did read snippets of the book and the code for crates like cortex-m-rt.