• News

news

Ferrous Systems and Espressif’s Rust Training on ESP32

Reporting from Shanghai, China
Mar 31, 2022

ESP Rust Board to be used along with Ferrous Systems and Espressif’s training material for Rust on ESP32.

Rust is currently becoming popular in embedded systems, and the support for ESP32 is being developed by Espressif and the ESP-RS community. To consolidate this trend, Espressif and Ferrous Systems are preparing a complete training program for developers using ESP32. The training introduces the Rust language by focusing on IoT applications in a straightforward way that is suitable for new and experienced embedded developers alike.

Training Content

In fact, the training material is an online workbook which can be used either for group training or for self-study. It contains programming exercises that can be used as a starting point for personal projects after the course. The workbook is divided into different sections which correspond to the respective level of experience, ranging from beginner to advanced. The exercises provide help in the form of hints and step-by-step guides to their solution, as well as example solutions. Troubleshooting pages, then, help solving problems that occur during the set up.

More specifically, the training material is divided into an introductory section and an advanced one. The introductory part is for people interested in exploring the IoT capabilities of an ESP32 dev board, or for people who are new to embedded programming and embedded Rust, in particular. It focuses on setting up a project and letting the board interact with the outside world, using higher level abstractions for HTTP and MQTT, while taking advantage of using Rust's standard library on an embedded device.

The introductory part contains the following topics:

    1. Setting up a project with cargo generate.
    2. Writing an HTTP client.
    3. Writing an HTTP server.
    4. Writing an MQTT client that:
      • publishes sensor data
      • receives commands via a subscribed topic.

The advanced section is targeted at people with basic knowledge in embedded programming, who are interested in exploring lower-level peripheral access, reading and writing into registers, learning about interrupt-handling in embedded Rust on ESP32-C3, while taking an excursion into [no_std] Rust and driver writing.

It covers the following skills:

    1. Reading the temperature and humidity sensor via I2C.
    2. Reading the IMU via the same I2C bus.
    3. Introduction to the I2C driver.
    4. Handling an interrupt with a button.

This part will be fully available when the ESP Rust board is released.

Prerequisites & Materials

    1. Basic Rust knowledge. Read, for example, The Rust Book, chapters 1 - 6. The fourth chapter entitled “Ownership” does not need to be fully understood.
    2. Basic knowledge about embedded systems is recommended for the advanced part.
    3. Hardware: Rust Board ESP32-C3, or the ESP32-C3-DevKit.

Training Hardware: The ESP Rust Board

Espressif and the Rust community have developed a special dev board to be used by the community both for the Rust training and in general. This board is based on the ESP32-C3 module, a single-core Wi-Fi and Bluetooth 5 (LE) microcontroller SoC, based on the open-source RISC-V architecture.

This special board also includes the ESP32-C3-MINI-1 module, a 6DoF IMU, a temperature and humidity sensor, a Li-Ion battery charger, and a Type-C USB. The board is breadboard-friendly in the Adafruit Feather form factor.

This board is designed to be easily used in training sessions, demonstrating Rust capabilities with all the board peripherals, without dealing with wires and minimizing issues during the training. The design is meant to help developers by giving a nice-looking silk-screen with all the information right on the PCB.

The project is fully open-source and available on the ESP-RS GitHub repository under the CERN Open Hardware License.

About Ferrous Systems

Ferrous Systems provides consulting, training, and made-to-measure solutions based on their expertise in the Rust programming language. One of their key competencies is developing engaging training material for the Rust programming language.

Share this article
  • LinkedIn
  • 微信

    微信分享

    打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
Reuse this content

Ioannis

Technical Writer and Editor

About this author ›