Skip to content

finalyards-org/esp-idf-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esp-idf-sample

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.

Requirements

  • ESP32-C6 devkit

  • Ubuntu Linux, with:

     $ sudo apt install libssl-dev pkg-config python3-venv
    

    Note: Full esp-idf-template prerequisites are longer; we're trimming to the set that actually seemed to be needed.

  • Rust with:

     $ cargo install --locked ldproxy
    

Steps

$ cargo build --release -vv

Confirm sdkconfig.defaults was followed

$ 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 ~/target is used. Yours may be local to the work folder. To find the right file, use:

$ find ~/target -name sdkconfig

To flash

$ 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.

To clean up

$ rm -rf ~/.espressif
$ cargo clean

Advanced

Changing esp-idf versions

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

Testing with plain esp-idf-sys

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
`|1|`: This was with version 5.5.4.

NOTE: The author has since moved to full std (and esp-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.

References

  • embuild (GitHub)

    Contains the ldproxy tool.

About

[WIP]: Sample use of 'esp-idf-template'; experimental

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages