A repo created by cargo generate esp-rs/esp-idf-template cargo (see https://github.com/esp-rs/esp-idf-template).
..but able to use ESP-IDF 5.5.4, 6.0.1.
-
ESP32-C6 devkit
-
Ubuntu Linux, with:
$ sudo apt install libssl-dev pkg-config python3-venvNote: Full
esp-idf-templateprerequisites are longer; we're trimming to the set that actually seemed to be needed. -
Rust with:
$ cargo install --locked ldproxy
$ cargo build --release -vv
$ cat ~/target/riscv32imac-esp-espidf/release/build/esp-idf-sys-df770abcade46a94/out/sdkconfig | grep MAIN_TASK_STACK
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8000
CONFIG_MAIN_TASK_STACK_SIZE=8000
8000 is, indeed, what we have in sdkconfig.defaults!
Note: The author has a setup where an account-global
~/targetis used. Yours may be local to the work folder. To find the right file, use:$ find ~/target -name sdkconfig
$ espflash flash --monitor ~/target/riscv32imac-esp-espidf/release/abc
[...]
I (349) abc: Hello, world!
I (359) main_task: Returned from app_main()
Press Ctrl-C to end the process.
$ rm -rf ~/.espressif
$ cargo clean
Clear caches, first:
cargo clean
Note: Build output might prompt you to run
idf.py fullclean. DON'T! It's not even available. Do the above, instead.
Note: You likely don't need to
rm -rf ~/.espressif: different ESP-IDF versions vacate different paths within it, and seem to be able to co-exist. If in doubt, wipe it!
| version | status | comments |
|---|---|---|
| 5.5.4 | ✅ | works |
| 6.0.1 | ✅ | works |
The author experimented with some setups, and managed to get a #![no_std] set up to work, with esp-idf-sys |1|:
| branch | uses | std |
comments |
|---|---|---|---|
main |
esp-idf-svc |
yes | works |
sys |
esp-idf-sys |
yes | works |
sys-core |
esp-idf-sys |
no | does not build: error: linking with ldproxy failed |
sys-core2 |
esp-idf-sys |
partly | works |
NOTE: The author has since moved to full
std(andesp-idf-svc) in his application level use of ESP-IDF. The non-main branches are likely going to be left behind.
The last option is interesting, because it shows how your application can be #![no_std], while having esp-idf-sys still work and launch your code! In that branch, esp-idf-sys is without the "std" feature, but the runtime has:
build-std = ["std", "panic_abort"]
This seems to do it for ldproxy, so that it creates a runnable binary.
Sizes
| branch | Total Image Size [B] |
|---|---|
main |
377 136 |
sys |
369 728 |
sys-core |
n/a |
sys-core2 |
149 600 |
Total Image Size from espflash flash output.
-
embuild(GitHub)Contains the
ldproxytool.