Exploring Embedded Rust - Part 1
Published: 2020-01-14 21:50:21

---
title: Exploring Embedded Rust - Part 1
published: true
date: 2020-01-14 00:00:00 UTC
tags: 
canonical_url: 
---

Coming from a web development background, lower level things can sometimes feel veryforeign, especially when your code only ever runs in a languages VM.

I was in the audience for James Munns’ ([@jamesmunns](https://github.com/jamesmunns)) [talk about EmbeddedDevelopment](https://www.youtube.com/watch?v=RIHVoNDxNuk) at the Berlin Rust meetup last year. At the time of thiswriting that was 9 months ago and I’ve now decided to give embedded developmenta try. I’m going to write this post as I go along.

Since I don’t really have a project that I want to work on, my initial goal isto find out how it is like to work on embedded systems and how approachable thedocumentation is. I’ve worked with a Rasperry Pi briefly and got an LEDblinking, but that was 5 years ago, [using Processing](https://processing.org/).

## Getting Started

Searching the internet for ‘rust embedded book’ gave me [therust embedded book](https://rust-embedded.github.io/book/intro/index.html) as a result. Before going through this bookthough, I’ll re-watch James Munns’ talk and make some proper notes of it.

[![screenshot](http://phansch.net/assets/images/posts/2020/life-before-main-notes.jpg)](/assets/images/posts/2020/life-before-main-notes.jpg)

With the notes done, it’s time to grab another coffee and start reading thebook. The ‘Assumptions and Prerequisites’ section makes me think that I’m notthe perfect target audience for this book, because apart from the Rasperry Pi,I’ve never debugged any embedded system.

Luckily I found the [Discovery book](https://docs.rust-embedded.org/discovery/index.html) via the bookshelf which islinked in the table on the first page. It seems that this is the book one shouldwork through first. I’ve [opened a PR](https://github.com/rust-embedded/book/pull/219) to mention the discovery book a bit moreprominently.

As it seems like the discovery book works with the hardware immediately, I’mgoing to jump back to the [QEMU section of the embedded book](https://rust-embedded.github.io/book/start/qemu.html). Once myhardware arrives I’ll return to the discovery book.

Following the installation instructions worked without problems. It seems likethe majority of the tooling so far consists of QEMU, GDB and only a handful of cargocrates.

## Hardware!

[![screenshot](http://phansch.net/assets/images/posts/2020/discovery.jpg)](/assets/images/posts/2020/discovery.jpg)

My device arrived and following the included instructions worked withoutproblems until I tried using the USB interface. It turned out that my old MiniUSB cable didn’t work. I’m not sure why but I think it might be because itdoesn’t support data transfer.

I went to the local electronics store, bought a new one and [opened anotherPR](https://github.com/rust-embedded/discovery/pull/201) to mention the data transfer requirements for the cables.After that I also opened another [issue](https://github.com/rust-embedded/book/issues/220) which proposes aGlossary for the embedded book. I’m hoping to get to that by the end of January,unless someone else is faster.

I think this is a good point to wrap up this post as I won’t be able to get backinto it for a few days. In the next post I’m going to try writing my first embeddedRust program following the discovery book.