Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

This is the exercise book accompanying the Embedded Rust Workshop. The Workshop provides exercises for Embedded Rust which run on the BBC micro:bit v2.

For these exercises, you only require the following hardware:

  • The micro:bit v2.
  • A Micro-USB cable to power the microbit while also connecting it to your computer.

This little educational board has everything we need to learn the practical side of embedded Rust, including:

  • A 5x5 LED matrix.
  • The LSM303AGR on-board motion sensor.
  • A serial connection accessible by a USB-CDC device

This device has even more features and external connectivity, and you can find all of this information on the micro:bit website.

Goals

After working through these exercises, you should have the following skills:

  • Extract relevant information from datasheets and/or schematics for firmware development.
  • Understand and work in embedded Rust code using the embassy asynchronous runtime, which includes using the async / await syntax.
  • Work with some components of a provided hardware abstraction layer (HAL) or board support package (BSP).
  • Learn the bare basics about embedded peripherals like GPIO, I2C and UART.
  • Schedule concurrent tasks using embassy.
  • Using embassy-time to perform delays and periodic operations or measure elapsed time.
  • Writing drivers for simple sensors
  • Exchanging telecommands and telemetry with an embedded firmware application using a client running on your computer.

Non-Goals

These exercises do not replace or provide a good theoretical foundation and also do not teach general Rust programming systematically. Furthermore, they do not replace a good foundation about embedded systems. We will still try to condense and teach the required embedded knowledge for completing the exercise in the materials. Low-level aspects like working with registers and details about system boot are intentionally skipped.

If you are a beginner in Rust and/or embedded systems, you can still work through this workshop but a lot of sections might be harder and/or confusing.

The next section provides some further material recommendations to address this.

Further Materials

If you are a beginner in Rust, it is strongly recommended to work through the Rust book or work through some other method of your choice to learn the general language.

The following materials might be valuable for you as well:

Preparation

We are going to start with the preparation of the software tools in the next chapter.