An example project demonstrating integration with Rust for the ESP32-S2 and ESP32-C3 microcontrollers.

Overview

Rust ESP32 Example

An example project demonstrating integration with Rust for the ESP32-S2 and ESP32-C3 microcontrollers.

This example starts a FreeRTOS task to call a function in Rust and display the results in C.

Setup

First, install the ESP-IDF SDK as shown in the Get Started guides. For best support of the ESP32-C3, install the SDK from the master branch.

ESP32 and ESP32-S series

To support the Xtensa instruction set, build and install custom LLVM and Rust toolchains as shown in the Rust On Xtensa guide.

ESP32-C3

Install the RISCV target for Rust:

rustup target add riscv32i-unknown-none-elf

Configure

First ensure that the environment variables for the ESP32 SDK are properly set up. If you have followed the instructions in the Getting Started guide, activate the environment with the get_idf alias:

get_idf

Next, configure the project for the desired MCU.

For the ESP32:

idf.py set-target esp32
idf.py menuconfig

For the ESP32-S2:

idf.py set-target esp32s2
idf.py menuconfig

For the ESP32-C3:

idf.py set-target esp32c3
idf.py menuconfig

Build

Build the project by running:

idf.py build

This also runs Cargo internally, building a static library out of Rust code.

Flash

Flash the compiled binary by running:

idf.py -p /dev/cu.SLAB_USBtoUART flash

Monitor

Connect to the UART over USB port to monitor the application console:

idf.py -p /dev/cu.SLABtoUART monitor

To exit the monitor, press Ctrl-].

Debugging on ESP32-WROVER-KIT

openocd -f board/esp32-wrover-kit-3.3v.cfg
Comments
  • Allow using esp-idf-svc with the CMake build

    Allow using esp-idf-svc with the CMake build

    Hi,

    Thanks for this really nice repository! We're a French company using ESP32 for our products, and we are really looking forward to being able to use embedded Rust.

    We saw both rust-esp32-example (this repo, CMake-based build) and https://github.com/ivmarkov/rust-esp32-std-hello (a nice "cargo-first" build from @ivmarkov which also allows to use the nice https://github.com/esp-rs/esp-idf-svc which gives access to nice Rust wrappers for most of ESP-IDF libraries).

    For now, because our codebase is C/C++, we'd be happy to use this CMake-based build rather than the "cargo-first" build (as we want to incrementally modify modules of our code by replacing them with Rust code), but it seems we can't use esp-idf-svc with it out-of-the-box.

    Would it be possible to update this code, or add an example of how to do a CMake-based build that also allows to use esp-idf-svc?

    opened by maelp 31
  • Issue compiling for ESP32-C3 (AtomicUsize used in std_detect)

    Issue compiling for ESP32-C3 (AtomicUsize used in std_detect)

    With stable or beta Rust toolchains, I get the following error when running cargo build --release:

    error[E0463]: can't find crate for `std`
      |
      = note: the `riscv32i-unknown-none-elf` target may not be installed
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0463`.
    error: could not compile `rustlib`
    
    `rustup show` output:
    Default host: x86_64-apple-darwin
    rustup home:  /Users/ivan/.rustup
    
    installed toolchains
    --------------------
    
    stable-x86_64-apple-darwin (default)
    beta-x86_64-apple-darwin
    nightly-x86_64-apple-darwin
    
    installed targets for active toolchain
    --------------------------------------
    
    riscv32i-unknown-none-elf
    x86_64-apple-darwin
    
    active toolchain
    ----------------
    
    stable-x86_64-apple-darwin (default)
    rustc 1.48.0 (7eac88abb 2020-11-16)
    
    

    Switching to nightly channel, as indicated in quick start for Xtensa, and installing riscv32i-unknown-none-elf target, i get a different error:

       Compiling rustlib v0.1.0 (/Users/ivan/e/rust-esp32-example/rustlib)
    error[E0432]: unresolved import `core::sync::atomic::AtomicUsize`
     --> /Users/ivan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/detect/cache.rs:8:5
      |
    8 | use core::sync::atomic::AtomicUsize;
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `AtomicUsize` in `sync::atomic`
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0432`.
    error: could not compile `std_detect`
    
    `rustup show` output:
    Default host: x86_64-apple-darwin
    rustup home:  /Users/ivan/.rustup
    
    installed toolchains
    --------------------
    
    stable-x86_64-apple-darwin
    beta-x86_64-apple-darwin
    nightly-x86_64-apple-darwin (default)
    
    installed targets for active toolchain
    --------------------------------------
    
    riscv32i-unknown-none-elf
    riscv32imc-unknown-none-elf
    x86_64-apple-darwin
    
    active toolchain
    ----------------
    
    nightly-x86_64-apple-darwin (default)
    rustc 1.54.0-nightly (16e18395c 2021-06-10)
    
    

    The failure makes sense, since RV32I or RV32IMC don't support atomic instructions.

    This looks like https://github.com/rust-lang/rust/issues/62269, except this time in std_detect crate. I guess this is something that needs to be reported in https://github.com/rust-lang/stdarch/blob/82106e84345ee25366cd8a49a228d69fde795047/crates/std_detect/src/detect/cache.rs#L8?

    opened by igrr 14
  • Build fails while running bindgen

    Build fails while running bindgen

    Just pulled the toolchain and example (using the instructions here: https://github.com/espressif/rust-esp32-example/blob/main/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md). When I build for esp32, I get the following:

    $ idf.py set-target esp32
    [output elided...]
    $ RUST_BACKTRACE=1 idf.py build
    Executing action: all (aliases: build)
    Running ninja in directory /home/brian/src/esp32-rust/rust-esp32-example/build
    Executing "ninja all"...
    [1/14] Performing build step for 'bootloader'
    ninja: no work to do.
    [2/12] Performing build step for 'rustlib_project'
    FAILED: esp-idf/rustlib/stamp/rustlib_project-build esp-idf/rustlib/target/RustApi.h esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a 
    cd /home/brian/src/esp32-rust/rust-esp32-example/components/rustlib && /usr/bin/cmake -E env CARGO_BUILD_TARGET=xtensa-esp32-espidf CARGO_BUILD_TARGET_DIR=/home/brian/src/esp32-rust/rust-esp32-example/build/esp-idf/rustlib/target cargo build --release --features=std
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
       Compiling rustlib v0.1.0 (/home/brian/src/esp32-rust/rust-esp32-example/components/rustlib)
    error: failed to run custom build command for `rustlib v0.1.0 (/home/brian/src/esp32-rust/rust-esp32-example/components/rustlib)`
    
    Caused by:
      process didn't exit successfully: `/home/brian/src/esp32-rust/rust-esp32-example/build/esp-idf/rustlib/target/release/build/rustlib-435225cb26b45082/build-script-build` (exit status: 101)
      --- stdout
      cargo:rerun-if-changed=/home/brian/src/esp32-rust/rust-esp32-example/build/esp-idf/rustlib/target/RustApi.h
    
      --- stderr
      thread 'main' panicked at 'libclang error; possible causes include:
      - Invalid flag syntax
      - Unrecognized flags
      - Invalid flag arguments
      - File I/O errors
      - Host vs. target architecture mismatch
      If you encounter an error missing from this list, please file an issue or a PR!', /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.58.1/src/ir/context.rs:535:15
      stack backtrace:
         0: rust_begin_unwind
         1: core::panicking::panic_fmt
         2: core::option::expect_failed
         3: core::option::Option<T>::expect
                   at /home/runner/work/idf-rust-build/idf-rust-build/library/core/src/option.rs:351:21
         4: bindgen::ir::context::BindgenContext::new
                   at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.58.1/src/ir/context.rs:529:13
         5: bindgen::Bindings::generate
                   at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.58.1/src/lib.rs:2272:27
         6: bindgen::Builder::generate
                   at /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.58.1/src/lib.rs:1434:9
         7: build_script_build::run_bindgen
                   at ./build.rs:50:20
         8: build_script_build::main
                   at ./build.rs:12:5
         9: core::ops::function::FnOnce::call_once
                   at /home/runner/work/idf-rust-build/idf-rust-build/library/core/src/ops/function.rs:227:5
      note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    ninja: build stopped: subcommand failed.
    ninja failed with exit code 1
    

    Some other things:

    $ bindgen --version
    bindgen 0.59.1
    $ rustc --version
    rustc 1.54.0-dev
    $ rustc --print target-list | grep esp
    riscv32imac-esp-espidf
    riscv32imc-esp-espidf
    xtensa-esp32-espidf
    xtensa-esp32-none-elf
    xtensa-esp32s2-espidf
    xtensa-esp32s2-none-elf
    xtensa-esp8266-none-elf
    $ clang --version
    clang version 11.0.0 (https://gitlab-ci-token:[email protected]:6688/idf/llvm-project.git 36dbc8b5ee7dae4a4c5bff73efff0ea7ccb3707e)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/xtensa/xtensa-esp32-elf-clang/bin
    $ clang -print-targets
      Registered Targets:
        x86    - 32-bit X86: Pentium-Pro and above
        x86-64 - 64-bit X86: EM64T and AMD64
        xtensa - Xtensa 32
    $ xtensa-esp32-elf-gcc --version
    xtensa-esp32-elf-gcc (crosstool-NG esp-2021r1) 8.4.0
    Copyright (C) 2018 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    

    Also: is that your GitLab auth token in the clang version string? Might want to rotate those credentials if so...

    opened by kelnos 11
  • Issues when compiling Rust library project to a static library

    Issues when compiling Rust library project to a static library

    Hi all,

    I'm trying to compile ttf-parser to a static library for another ESP-IDF C/C++ project. It has a C binding and it should just work as long as I change the target type from cdylib to staticlib (am I right? or have I forgot something?). However it didn't work somehow when opt-level is not 0 or s. Here's what I have done:

    1. I used the docker image, by docker pull espressif/idf-rust-examples then docker run -it espressif/idf-rust-examples
    2. I cloned the ttf-parser project, by: git clone https://github.com/RazrFalcon/ttf-parser
    3. Then I go to the c-api directory. I added a .cargo/config.toml, content listed below:
    [build]
    # Uncomment the relevant target for your chip here (ESP32, ESP32-S2 or ESP32-C3)
    target = "xtensa-esp32-espidf"
    #target = "xtensa-esp32s2-espidf"
    #target = "riscv32imc-esp-espidf"
    
    [target.xtensa-esp32-espidf]
    linker = "ldproxy"
    
    [target.xtensa-esp32s2-espidf]
    linker = "ldproxy"
    
    [target.riscv32imc-esp-espidf]
    linker = "ldproxy"
    
    [patch.crates-io]
    # This patch is a temporary workaround necessary until Rust 1.55 is out
    # You DON'T need it with stock nightly Rust 1.56 (but stock nightly only supports the ESP32-C3 chip)
    libc = { git = "https://github.com/ivmarkov/libc.git" }
    
    [unstable]
    configurable-env = true # No longer necessary since 1.56, as it was stabilized: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/features.rs#L698
    extra-link-arg = true   # No longer necessary since 1.56, as it was stabilized: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/features.rs#L695
    build-std = ["std", "panic_abort"]
    build-std-features = ["panic_immediate_abort"]
    patch-in-config = true
    
    
    1. I run cargo build --release --verbose. Then something goes wrong. Here are a few different variants:
    • If I leave the lto = true and default release opt-level (should be 3?) in the Cargo.toml, rustc constantly uses 100% CPU and never finish compiling (at least still running after 3 minutes on a machine with Ryzen 3700X, 32GB RAM)
    • If I comment lto = true out and default release opt-level (should be 3?) , rustc will not lock up. But instead it gives me this output:
    warning: Patch `libc v0.2.101 (https://github.com/ivmarkov/libc.git#7e83ba0a)` was not used in the crate graph.
    Check that the patched package version and available features are compatible
    with the dependency requirements. If the patch has a different version from
    what is locked in the Cargo.lock file, run `cargo update` to use the new
    version. This may also occur with an optional dependency that is not enabled.
        Updating git repository `https://github.com/ivmarkov/libc.git`
    warning: Patch `libc v0.2.101 (https://github.com/ivmarkov/libc.git#7e83ba0a)` was not used in the crate graph.
    Check that the patched package version and available features are compatible
    with the dependency requirements. If the patch has a different version from
    what is locked in the Cargo.lock file, run `cargo update` to use the new
    version. This may also occur with an optional dependency that is not enabled.
           Fresh core v0.0.0 (/opt/esp/lib/rustlib/src/rust/library/core)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh cc v1.0.69
           Fresh rustc-std-workspace-core v1.99.0 (/opt/esp/lib/rustlib/src/rust/library/rustc-std-workspace-core)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh compiler_builtins v0.1.49
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh libc v0.2.98 (https://github.com/rust-lang/libc.git#67562637)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh alloc v0.0.0 (/opt/esp/lib/rustlib/src/rust/library/alloc)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh cfg-if v0.1.10
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh rustc-demangle v0.1.20
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh rustc-std-workspace-alloc v1.99.0 (/opt/esp/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh unwind v0.0.0 (/opt/esp/lib/rustlib/src/rust/library/unwind)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh panic_abort v0.0.0 (/opt/esp/lib/rustlib/src/rust/library/panic_abort)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh hashbrown v0.11.2
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh std_detect v0.1.5 (/opt/esp/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh panic_unwind v0.0.0 (/opt/esp/lib/rustlib/src/rust/library/panic_unwind)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh std v0.0.0 (/opt/esp/lib/rustlib/src/rust/library/std)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
           Fresh proc_macro v0.0.0 (/opt/esp/lib/rustlib/src/rust/library/proc_macro)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
       Compiling ttf-parser v0.12.3 (/opt/ttf-parser)
         Running `rustc --crate-name ttf_parser --edition=2018 /opt/ttf-parser/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="std"' --cfg 'feature="variable-fonts"' -C metadata=b7db5016109f670c -C extra-filename=-b7db5016109f670c --out-dir /opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps --target xtensa-esp32-espidf -C linker=ldproxy -L dependency=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps -L dependency=/opt/ttf-parser/c-api/target/release/deps --extern 'noprelude:alloc=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/liballoc-2902dfbac9bdd6ca.rmeta' --extern 'noprelude:compiler_builtins=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libcompiler_builtins-5cb2d211fd6af220.rmeta' --extern 'noprelude:core=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libcore-3cff502e5da9da9c.rmeta' --extern 'noprelude:panic_abort=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libpanic_abort-0042c62788b76179.rmeta' --extern 'noprelude:panic_unwind=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libpanic_unwind-6ec9d840d190d1d7.rmeta' --extern 'noprelude:proc_macro=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libproc_macro-080b393debb41506.rmeta' --extern 'noprelude:std=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libstd-559d5acfa07b308c.rmeta' -Z unstable-options`
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    LLVM ERROR: fixup value out of range
    error: could not compile `ttf-parser`
    
    Caused by:
      process didn't exit successfully: `rustc --crate-name ttf_parser --edition=2018 /opt/ttf-parser/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="std"' --cfg 'feature="variable-fonts"' -C metadata=b7db5016109f670c -C extra-filename=-b7db5016109f670c --out-dir /opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps --target xtensa-esp32-espidf -C linker=ldproxy -L dependency=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps -L dependency=/opt/ttf-parser/c-api/target/release/deps --extern 'noprelude:alloc=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/liballoc-2902dfbac9bdd6ca.rmeta' --extern 'noprelude:compiler_builtins=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libcompiler_builtins-5cb2d211fd6af220.rmeta' --extern 'noprelude:core=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libcore-3cff502e5da9da9c.rmeta' --extern 'noprelude:panic_abort=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libpanic_abort-0042c62788b76179.rmeta' --extern 'noprelude:panic_unwind=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libpanic_unwind-6ec9d840d190d1d7.rmeta' --extern 'noprelude:proc_macro=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libproc_macro-080b393debb41506.rmeta' --extern 'noprelude:std=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libstd-559d5acfa07b308c.rmeta' -Z unstable-options` (exit status: 101)
    
    
    • If I set debug = true and opt-level = "z", it gives me:
       Compiling ttf-parser v0.12.3 (/opt/ttf-parser)
         Running `rustc --crate-name ttf_parser --edition=2018 /opt/ttf-parser/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=z -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="std"' --cfg 'feature="variable-fonts"' -C metadata=47d4919b23a5bfb9 -C extra-filename=-47d4919b23a5bfb9 --out-dir /opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps --target xtensa-esp32-espidf -C linker=ldproxy -L dependency=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps -L dependency=/opt/ttf-parser/c-api/target/release/deps --extern 'noprelude:alloc=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/liballoc-6e011642604099cb.rmeta' --extern 'noprelude:compiler_builtins=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libcompiler_builtins-6ee7ed1b085d2764.rmeta' --extern 'noprelude:core=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libcore-41b494a1d5172bd1.rmeta' --extern 'noprelude:panic_abort=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libpanic_abort-09026d116c1a3ad5.rmeta' --extern 'noprelude:panic_unwind=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libpanic_unwind-f0b56e4ce10f80a5.rmeta' --extern 'noprelude:proc_macro=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libproc_macro-fd87d4d48a2fd788.rmeta' --extern 'noprelude:std=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libstd-259244ca692541bb.rmeta' -Z unstable-options`
    '+memctl' is not a recognized feature for this target (ignoring feature)
    '+memctl' is not a recognized feature for this target (ignoring feature)
    LLVM ERROR: Error while trying to spill A14 from class AR: Cannot scavenge register without an emergency spill slot!
    error: could not compile `ttf-parser`
    
    Caused by:
      process didn't exit successfully: `rustc --crate-name ttf_parser --edition=2018 /opt/ttf-parser/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=z -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="std"' --cfg 'feature="variable-fonts"' -C metadata=47d4919b23a5bfb9 -C extra-filename=-47d4919b23a5bfb9 --out-dir /opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps --target xtensa-esp32-espidf -C linker=ldproxy -L dependency=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps -L dependency=/opt/ttf-parser/c-api/target/release/deps --extern 'noprelude:alloc=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/liballoc-6e011642604099cb.rmeta' --extern 'noprelude:compiler_builtins=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libcompiler_builtins-6ee7ed1b085d2764.rmeta' --extern 'noprelude:core=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libcore-41b494a1d5172bd1.rmeta' --extern 'noprelude:panic_abort=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libpanic_abort-09026d116c1a3ad5.rmeta' --extern 'noprelude:panic_unwind=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libpanic_unwind-f0b56e4ce10f80a5.rmeta' --extern 'noprelude:proc_macro=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libproc_macro-fd87d4d48a2fd788.rmeta' --extern 'noprelude:std=/opt/ttf-parser/c-api/target/xtensa-esp32-espidf/release/deps/libstd-259244ca692541bb.rmeta' -Z unstable-options` (exit status: 101)
    
    
    • If I set opt-level = 0 in the Cargo.toml, it can compile, but '+memctl' is not a recognized feature for this target (ignoring feature) warning still shows up
    • If I set opt-level = "s", in the Cargo.toml, it can compile, but '+memctl' is not a recognized feature for this target (ignoring feature) warning still shows up
    • If I set opt-level = "s" and lto = true in the Cargo.toml, it can compile, but '+memctl' is not a recognized feature for this target (ignoring feature) warning still shows up

    I would like to know is this a compiler bug or I somehow misused something? Any suggestions? Thanks in advance!

    Regards, Jackson

    opened by huming2207 6
  • rust-xtensa instructions for Ubuntu 20 doesn't works on zsh

    rust-xtensa instructions for Ubuntu 20 doesn't works on zsh

    Related files : docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md Description :

    zsh: command not found: pushd
    zsh: command not found: popd
    

    Suggest to change pushd and popd to cd somepath , cd ..

    opened by pmnxis 6
  • Unpackaging the Rust Windows binaries fails

    Unpackaging the Rust Windows binaries fails

    I'm trying to follow this guide for installing the precompiled Rust toolchain & LLVM clang on Windows.

    The installation instructions fail on the following step: cp -Recurse .\rust-std-x86_64-pc-windows-msvc\lib\* ~\.rustup\toolchains\xtensa\lib\

    ... with this error message:

    PS C:\Users\ivan\rust-1.50.0-dev-x86_64-pc-windows-msvc> cp -Recurse .\rust-std-x86_64-pc-windows-msvc\lib\* ~\.rustup\toolchains\xtensa\lib\
    cp : An item with the specified name C:\Users\ivan\.rustup\toolchains\xtensa\lib\rustlib already exists.
    At line:1 char:1
    + cp -Recurse .\rust-std-x86_64-pc-windows-msvc\lib\* ~\.rustup\toolcha ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ResourceExists: (C:\Users\ivan\....nsa\lib\rustlib:String) [Copy-Item], IOException
        + FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.CopyItemCommand
    
    cp : An item with the specified name C:\Users\ivan\.rustup\toolchains\xtensa\lib\rustlib\x86_64-pc-windows-msvc
    already exists.
    At line:1 char:1
    + cp -Recurse .\rust-std-x86_64-pc-windows-msvc\lib\* ~\.rustup\toolcha ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ResourceExists: (C:\Users\ivan\....pc-windows-msvc:String) [Copy-Item], IOException
        + FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.CopyItemCommand
    
    opened by ivmarkov 6
  • docker: split images to idf-rust and idf-rust-examples

    docker: split images to idf-rust and idf-rust-examples

    Closes https://github.com/ivmarkov/rust-esp32-std-hello/pull/8

    The idea behind this PR is to have two images:

    • espressif/idf-rust - which contains Rust compiler and can be used in CI or base image for others
    • espressif/idf-rust-examples - images based on idf-rust which contains additional tools and examples

    Right now we have two examples:

    • "idf.py-first" approach in /opt/rust-esp32-example
    • "cargo-first" approach which dependes on cargo-pio in /opt/rust-esp32-std-hello - repo: https://github.com/ivmarkov/rust-esp32-std-hello.git
    opened by georgik 5
  • PlatformIO Core not found.

    PlatformIO Core not found.

    Just following the instruction does not work

    latest: Pulling from espressif/idf-rust-examples
    Digest: sha256:ae300eac447f51c6cffd0994e62635af7f5785d1f3b68d39123ba048f3ef81ef
    Status: Image is up to date for espressif/idf-rust-examples:latest
    
        cd /opt/rust-esp32-std-hello
        cargo build --release
        espflash /dev/ttyUSB0 target/xtensa-esp32-espidf/release/rust-esp32-std-hello
        cargo pio espidf monitor -e release /dev/ttyUSB0
    
      --- stderr
      Error: Compatible PlatformIO Core not found.
      Reason: PlatformIO executable not found in `/root/.platformio/penv/bin`
      CMake Error at /root/.platformio/packages/framework-espidf/tools/cmake/scripts/data_file_embed_asm.cmake:26 (file):
        file failed to open for reading (No such file or directory):
    
          /opt/rust-esp32-std-hello/target/xtensa-esp32-espidf/release/build/esp-idf-sys-32173fcf1c714593/out/esp-idf/.pio/build/release/x509_crt_bundle
    
    
      *** Error 1
      *** [.pio/build/release/.pio/build/release/x509_crt_bundle.o] Source `.pio/build/release/x509_crt_bundle.S' not found, needed by target `.pio/build/release/.pio/build/release/x509_crt_bundle.o'.
      ========================= [FAILED] Took 69.47 seconds =========================
      Environment    Status    Duration
      -------------  --------  ------------
      release        FAILED    00:01:09.471
      ==================== 1 failed, 0 succeeded in 00:01:09.471 ====================
      Error: No such file or directory (os error 2)
    
    opened by dcharbonnier 4
  • Linking error when using `rand::thread_rng()`

    Linking error when using `rand::thread_rng()`

    I'm using this example as boilerplate for a PoC I'm conducting. I'm compiling with the docker image georgikrocks/esp-idf-rust:latest (2e95100a412d). When my Rust code calls rand::thread_rng(), compilation fails with

    FAILED: streams-embedded-transport-example.elf 
    : && /opt/xtensa-esp32-elf-clang/bin/xtensa-esp32-elf-g++ -mlongcalls -Wno-frame-address  CMakeFiles/streams-embedded-transport-example.elf.dir/project_elf_src_esp32.c.obj -o streams-embedded-transport-example.elf  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/esp_ipc/libesp_ipc.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/app_update/libapp_update.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/espcoredump/libespcoredump.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/vfs/libvfs.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/tcpip_adapter/libtcpip_adapter.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/esp_event/libesp_event.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/lwip/liblwip.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/app_trace/libapp_trace.a  esp-idf/asio/libasio.a  esp-idf/cbor/libcbor.a  esp-idf/unity/libunity.a  esp-idf/cmock/libcmock.a  esp-idf/coap/libcoap.a  esp-idf/console/libconsole.a  esp-idf/nghttp/libnghttp.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/esp_adc_cal/libesp_adc_cal.a  esp-idf/esp_hid/libesp_hid.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/esp_lcd/libesp_lcd.a  esp-idf/protobuf-c/libprotobuf-c.a  esp-idf/protocomm/libprotocomm.a  esp-idf/mdns/libmdns.a  esp-idf/esp_local_ctrl/libesp_local_ctrl.a  esp-idf/sdmmc/libsdmmc.a  esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a  esp-idf/esp_websocket_client/libesp_websocket_client.a  esp-idf/expat/libexpat.a  esp-idf/wear_levelling/libwear_levelling.a  esp-idf/fatfs/libfatfs.a  esp-idf/freemodbus/libfreemodbus.a  esp-idf/jsmn/libjsmn.a  esp-idf/json/libjson.a  esp-idf/libsodium/liblibsodium.a  esp-idf/mqtt/libmqtt.a  esp-idf/openssl/libopenssl.a  esp-idf/perfmon/libperfmon.a  esp-idf/spiffs/libspiffs.a  esp-idf/ulp/libulp.a  esp-idf/wifi_provisioning/libwifi_provisioning.a  esp-idf/main/libmain.a  esp-idf/clib/libclib.a  esp-idf/rustlib/librustlib.a  -Wl,--cref -Wl,--Map=/opt/streams/build/streams-embedded-transport-example.map  -Wl,--gc-sections  -fno-rtti  -fno-lto  esp-idf/asio/libasio.a  esp-idf/cbor/libcbor.a  esp-idf/cmock/libcmock.a  esp-idf/unity/libunity.a  esp-idf/coap/libcoap.a  esp-idf/esp_adc_cal/libesp_adc_cal.a  esp-idf/esp_hid/libesp_hid.a  esp-idf/esp_lcd/libesp_lcd.a  esp-idf/esp_local_ctrl/libesp_local_ctrl.a  esp-idf/esp_websocket_client/libesp_websocket_client.a  esp-idf/expat/libexpat.a  esp-idf/fatfs/libfatfs.a  esp-idf/wear_levelling/libwear_levelling.a  esp-idf/freemodbus/libfreemodbus.a  esp-idf/jsmn/libjsmn.a  esp-idf/libsodium/liblibsodium.a  esp-idf/mqtt/libmqtt.a  esp-idf/openssl/libopenssl.a  esp-idf/perfmon/libperfmon.a  esp-idf/spiffs/libspiffs.a  esp-idf/wifi_provisioning/libwifi_provisioning.a  esp-idf/protocomm/libprotocomm.a  esp-idf/protobuf-c/libprotobuf-c.a  esp-idf/mdns/libmdns.a  esp-idf/console/libconsole.a  esp-idf/json/libjson.a  esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a  esp-idf/clib/libclib.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/esp_ipc/libesp_ipc.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/app_update/libapp_update.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/espcoredump/libespcoredump.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/vfs/libvfs.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/tcpip_adapter/libtcpip_adapter.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/esp_event/libesp_event.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/lwip/liblwip.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/app_trace/libapp_trace.a  esp-idf/nghttp/libnghttp.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/sdmmc/libsdmmc.a  esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a  esp-idf/ulp/libulp.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcoexist.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcore.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libespnow.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libmesh.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libnet80211.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libpp.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libwapi.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/esp_ipc/libesp_ipc.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/app_update/libapp_update.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/espcoredump/libespcoredump.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/vfs/libvfs.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/tcpip_adapter/libtcpip_adapter.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/esp_event/libesp_event.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/lwip/liblwip.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/app_trace/libapp_trace.a  esp-idf/nghttp/libnghttp.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/sdmmc/libsdmmc.a  esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a  esp-idf/ulp/libulp.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcoexist.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcore.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libespnow.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libmesh.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libnet80211.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libpp.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libwapi.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/esp_ipc/libesp_ipc.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/app_update/libapp_update.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/espcoredump/libespcoredump.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/vfs/libvfs.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/tcpip_adapter/libtcpip_adapter.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/esp_event/libesp_event.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/lwip/liblwip.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/app_trace/libapp_trace.a  esp-idf/nghttp/libnghttp.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/sdmmc/libsdmmc.a  esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a  esp-idf/ulp/libulp.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcoexist.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcore.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libespnow.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libmesh.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libnet80211.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libpp.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libwapi.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/esp_ipc/libesp_ipc.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/app_update/libapp_update.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/espcoredump/libespcoredump.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/vfs/libvfs.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/tcpip_adapter/libtcpip_adapter.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/esp_event/libesp_event.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/lwip/liblwip.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/app_trace/libapp_trace.a  esp-idf/nghttp/libnghttp.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/sdmmc/libsdmmc.a  esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a  esp-idf/ulp/libulp.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcoexist.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcore.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libespnow.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libmesh.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libnet80211.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libpp.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libwapi.a  esp-idf/esp_ringbuf/libesp_ringbuf.a  esp-idf/efuse/libefuse.a  esp-idf/esp_ipc/libesp_ipc.a  esp-idf/driver/libdriver.a  esp-idf/esp_pm/libesp_pm.a  esp-idf/mbedtls/libmbedtls.a  esp-idf/app_update/libapp_update.a  esp-idf/bootloader_support/libbootloader_support.a  esp-idf/spi_flash/libspi_flash.a  esp-idf/nvs_flash/libnvs_flash.a  esp-idf/pthread/libpthread.a  esp-idf/esp_gdbstub/libesp_gdbstub.a  esp-idf/espcoredump/libespcoredump.a  esp-idf/esp_phy/libesp_phy.a  esp-idf/esp_system/libesp_system.a  esp-idf/esp_rom/libesp_rom.a  esp-idf/hal/libhal.a  esp-idf/vfs/libvfs.a  esp-idf/esp_eth/libesp_eth.a  esp-idf/tcpip_adapter/libtcpip_adapter.a  esp-idf/esp_netif/libesp_netif.a  esp-idf/esp_event/libesp_event.a  esp-idf/wpa_supplicant/libwpa_supplicant.a  esp-idf/esp_wifi/libesp_wifi.a  esp-idf/lwip/liblwip.a  esp-idf/log/liblog.a  esp-idf/heap/libheap.a  esp-idf/soc/libsoc.a  esp-idf/esp_hw_support/libesp_hw_support.a  esp-idf/xtensa/libxtensa.a  esp-idf/esp_common/libesp_common.a  esp-idf/esp_timer/libesp_timer.a  esp-idf/freertos/libfreertos.a  esp-idf/newlib/libnewlib.a  esp-idf/cxx/libcxx.a  esp-idf/app_trace/libapp_trace.a  esp-idf/nghttp/libnghttp.a  esp-idf/esp-tls/libesp-tls.a  esp-idf/tcp_transport/libtcp_transport.a  esp-idf/esp_http_client/libesp_http_client.a  esp-idf/esp_http_server/libesp_http_server.a  esp-idf/esp_https_ota/libesp_https_ota.a  esp-idf/sdmmc/libsdmmc.a  esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a  esp-idf/ulp/libulp.a  esp-idf/mbedtls/mbedtls/library/libmbedtls.a  esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a  esp-idf/mbedtls/mbedtls/library/libmbedx509.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcoexist.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libcore.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libespnow.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libmesh.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libnet80211.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libpp.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libsmartconfig.a  /opt/esp/idf/components/esp_wifi/lib/esp32/libwapi.a  -Wl,--wrap=mbedtls_mpi_exp_mod  -u esp_app_desc  -u pthread_include_pthread_impl  -u pthread_include_pthread_cond_impl  -u pthread_include_pthread_local_storage_impl  -L /opt/esp/idf/components/esp_phy/lib/esp32  -lphy  esp-idf/esp_phy/libesp_phy.a  -lphy  esp-idf/esp_phy/libesp_phy.a  -lphy  -lrtc  -u ld_include_highint_hdl  -u start_app  -u start_app_other_cores  -L /opt/streams/build/esp-idf/esp_system/ld  -T memory.ld  -T sections.ld  -u __ubsan_include  -L /opt/esp/idf/components/esp_rom/esp32/ld  -T esp32.rom.ld  -T esp32.rom.api.ld  -T esp32.rom.libgcc.ld  -T esp32.rom.newlib-data.ld  -T esp32.rom.syscalls.ld  -T esp32.rom.newlib-funcs.ld  -T esp32.rom.newlib-time.ld  -Wl,--wrap=longjmp  -u __assert_func  -u vfs_include_syscalls_impl  -L /opt/esp/idf/components/esp_wifi/lib/esp32  -L /opt/esp/idf/components/soc/esp32/ld  -T esp32.peripherals.ld  /opt/esp/idf/components/xtensa/esp32/libxt_hal.a  -Wl,--undefined=uxTopUsedPriority  -u app_main  -lm  esp-idf/newlib/libnewlib.a  -u newlib_include_heap_impl  -u newlib_include_syscalls_impl  -u newlib_include_pthread_impl  -Wl,--wrap=_Unwind_SetEnableExceptionFdeSorting  -Wl,--wrap=__register_frame_info_bases  -Wl,--wrap=__register_frame_info  -Wl,--wrap=__register_frame  -Wl,--wrap=__register_frame_info_table_bases  -Wl,--wrap=__register_frame_info_table  -Wl,--wrap=__register_frame_table  -Wl,--wrap=__deregister_frame_info_bases  -Wl,--wrap=__deregister_frame_info  -Wl,--wrap=_Unwind_Find_FDE  -Wl,--wrap=_Unwind_GetGR  -Wl,--wrap=_Unwind_GetCFA  -Wl,--wrap=_Unwind_GetIP  -Wl,--wrap=_Unwind_GetIPInfo  -Wl,--wrap=_Unwind_GetRegionStart  -Wl,--wrap=_Unwind_GetDataRelBase  -Wl,--wrap=_Unwind_GetTextRelBase  -Wl,--wrap=_Unwind_SetIP  -Wl,--wrap=_Unwind_SetGR  -Wl,--wrap=_Unwind_GetLanguageSpecificData  -Wl,--wrap=_Unwind_FindEnclosingFunction  -Wl,--wrap=_Unwind_Resume  -Wl,--wrap=_Unwind_RaiseException  -Wl,--wrap=_Unwind_DeleteException  -Wl,--wrap=_Unwind_ForcedUnwind  -Wl,--wrap=_Unwind_Resume_or_Rethrow  -Wl,--wrap=_Unwind_Backtrace  -Wl,--wrap=__cxa_call_unexpected  -Wl,--wrap=__gxx_personality_v0  -u __cxa_guard_dummy  -lstdc++  esp-idf/pthread/libpthread.a  -lgcc  esp-idf/cxx/libcxx.a  -u __cxx_fatal_exception  esp-idf/app_trace/libapp_trace.a  -lgcov  esp-idf/app_trace/libapp_trace.a  -lgcov  -lc && :
    /opt/xtensa-esp32-elf-clang/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/rustlib/target/xtensa-esp32-espidf/release/librustlib.a(rustlib-8ed1900ea86a6c48.rand-4de7581c8c2fb914.rand.5x8vszn4-cgu.15.rcgu.o.rcgu.o):(.literal._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hd74d63aeb634a063E.llvm.12770143606975383821+0x4): undefined reference to `pthread_atfork'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    ninja failed with exit code 1
    

    I noticed ESP-IDF pthread.c implementation does not implement pthread_atfork. Am I right in assuming there's nothing I can do ATM? Is it a bug, pending implementation, or can't be implemented?

    In any case, this should probably be caught at compile time rather than link time. If you could point me to the right repository to where report this issue I'd appreciated it.

    opened by arnauorriols 4
  • Fix build

    Fix build

    • Removes using deprecated spi_flash_get_chip_size()
    • Fixes format strings

    I tested build for ESP32-C3 with IDF branches:

    • release/v4.3
    • release/v4.4
    • release/v5.0
    • master
    opened by antmak 2
  • Build fails

    Build fails

    After running the installation steps for ESP-IDF and esp-rs/rust-build as well as sourcing the environment for both esp-idf and the rust environment the build fails:

    get_idf
    source ~/esp32/rust-build/export-esp-rust.sh
    idf.py set-target esp32
    idf.py build
    

    The build fails with the following error:

    [848/854] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj
    FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj 
    /home/void/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DUNITY_INCLUDE_CONFIG_H -I/home/void/esp32/rust-esp32-example/build/config -I/home/void/esp32/esp-idf/components/newlib/platform_include -I/home/void/esp32/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/void/esp32/esp-idf/components/freertos/esp_additions/include/freertos -I/home/void/esp32/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/home/void/esp32/esp-idf/components/freertos/esp_additions/include -I/home/void/esp32/esp-idf/components/esp_hw_support/include -I/home/void/esp32/esp-idf/components/esp_hw_support/include/soc -I/home/void/esp32/esp-idf/components/esp_hw_support/include/soc/esp32 -I/home/void/esp32/esp-idf/components/esp_hw_support/port/esp32/. -I/home/void/esp32/esp-idf/components/esp_hw_support/port/esp32/private_include -I/home/void/esp32/esp-idf/components/heap/include -I/home/void/esp32/esp-idf/components/log/include -I/home/void/esp32/esp-idf/components/lwip/include/apps -I/home/void/esp32/esp-idf/components/lwip/include/apps/sntp -I/home/void/esp32/esp-idf/components/lwip/lwip/src/include -I/home/void/esp32/esp-idf/components/lwip/port/esp32/include -I/home/void/esp32/esp-idf/components/lwip/port/esp32/include/arch -I/home/void/esp32/esp-idf/components/soc/include -I/home/void/esp32/esp-idf/components/soc/esp32/. -I/home/void/esp32/esp-idf/components/soc/esp32/include -I/home/void/esp32/esp-idf/components/hal/esp32/include -I/home/void/esp32/esp-idf/components/hal/include -I/home/void/esp32/esp-idf/components/hal/platform_port/include -I/home/void/esp32/esp-idf/components/esp_rom/include -I/home/void/esp32/esp-idf/components/esp_rom/include/esp32 -I/home/void/esp32/esp-idf/components/esp_rom/esp32 -I/home/void/esp32/esp-idf/components/esp_common/include -I/home/void/esp32/esp-idf/components/esp_system/include -I/home/void/esp32/esp-idf/components/esp_system/port/soc -I/home/void/esp32/esp-idf/components/esp_system/port/include/private -I/home/void/esp32/esp-idf/components/xtensa/include -I/home/void/esp32/esp-idf/components/xtensa/esp32/include -I/home/void/esp32/esp-idf/components/efuse/include -I/home/void/esp32/esp-idf/components/efuse/esp32/include -I/home/void/esp32/esp-idf/components/vfs/include -I/home/void/esp32/esp-idf/components/esp_wifi/include -I/home/void/esp32/esp-idf/components/esp_event/include -I/home/void/esp32/esp-idf/components/esp_netif/include -I/home/void/esp32/esp-idf/components/esp_eth/include -I/home/void/esp32/esp-idf/components/esp_phy/include -I/home/void/esp32/esp-idf/components/esp_phy/esp32/include -I/home/void/esp32/esp-idf/components/esp_timer/include -I/home/void/esp32/esp-idf/components/esp_ringbuf/include -I/home/void/esp32/esp-idf/components/driver/include -I/home/void/esp32/esp-idf/components/driver/deprecated -I/home/void/esp32/esp-idf/components/driver/esp32/include -I/home/void/esp32/esp-idf/components/esp_pm/include -I/home/void/esp32/esp-idf/components/mbedtls/port/include -I/home/void/esp32/esp-idf/components/mbedtls/mbedtls/include -I/home/void/esp32/esp-idf/components/mbedtls/esp_crt_bundle/include -I/home/void/esp32/esp-idf/components/mbedtls/mbedtls/library -I/home/void/esp32/esp-idf/components/app_update/include -I/home/void/esp32/esp-idf/components/spi_flash/include -I/home/void/esp32/esp-idf/components/bootloader_support/include -I/home/void/esp32/esp-idf/components/bootloader_support/bootloader_flash/include -I/home/void/esp32/esp-idf/components/nvs_flash/include -I/home/void/esp32/esp-idf/components/pthread/include -I/home/void/esp32/esp-idf/components/wpa_supplicant/include -I/home/void/esp32/esp-idf/components/wpa_supplicant/port/include -I/home/void/esp32/esp-idf/components/wpa_supplicant/esp_supplicant/include -I/home/void/esp32/esp-idf/components/app_trace/include -I/home/void/esp32/esp-idf/components/asio/asio/asio/include -I/home/void/esp32/esp-idf/components/asio/port/include -I/home/void/esp32/esp-idf/components/unity/include -I/home/void/esp32/esp-idf/components/unity/unity/src -I/home/void/esp32/esp-idf/components/cmock/CMock/src -I/home/void/esp32/esp-idf/components/console -I/home/void/esp32/esp-idf/components/http_parser -I/home/void/esp32/esp-idf/components/esp-tls -I/home/void/esp32/esp-idf/components/esp-tls/esp-tls-crypto -I/home/void/esp32/esp-idf/components/esp_adc_cal/include -I/home/void/esp32/esp-idf/components/esp_gdbstub/include -I/home/void/esp32/esp-idf/components/esp_gdbstub/xtensa -I/home/void/esp32/esp-idf/components/esp_gdbstub/esp32 -I/home/void/esp32/esp-idf/components/esp_hid/include -I/home/void/esp32/esp-idf/components/tcp_transport/include -I/home/void/esp32/esp-idf/components/esp_http_client/include -I/home/void/esp32/esp-idf/components/esp_http_server/include -I/home/void/esp32/esp-idf/components/esp_https_ota/include -I/home/void/esp32/esp-idf/components/esp_lcd/include -I/home/void/esp32/esp-idf/components/esp_lcd/interface -I/home/void/esp32/esp-idf/components/protobuf-c/protobuf-c -I/home/void/esp32/esp-idf/components/protocomm/include/common -I/home/void/esp32/esp-idf/components/protocomm/include/security -I/home/void/esp32/esp-idf/components/protocomm/include/transports -I/home/void/esp32/esp-idf/components/mdns/include -I/home/void/esp32/esp-idf/components/esp_local_ctrl/include -I/home/void/esp32/esp-idf/components/sdmmc/include -I/home/void/esp32/esp-idf/components/esp_serial_slave_link/include -I/home/void/esp32/esp-idf/components/espcoredump/include -I/home/void/esp32/esp-idf/components/espcoredump/include/port/xtensa -I/home/void/esp32/esp-idf/components/wear_levelling/include -I/home/void/esp32/esp-idf/components/fatfs/diskio -I/home/void/esp32/esp-idf/components/fatfs/vfs -I/home/void/esp32/esp-idf/components/fatfs/src -I/home/void/esp32/esp-idf/components/freemodbus/common/include -I/home/void/esp32/esp-idf/components/idf_test/include -I/home/void/esp32/esp-idf/components/idf_test/include/esp32 -I/home/void/esp32/esp-idf/components/ieee802154/include -I/home/void/esp32/esp-idf/components/json/cJSON -I/home/void/esp32/esp-idf/components/mqtt/esp-mqtt/include -I/home/void/esp32/esp-idf/components/perfmon/include -I/home/void/esp32/esp-idf/components/spiffs/include -I/home/void/esp32/esp-idf/components/ulp/ulp_common/include -I/home/void/esp32/esp-idf/components/ulp/ulp_common/include/esp32 -I/home/void/esp32/esp-idf/components/wifi_provisioning/include -I/home/void/esp32/rust-esp32-example/components/clib/include -I/home/void/esp32/rust-esp32-example/build/esp-idf/rustlib/target -mlongcalls -Wno-frame-address  -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -fmacro-prefix-map=/home/void/esp32/rust-esp32-example=. -fmacro-prefix-map=/home/void/esp32/esp-idf=/IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v5.0-dev-2137-g2f9d47c708\" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj -MF esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj -c /home/void/esp32/rust-esp32-example/main/main.c
    /home/void/esp32/rust-esp32-example/main/main.c: In function 'app_main':
    /home/void/esp32/rust-esp32-example/main/main.c:23:5: error: unknown type name 'esp_chip_info_t'; did you mean 'multi_heap_info_t'?
         esp_chip_info_t chip_info;
         ^~~~~~~~~~~~~~~
         multi_heap_info_terror=implicit-function-declaration]
         esp_chip_info(&chip_info);
         ^~~~~~~~~~~~~
         esp_rom_printf
    /home/void/esp32/rust-esp32-example/main/main.c:27:22: error: request for member 'cores' in something not a structure or union
                 chip_info.cores,
                          ^
    /home/void/esp32/rust-esp32-example/main/main.c:28:23: error: request for member 'features' in something not a structure or union
                 (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
                           ^
    /home/void/esp32/rust-esp32-example/main/main.c:28:35: error: 'CHIP_FEATURE_BT' undeclared (first use in this function)
                 (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
                                       ^~~~~~~~~~~~~~~
    /home/void/esp32/rust-esp32-example/main/main.c:28:35: note: each undeclared identifier is reported only once for each function it appears in
    /home/void/esp32/rust-esp32-example/main/main.c:29:23: error: request for member 'features' in something not a structure or union
                 (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
                           ^
    /home/void/esp32/rust-esp32-example/main/main.c:29:35: error: 'CHIP_FEATURE_BLE' undeclared (first use in this function)
                 (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
                                       ^~~~~~~~~~~~~~~~
    /home/void/esp32/rust-esp32-example/main/main.c:31:46: error: request for member 'revision' in something not a structure or union
         printf("silicon revision %d, ", chip_info.revision);
    /home/void/esp32/rust-esp32-example/main/main.c:24:5: error: implicit declaration of function 'esp_chip_info'; did you mean 'esp_rom_printf'? [-W
                                                  ^
    /home/void/esp32/rust-esp32-example/main/main.c:34:23: error: request for member 'features' in something not a structure or union
                 (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
                           ^
    /home/void/esp32/rust-esp32-example/main/main.c:34:35: error: 'CHIP_FEATURE_EMB_FLASH' undeclared (first use in this function)
                 (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
                                       ^~~~~~~~~~~~~~~~~~~~~~
    cc1: some warnings being treated as errors
    ninja: build stopped: subcommand failed.
    ninja failed with exit code 1
    
    
    opened by voidfield101 2
  • docker  run  -it espressif/idf-rust-examples fails

    docker run -it espressif/idf-rust-examples fails

    I am attempting to find a docker image that will let me build Rust apps for an Adafruit ESP32 feather. If I docker run -it espressif/idf-rust-examples it malfunctions and drops me back to the original shell.

    Detecting the Python interpreter
    Checking "python" ...
    Python 3.8.10
    "python" has been detected
    Adding ESP-IDF tools to PATH...
    Using Python interpreter in /opt/esp/python_env/idf5.0_py3.8_env/bin/python
    Checking if Python packages are up to date...
    Downloading espidf.constraints.v5.0.txt to /root/.espressif/espidf.constraints.v5.0.txt.tmp
    Done
    Constraint file: /root/.espressif/espidf.constraints.v5.0.txt
    Requirement files:
     - /opt/esp/idf/requirements.core.txt
    Python being checked: /opt/esp/python_env/idf5.0_py3.8_env/bin/python
    The following Python requirements are not satisfied:
    idf-component-manager~=1.1
    To install the missing packages, please run "install.sh"
    Diagnostic information:
        IDF_PYTHON_ENV_PATH: /opt/esp/python_env/idf5.0_py3.8_env
        Python interpreter used: /opt/esp/python_env/idf5.0_py3.8_env/bin/python
    

    It seems that the Dockerfile needs some fixes.

    opened by mutantbob 4
  • Can't compile the example - invalid certificate

    Can't compile the example - invalid certificate

    [ 64%] Built target mbedtls
    [ 64%] Generating x509_crt_bundle
    gen_crt_bundle.py: Invalid certificate in /home/raay/Workspace/Robotics/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem
    Invalid certificate
    make[2]: *** [esp-idf/mbedtls/CMakeFiles/__idf_mbedtls.dir/build.make:67: esp-idf/mbedtls/x509_crt_bundle] Error 2
    make[1]: *** [CMakeFiles/Makefile2:2485: esp-idf/mbedtls/CMakeFiles/__idf_mbedtls.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
       Compiling toml v0.5.8
       Compiling rustlib v0.1.0 (/home/raay/Workspace/Robotics/rust-esp32-example/components/rustlib)
    error: failed to run custom build command for `rustlib v0.1.0 (/home/raay/Workspace/Robotics/rust-esp32-example/components/rustlib)`
    
    Caused by:
      process didn't exit successfully: `/home/raay/Workspace/Robotics/rust-esp32-example/build/esp-idf/rustlib/target/release/build/rustlib-88b5bbc1e09b33a8/build-script-build` (exit status: 101)
      --- stdout
      cargo:rerun-if-changed=/home/raay/Workspace/Robotics/rust-esp32-example/build/esp-idf/rustlib/target/RustApi.h
    
      --- stderr
      thread 'main' panicked at 'libclang error; possible causes include:
      - Invalid flag syntax
      - Unrecognized flags
      - Invalid flag arguments
      - File I/O errors
      - Host vs. target architecture mismatch
      If you encounter an error missing from this list, please file an issue or a PR!', /home/raay/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.58.1/src/ir/context.rs:535:15
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    make[2]: *** [esp-idf/rustlib/CMakeFiles/rustlib_project.dir/build.make:112: esp-idf/rustlib/stamp/rustlib_project-build] Error 101
    make[1]: *** [CMakeFiles/Makefile2:4931: esp-idf/rustlib/CMakeFiles/rustlib_project.dir/all] Error 2
    make: *** [Makefile:130: all] Error 2
    make failed with exit code 2
    
    opened by raaymax 1
  • Slow build time when using the Docker container

    Slow build time when using the Docker container

    Hi,

    thanks for the amazing work on Rust for embedded ESP, I've been successfully using the Docker container to build the code, but the last step of the build (the linking) seems to be very slow, taking perhaps 1h on my recent osX machine,

    do you know what could be the cause of this issue? For now this is a bit blocking, because we would love to use a containerized environment for development, but we can't have build times that are more than 1 or 2 minutes for a simple code

    opened by maelp 3
Owner
Espressif Systems
Espressif Systems
A basic rp2040-hal project with blinky and rtt logging example code.

A basic rp2040-hal project with blinky and rtt logging example code. With this you can quickly get started on a new rp2040 project

rp-rs 202 Jan 6, 2023
Kalker (or "kalk") is a calculator program/website that supports user-defined variables, functions, derivation, and integration

Kalker (or "kalk") is a calculator program/website that supports user-defined variables, functions, derivation, and integration. It runs on Windows, macOS, Linux, Android, and in web browsers (with WebAssembly).

null 1.2k Dec 27, 2022
Help project managers and project owners with easy-to-understand views of github issue dependencies.

Help project managers and project owners with easy-to-understand views of github issue dependencies.

nasa 56 Dec 15, 2022
ESP32-C3 interfacing to a PS/2 Keyboard (bare-metal Rust)

ESP32-C3 interfacing to a PS/2 Keyboard (bare-metal Rust) Very simplified example of connecting a PS/2 keyboard to ESP32-C3 You need to build it with

Björn Quentin 3 Dec 5, 2022
Rust implementation of ESP32 NVS partition generator.

Simple ESP32 NVS writer library for Rust Overview A library for Rust to generate NVS partitions for ESP32. How to use See examples/write_simple.rs. Ma

Kenta IDA 4 Dec 29, 2022
Esp-backtrace - backtrace for ESP32 bare-metal

esp-backtrace - backtrace for ESP32 bare-metal supports ESP32, ESP32C3, ESP32S2, ESP32S3 optional features: panic-handler, exception-handler (will ena

Björn Quentin 10 Dec 14, 2022
Backtrace for ESP32 bare-metal

esp-backtrace - backtrace for ESP32 bare-metal supports ESP32, ESP32C3, ESP32S2, ESP32S3 optional features: panic-handler, exception-handler (will ena

esp-rs 10 Dec 14, 2022
Demo of tokio running on esp32 using esp-idf

Tokio running on esp32! This repo demonstrates a working hello world utilizing upstreamed tokio support for esp32. The tokio executor and I/O reactor

Josh Guilfoyle 9 Aug 7, 2023
Embedded demo based on esp32-c3

wot-esp-demo Demo Hygro-Thermometer based on the esp-rust-board. http version based on std-training Deploy Rust prerequisites Install espflash, ldprox

null 3 Dec 1, 2023
Egui integration for nannou

nannou_egui This is my egui integration for nannou. The purpose of this is to allow you to tune values for your generative art creations without requi

Alexandru Ene 28 Oct 12, 2022
Create That Project. Project Creation That Rocks 🎸🧱.

Create That Project Config Example Install $ cargo install ctp Basic Info In any file or even in the commands sections of your config file you can pla

Will 5 Dec 20, 2021
An example Kibana plugin written in Rust and Typescript

An example Kibana plugin written in Rust and Typescript

Aleh Zasypkin 3 Dec 24, 2022
The Voting example based on MoonZoon and Solana.

Voting example The Rust-only Voting example based on MoonZoon and Solana. MoonZoon is a Rust Fullstack Framework. Solana is a decentralized blockchain

Martin Kavík 26 Dec 8, 2022
Rust / C / Cgo example

whatever How to build (This has been tested on Linux & macOS) Build the Rust code: $ cargo build The library is in ./target/debug/libwhatever.a Build

Amos Wenger 6 Jun 21, 2022
A variation of the solana helloworld program example with a client written in Rust instead of Typescript

Simple Solana Smart Contract Example This repository demonstrates how to create and invoke a program on the Solana blockchain. In Solana the word prog

zeke 56 Dec 26, 2022
An example of Brainf*** JIT-compiler with only the standard library.

jit-compiler An example of Brainf*** JIT-compiler with only the standard library. Prerequisite Rust(1.56.0-nightly or later, but it must work kind of

Akihito KIRISAKI 18 Jan 22, 2022
Example of structuring a proc macro crate for testability

testing-proc-macros Example of structuring a proc macro crate for testability. See accompanying blog post for details. License Licensed under either o

Ferrous Systems 12 Dec 11, 2022
A example bevy application using bevy-kajiya for its renderer

☀️ bevy-kajiya playground A example bevy application using bevy-kajiya for its renderer NOTE: only tested on Windows. For more context, check out the

Sebastian Hamel 20 Dec 5, 2022
Abstract GPU Project - The easiest and most ergonomic GPU library

Abstract GPU Project - The easiest and most ergonomic GPU library

LyricWulf 9 Nov 30, 2022