Use ArielOS for secure IoT development
mainesp-hal) and provides features like a multicore scheduler, secure networking, and a unified build system. It integrates deeply with Embassy and can be used alongside it.repository·main·Indexed 43 days ago
https://github.com/esp-rs/bookA comprehensive guide for using the Rust programming language on Espressif ESP series microcontrollers. Covers application development topics including heap allocation with esp-alloc, async mode in esp-hal, Embassy, RTIC, and the ESP32 startup and bootloader process.
esp-hal) and provides features like a multicore scheduler, secure networking, and a unified build system. It integrates deeply with Embassy and can be used alongside it.To work effectively with Espressif devices in Rust, you need to understand two primary pillars:
Mastering these two areas is a prerequisite for the practical setup and application development covered in the Getting Started chapter.
When developing with the esp-rs ecosystem, be aware of the stability guarantees provided by different components:
SemVer) and are not subject to breaking changes.unstable (such as certain parts of esp-hal and specific drivers) are actively under development. These do not follow SemVer guarantees. Using unstable components means your project may break during a cargo update, similar to using the Rust nightly compiler.It is recommended to track dependencies closely and consult migration guides provided for major crates when updating.
The probe-rs project provides a suite of tools for interacting with embedded microcontrollers. It supports flashing, monitoring, and robust debugging capabilities for Espressif chips.
Hardware Requirements:
USB-JTAG-SERIAL peripheral, you can use probe-rs without external hardware. This peripheral is available on:USB-JTAG-SERIAL peripheral, you must use an external programmer such as the ESP-Prog.esp-hal provides specific configuration options for different chips (like the ESP32-C6) in its documentation under the 'additional configuration' section.Do not use std::mem::forget on peripheral drivers. Drivers in the ESP ecosystem implement the Drop trait to ensure peripherals are returned to a safe, unconfigured state and to cancel any active Direct Memory Access (DMA) transactions.
Using mem::forget can lead to:
The ESP ROM bootloader selects the boot mode by reading the state of specific strapping pins during reset:
When in Download mode, the serial output will display: waiting for download.
For advanced connectivity features like Wi-Fi, BLE, esp-now, or IEEE 802.15.4, use the esp-radio crate.
Important Requirements:
esp-radio relies on an implementation of esp-radio-rtos-driver to define the necessary scheduling and runtime interface.esp-rtos is the default supported backend. esp-generate will automatically add esp-rtos if you enable the appropriate template options.Over The Air (OTA) updates allow you to update an application without using physical production flashing tools. This process relies on a bootloader to manage the switching, replacement, and rollback of OTA images (firmware updates).
Currently, the Rust ecosystem for ESP supports the ESP-IDF bootloader via the [esp-bootloader-esp-idf] crate.
Choose the narration perspective based on the context:
cargo-generate
cargo install cargo-generate").allocator_api feature along with the allocator_api2 crate. esp-alloc implements this interface.For resource-constrained environments like ESP32, defmt is a highly efficient logging framework. It uses compact, binary-encoded log messages to minimize overhead compared to traditional string-based logging.
Recommendation: Pair defmt with probe-rs for the best experience on Espressif chips.