Open RoyalFoxy opened 1 day ago
I found out more information about this issue. If I create a template for the c6 processor it doesn't find the core crate but for the default esp32 processor rustc fails to compile as llvm doesn't find the triplet
So trying to compile for the c6 processor with the master branch of the template or the 5.1 version doesn't work either and spits out the same "crate core not found" error
It works with dev containers but is a lot slower as I'm on an m2 processor so the container needs to be emulated 🫠 But at least it works for now. Would still like some help for my issue
what is the output of rustup show
?
In general if you are not specifying a toolchain manually, we always use the toolchain that is specified inside the rust-toolchain.toml
that is inside your project root dir.
@RoyalFoxy
I have an existing project that "compiles" but gets stuck on the core crate as it apparently does not exist.
Crates core
, std
, panic_abort
and so on are built with your project every time you do cargo build
. They are not available "per-se", because all ESP IDF targets are Tier 3.
For this to happen, you must have a properly configured .cargo/config.toml
in your binary crate root (look there for a TOML section named [unstable]
).
esp-idf-template
does that for you, but if you have another .cargo/config.toml
in a parent or grand-parent directory of your binary crate, it will mess up things.
Further, you should either use rust "nightly" (rustup default nightly
), or rust "esp" (look at the "espup" documentation in this GH project README). What toolchain you are currently using can be seen with rustup show
.
I also suggest you read the README of this project carefully, top to bottom and make sure you applied have all steps, and nothing more.
For example, don't try to be adventurous by installing and activating ESP-IDF yourself. This is possible, but is an advanced configuration better avoided initially.
@Vollbrecht This is the output
Default host: aarch64-apple-darwin
rustup home: /Users/royalfoxy/.rustup
installed toolchains
--------------------
stable-aarch64-apple-darwin (default)
nightly-2021-01-07-aarch64-apple-darwin
nightly-2022-08-08-aarch64-apple-darwin
nightly-2023-08-08-aarch64-apple-darwin
nightly-2024-03-22-aarch64-apple-darwin
nightly-2024-04-11-aarch64-apple-darwin
nightly-2024-04-17-aarch64-apple-darwin
nightly-aarch64-apple-darwin
1.61.0-aarch64-apple-darwin
esp
installed targets for active toolchain
--------------------------------------
aarch64-apple-darwin
riscv32imac-unknown-none-elf
riscv32imafc-unknown-none-elf
riscv32imc-unknown-none-elf
active toolchain
----------------
nightly-aarch64-apple-darwin (overridden by '/Users/royalfoxy/files/school/programming/m245/m5-nano-c6/rust-toolchain.toml')
rustc 1.83.0-nightly (18b1161ec 2024-10-02)
and I didn't specify any toolchain myself and relied on the template itself to work as it did in the past
@ivmarkov I'm aware they arent shipped pre compiled, by not found/available I meant that the rust compiler literally said "can't find crate for core
". I also didn't alter my config.toml besides the baudrate and the CRATE_CC_NO_DEFAULTS
if Im not mistaken.
[build]
target = "riscv32imac-esp-espidf"
[target.riscv32imac-esp-espidf]
linker = "ldproxy"
runner = "espflash flash --monitor --baud 460800"
rustflags = [ "--cfg", "espidf_time64"]
[unstable]
build-std = ["std", "panic_abort"]
[env]
MCU="esp32c6"
ESP_IDF_VERSION = "v5.2.2"
CRATE_CC_NO_DEFAULTS = "1"
I also did use espup like I did in the past and it always worked until it magically didn't anymore. I updated nothing regarding espup and just opened the project and tried to flash my esp32-c6 but then it complained it can't find the crate core all of the sudden which it didn't the week prior.
Switching the toolchain nightly also changed nothing sadly
I also didn't install esp-idf myself for development with rust, I actually did so with the python scripts provided by their devs and had to do so as I was programming in a c++ codebase for a bit but as I stated, that never effected anything for over a year so that shouldn't be an issue.
I already read through all the prerequisites and how to use this template with cargo generate and tried it multiple times but never could get it to build
Bug description
I generated a fresh esp-idf template project with the command
cargo generate esp-rs/esp-idf-template cargo
and it doesn't build. I get this errorI have an existing project that "compiles" but gets stuck on the core crate as it apparently does not exist.
As a side note, it worked perfectly fine before for months and suddenly it stopped compiling and I got the second error. I tried creating new template projects and I got the same error at first but then I went through the entire book again to install everything from scratch and checked the links in the bug issue template. Nothing seemed to work.
To Reproduce
Steps to reproduce the behavior:
Likely not reproducible but I'll try :)
cargo generate esp-rs/esp-idf-template cargo
cargo build
Creating a project from the master branch also doesn't build for me
Have it build the template like before
Additional context
I tried installing everything like 10 times already so that may've bricked something... I also did work with an esp-idf project (not rust) one like exactly 1 year ago~ and it has worked afterwards regardless of it and just now broke but maybe it has to do something with it