*-espidf

Tier: 3

Targets for the ESP-IDF development framework running on RISC-V and Xtensa CPUs.

Target maintainers

Requirements

The target names follow this format: $ARCH-esp-espidf, where $ARCH specifies the target processor architecture. The following targets are currently defined:

Target nameTarget CPU(s)Minimum ESP-IDF version
riscv32imc-esp-espidfESP32-C2v5.0
riscv32imc-esp-espidfESP32-C3v4.4
riscv32imac-esp-espidfESP32-C6v5.1
riscv32imac-esp-espidfESP32-H2v5.1
riscv32imafc-esp-espidfESP32-P4v5.2
xtensa-esp32-espidfESP32v4.4
xtensa-esp32s2-espidfESP32-S2v4.4
xtensa-esp32s3-espidfESP32-S3v4.4

It is recommended to use the latest ESP-IDF stable release if possible.

Building the target

The target can be built by enabling it for a rustc build. The build-std feature is required to build the standard library for ESP-IDF. ldproxy is also required for linking, it can be installed from crates.io.

[build]
target = ["$ARCH-esp-espidf"]

[target.$ARCH-esp-espidf]
linker = "ldproxy"

[unstable]
build-std = ["std", "panic_abort"]

The esp-idf-sys crate will handle the compilation of ESP-IDF, including downloading the relevant toolchains for the build.

Cross-compilation toolchains and C code

esp-idf-sys exposes the toolchain used in the compilation of ESP-IDF, see the crate documentation for build output propagation for more information.