-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not find specification for target "xtensa-esp32-espidf" #159
Comments
Can you |
➜ rust-esp32-std-demo git:(main) ✗ echo $LIBCLANG_PATH error: failed to run Caused by: |
It looks like you are not using the By the way, I would recommend posting questions like this one in the |
Hello,
But due to this error i figured the issue out. It seems like the rust version installed via homebrew isn't compatible. Thanks a lot! |
Try using release mode: |
➜ rust-esp32-std-demo git:(main) ✗ cargo +esp espflash /dev/tty.usbserial-0001 --release
Chip type: ESP32 (revision 1) Tried that too, still too large... |
Is your project open source? |
I'm currently building the demo application: https://github.com/ivmarkov/rust-esp32-std-demo |
I stripped the example project down until it fitted into the available space. Again: Thanks a lot! |
Hello,
i want to get started with my esp32 using rust. Unfortunately i'm unable to build the example project.
What i did so far:
`➜ Development git clone https://github.com/ivmarkov/rust-esp32-std-demo
Cloning into 'rust-esp32-std-demo'...
remote: Enumerating objects: 1009, done.
remote: Counting objects: 100% (1009/1009), done.
remote: Compressing objects: 100% (302/302), done.
remote: Total 1009 (delta 554), reused 978 (delta 538), pack-reused 0
Receiving objects: 100% (1009/1009), 663.16 KiB | 6.50 MiB/s, done.
Resolving deltas: 100% (554/554), done.
➜ Development cd rust-esp32-std-demo
➜ rust-esp32-std-demo git:(main) curl -LO https://github.com/esp-rs/rust-build/releases/download/v1.64.0.0/install-rust-toolchain.sh
chmod a+x install-rust-toolchain.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 26193 100 26193 0 0 42359 0 --:--:-- --:--:-- --:--:-- 42359
➜ rust-esp32-std-demo git:(main) ✗ curl -LO https://github.com/esp-rs/rust-build/releases/download/v1.64.0.0/install-rust-toolchain.sh
chmod a+x install-rust-toolchain.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 26193 100 26193 0 0 63166 0 --:--:-- --:--:-- --:--:-- 63166
➜ rust-esp32-std-demo git:(main) ✗ ./install-rust-toolchain.sh -i reinstall
Processing configuration:
--build-target = esp32,esp32s2,esp32s3
--cargo-home = /Users/sk/.cargo
--clear-cache = YES
--esp-idf-version =
--export-file = export-esp.sh
--extra-crates = ldproxy cargo-espflash
--installation-mode = reinstall
--llvm-version = esp-14.0.0-20220415
--minified-esp-idf = NO
--minified-llvm = YES
--nightly-version = nightly
--rustup-home = /Users/sk/.rustup
--toolchain-version = 1.64.0.0
--toolchain-destination = /Users/sk/.rustup/toolchains/esp
/Users/sk/.cargo/bin/rustup
nightly-aarch64-apple-darwin
Processing toolchain for aarch64-apple-darwin - operation: reinstall
Removing:
/Users/sk/.rustup/toolchains/esp
/Users/sk/.espressif/tools/xtensa-esp32-elf-clang/esp-14.0.0-20220415-aarch64-apple-darwin
Removing cached dist files:
rust-1.64.0.0-aarch64-apple-darwin
rust-1.64.0.0-aarch64-apple-darwin.tar.xz
rust-src-1.64.0.0
rust-src-1.64.0.0.tar.xz
xtensa-esp32-elf-llvm14_0_0-esp-14.0.0-20220415-aarch64-apple-darwin.tar.xz
-elf-gcc.tar.gz
** downloading: https://github.com/esp-rs/rust-build/releases/download/v1.64.0.0/rust-1.64.0.0-aarch64-apple-darwin.tar.xz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 77.5M 100 77.5M 0 0 8753k 0 0:00:09 0:00:09 --:--:-- 9430k
install: creating uninstall script at /Users/sk/.rustup/toolchains/esp/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'rust-std-aarch64-apple-darwin'
install: installing component 'cargo'
install: installing component 'rustfmt-preview'
install: installing component 'clippy-preview'
rust installed.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 2379k 100 2379k 0 0 2760k 0 --:--:-- --:--:-- --:--:-- 9066k
install: creating uninstall script at /Users/sk/.rustup/toolchains/esp/lib/rustlib/uninstall.sh
install: installing component 'rust-src'
already installed
already installed
already installed
** Downloading https://github.com/esp-rs/rust-build/releases/download/llvm-project-14.0-minified/xtensa-esp32-elf-llvm14_0_0-esp-14.0.0-20220415-aarch64-apple-darwin.tar.xz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 10.2M 100 10.2M 0 0 5347k 0 0:00:01 0:00:01 --:--:-- 7823k
done
Removing cached dist files:
IMPORTANT!
The following environment variables need to be updated:
export LIBCLANG_PATH="/Users/sk/.espressif/tools/xtensa-esp32-elf-clang/esp-14.0.0-20220415-aarch64-apple-darwin/lib/"
export PATH="/Users/sk/.espressif/tools/xtensa-esp32-elf-gcc/8_4_0-esp-2021r2-patch3-aarch64-apple-darwin/bin/:/Users/sk/.espressif/tools/xtensa-esp32s2-elf-gcc/8_4_0-esp-2021r2-patch3-aarch64-apple-darwin/bin/:/Users/sk/.espressif/tools/xtensa-esp32s3-elf-gcc/8_4_0-esp-2021r2-patch3-aarch64-apple-darwin/bin/:$PATH"
If you want to activate the ESP-RS environment in every terminal session automatically, you can the previous commands to "/Users/sk/.zshrc"
However, it is not recommended, as doing so activates ESP-RS virtual environment in every terminal session (including those where ESP-RS is not needed), defeating the purpose of the virtual environment and likely affecting other software.
The reccomended approach is to source the export file: ". export-esp.sh"
Note: This should be done in every terminal session.
➜ rust-esp32-std-demo git:(main) ✗ source export-esp.sh
➜ rust-esp32-std-demo git:(main) ✗ rustup override set esp
info: override toolchain for '/Users/sk/Development/rust-esp32-std-demo' set to 'esp'
➜ rust-esp32-std-demo git:(main) ✗ cargo build
error: failed to run
rustc
to learn about target-specific informationCaused by:
process didn't exit successfully:
rustc - --crate-name ___ --print=file-names --target xtensa-esp32-espidf --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg
(exit status: 1)--- stderr
error: Error loading target specification: Could not find specification for target "xtensa-esp32-espidf". Run
rustc --print target-list
for a list of built-in targets➜ rust-esp32-std-demo git:(main) ✗ `
➜ rust-esp32-std-demo git:(main) ✗ cat .cargo/config.toml
[build]
Uncomment the relevant target for your chip here (ESP32, ESP32-S2, ESP32-S3 or ESP32-C3)
target = "xtensa-esp32-espidf"
#target = "xtensa-esp32s2-espidf"
#target = "xtensa-esp32s3-espidf"
#target = "riscv32imc-esp-espidf"
[target.xtensa-esp32-espidf]
linker = "ldproxy"
[target.xtensa-esp32s2-espidf]
linker = "ldproxy"
[target.xtensa-esp32s3-espidf]
linker = "ldproxy"
[target.riscv32imc-esp-espidf]
linker = "ldproxy"
Future - necessary for the experimental "native build" of esp-idf-sys with ESP32C3
See also esp-rs/embuild#16
rustflags = ["-C", "default-linker-libraries"]
[unstable]
build-std = ["std", "panic_abort"]
#build-std-features = ["panic_immediate_abort"] # Only necessary if building against ESP-IDF tag
v4.3.2
(the minimum supported version)[env]
Uncomment this and use the esp-idf-sys "native" build feature (
cargo build --features native
) to build against ESP-IDF 5.0 (master)#ESP_IDF_VERSION = { value = "master" }
Comment out this when using the PlatformIO build (it only supports
v4.3.2
)ESP_IDF_VERSION = { value = "release/v4.4" }
These configurations will pick up your custom "sdkconfig.release", "sdkconfig.debug" or "sdkconfig.defaults[.*]" files
that you might put in the root of the project
The easiest way to generate a full "sdkconfig" configuration (as opposed to manually enabling only the necessary flags via "sdkconfig.defaults[.*]"
is by running "cargo pio espidf menuconfig" (that is, if using the pio builder)
#ESP_IDF_SDKCONFIG = { value = "sdkconfig.release;sdkconfig.debug" }
ESP_IDF_SDKCONFIG_DEFAULTS = { value = "sdkconfig.defaults;sdkconfig.defaults.esp32;sdkconfig.defaults.esp32s2" }
Am i missing something?
The text was updated successfully, but these errors were encountered: