Skip to content

Commit 3b7c02b

Browse files
authored
Rollup merge of #111389 - esp-rs:esp-idf-platform-support, r=jyn514
Add esp-idf platform-support page As mentioned in #111369 (comment), the initial PR for esp-idf didn't include a platform support document which is required for the merge of #111369.
2 parents acae72e + 53e49f4 commit 3b7c02b

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

src/doc/rustc/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- [armv7-unknown-linux-uclibceabihf](platform-support/armv7-unknown-linux-uclibceabihf.md)
2828
- [\*-android and \*-androideabi](platform-support/android.md)
2929
- [\*-linux-ohos](platform-support/openharmony.md)
30+
- [\*-esp-espidf](platform-support/esp-idf.md)
3031
- [\*-unknown-fuchsia](platform-support/fuchsia.md)
3132
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
3233
- [loongarch\*-unknown-linux-\*](platform-support/loongarch-linux.md)

src/doc/rustc/src/platform-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ target | std | host | notes
297297
`riscv32gc-unknown-linux-musl` | | | RISC-V Linux (kernel 5.4, musl + RISCV32 support patches)
298298
`riscv32im-unknown-none-elf` | * | | Bare RISC-V (RV32IM ISA)
299299
[`riscv32imac-unknown-xous-elf`](platform-support/riscv32imac-unknown-xous-elf.md) | ? | | RISC-V Xous (RV32IMAC ISA)
300-
`riscv32imc-esp-espidf` | ✓ | | RISC-V ESP-IDF
300+
[`riscv32imc-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF
301301
`riscv64gc-unknown-freebsd` | | | RISC-V FreeBSD
302302
`riscv64gc-unknown-fuchsia` | | | RISC-V Fuchsia
303303
`riscv64gc-unknown-linux-musl` | | | RISC-V Linux (kernel 4.20, musl 1.2.0)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# `*-esp-espidf`
2+
3+
**Tier: 3**
4+
5+
Targets for the [ESP-IDF](https://github.com/espressif/esp-idf) development framework running on RISC-V and Xtensa CPUs.
6+
7+
## Target maintainers
8+
9+
- Ivan Markov [@ivmarkov](https://github.com/ivmarkov)
10+
- Scott Mabin [@MabezDev](https://github.com/MabezDev)
11+
12+
## Requirements
13+
14+
The target names follow this format: `$ARCH-esp-espidf`, where `$ARCH` specifies the target processor architecture. The following targets are currently defined:
15+
16+
| Target name | Target CPU(s) |
17+
|--------------------------------|-----------------------|
18+
| `riscv32imc-esp-espidf` | [ESP32-C3](https://www.espressif.com/en/products/socs/esp32-c3) |
19+
20+
The minimum supported ESP-IDF version is `v4.3`, though it is recommended to use the latest stable release if possible.
21+
22+
## Building the target
23+
24+
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.
25+
26+
```toml
27+
[build]
28+
target = ["$ARCH-esp-espidf"]
29+
30+
[target.$ARCH-esp-espidf]
31+
linker = "ldproxy"
32+
33+
[unstable]
34+
build-std = ["std", "panic_abort"]
35+
```
36+
37+
The `esp-idf-sys` crate will handle the compilation of ESP-IDF, including downloading the relevant toolchains for the build.
38+
39+
## Cross-compilation toolchains and C code
40+
41+
`esp-idf-sys` exposes the toolchain used in the compilation of ESP-IDF, see the crate [documentation for build output propagation](https://github.com/esp-rs/esp-idf-sys#conditional-compilation) for more information.

0 commit comments

Comments
 (0)