Skip to content
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

Unable to cargo run on hardware-check #262

Closed
adrien3d opened this issue Jul 10, 2024 · 6 comments
Closed

Unable to cargo run on hardware-check #262

adrien3d opened this issue Jul 10, 2024 · 6 comments

Comments

@adrien3d
Copy link

Hello,

My setup is working well with esp-idf when I am developping in C, and I've followed every step in the guide for Rust.

But, when running cargo run, I have the following result:

    It fails with the following output:

      Change Dir: /Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeTmp

      Run Build Command(s):/Users/adrien/.espressif/tools/ninja/1.11.1/ninja cmTC_d1cd7 && [1/2] Building C object CMakeFiles/cmTC_d1cd7.dir/testCCompiler.c.obj
      FAILED: CMakeFiles/cmTC_d1cd7.dir/testCCompiler.c.obj
      /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc   -march=rv32imc_zicsr_zifencei  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf -o CMakeFiles/cmTC_d1cd7.dir/testCCompiler.c.obj -c /Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      riscv32-esp-elf-gcc: error: unrecognized command-line option '--target=riscv32imc_zicsr_zifencei-esp-espidf'
      ninja: build stopped: subcommand failed.





    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    /Users/adrien/Dev/esp/esp-idf/tools/cmake/project.cmake:506 (__project)
    CMakeLists.txt:28 (project)


  thread 'main' panicked at /Users/adrien/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/ba1d7f4a083e6402679105115ded645512a7aea8/library/std/src/panicking.rs:661:5
     1: core::panicking::panic_fmt
               at /rustc/ba1d7f4a083e6402679105115ded645512a7aea8/library/core/src/panicking.rs:74:14
     2: cmake::fail
               at /Users/adrien/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5
     3: cmake::run
               at /Users/adrien/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1076:9
     4: cmake::Config::build
               at /Users/adrien/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:813:13
     5: build_script_build::native::cargo_driver::build
               at ./build/native/cargo_driver.rs:527:5
     6: build_script_build::native::build
               at ./build/native.rs:17:9
     7: build_script_build::main
               at ./build/build.rs:51:24
     8: core::ops::function::FnOnce::call_once
               at /rustc/ba1d7f4a083e6402679105115ded645512a7aea8/library/core/src/ops/function.rs:250:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
➜  hardware-check git:(main) clear

➜  hardware-check git:(main) cargo run
   Compiling esp-idf-sys v0.35.0
The following warnings were emitted during compilation:

warning: [email protected]: Configuring first supported MCU 'esp32c3' derived from the build target 'riscv32imc-esp-espidf' supporting MCUs [esp32c3, esp32c2]; explicitly specify an MCU to resolve this ambiguity
warning: [email protected]: Ignoring activated esp-idf environment: ESP_IDF_TOOLS_INSTALL_DIR != fromenv
warning: [email protected]: Ignoring configuration setting `ESP_IDF_VERSION` (Tag v5.2): custom esp-idf repository detected via $IDF_PATH

error: failed to run custom build command for `esp-idf-sys v0.35.0`

Caused by:
  process didn't exit successfully: `/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/debug/build/esp-idf-sys-bcf67bf22311802d/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=MCU
  cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=EXTRA-COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
  cargo:warning=Configuring first supported MCU 'esp32c3' derived from the build target 'riscv32imc-esp-espidf' supporting MCUs [esp32c3, esp32c2]; explicitly specify an MCU to resolve this ambiguity
  cargo:warning=Ignoring activated esp-idf environment: ESP_IDF_TOOLS_INSTALL_DIR != fromenv
  cargo:warning=Ignoring configuration setting `ESP_IDF_VERSION` (Tag v5.2): custom esp-idf repository detected via $IDF_PATH
  Python 3.10.1
  pip 24.1.2 from /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages/pip (python 3.10)
  Requirement already satisfied: pip in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (24.1.2)
  Requirement already satisfied: setuptools in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (70.3.0)
  Looking in indexes: https://pypi.org/simple, https://dl.espressif.com/pypi
  Ignoring importlib_metadata: markers 'python_version < "3.8"' don't match your environment
  Requirement already satisfied: setuptools in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 3)) (70.3.0)
  Requirement already satisfied: packaging in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 4)) (24.1)
  Requirement already satisfied: click in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 7)) (8.1.7)
  Requirement already satisfied: pyserial in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 8)) (3.5)
  Requirement already satisfied: cryptography in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 9)) (41.0.7)
  Requirement already satisfied: pyparsing in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 10)) (3.1.2)
  Requirement already satisfied: pyelftools in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 11)) (0.31)
  Requirement already satisfied: idf-component-manager in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (1.5.3)
  Requirement already satisfied: esp-coredump in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 13)) (1.11.0)
  Requirement already satisfied: esptool in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 14)) (4.7.0)
  Requirement already satisfied: esp-idf-kconfig in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 15)) (1.4.2)
  Requirement already satisfied: esp-idf-monitor in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 16)) (1.4.0)
  Requirement already satisfied: esp-idf-size in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 17)) (1.5.0)
  Requirement already satisfied: esp-idf-panic-decoder in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 18)) (1.1.0)
  Requirement already satisfied: pyclang in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 19)) (0.4.2)
  Requirement already satisfied: construct in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 20)) (2.10.70)
  Requirement already satisfied: freertos_gdb in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 23)) (1.0.3)
  Requirement already satisfied: cffi>=1.12 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cryptography->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 9)) (1.16.0)
  Requirement already satisfied: requests<3 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (2.32.3)
  Requirement already satisfied: urllib3<2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (1.26.19)
  Requirement already satisfied: requests-file<2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (1.5.1)
  Requirement already satisfied: requests-toolbelt in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (1.0.0)
  Requirement already satisfied: schema<=0.7.5 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (0.7.5)
  Requirement already satisfied: six in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (1.16.0)
  Requirement already satisfied: tqdm<5 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (4.66.4)
  Requirement already satisfied: colorama in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (0.4.6)
  Requirement already satisfied: pyyaml>5.2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (6.0.1)
  Requirement already satisfied: cachecontrol>0.12.6 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (0.14.0)
  Requirement already satisfied: contextlib2>0.6.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (21.6.0)
  Requirement already satisfied: pygdbmi>=0.9.0.2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esp-coredump->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 13)) (0.11.0.0)
  Requirement already satisfied: bitstring>=3.1.6 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esptool->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 14)) (4.2.3)
  Requirement already satisfied: ecdsa>=0.16.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esptool->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 14)) (0.19.0)
  Requirement already satisfied: reedsolo<1.8,>=1.5.3 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esptool->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 14)) (1.7.0)
  Requirement already satisfied: intelhex in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esptool->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 14)) (2.3.0)
  Requirement already satisfied: kconfiglib>=13.7.1 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esp-idf-kconfig->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 15)) (14.1.0)
  Requirement already satisfied: rich in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esp-idf-size->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 17)) (13.7.1)
  Requirement already satisfied: bitarray<3.0.0,>=2.9.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from bitstring>=3.1.6->esptool->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 14)) (2.9.2)
  Requirement already satisfied: msgpack<2.0.0,>=0.5.2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cachecontrol>0.12.6->cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (1.0.8)
  Requirement already satisfied: filelock>=3.8.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (3.15.3)
  Requirement already satisfied: pycparser in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cffi>=1.12->cryptography->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 9)) (2.22)
  Requirement already satisfied: charset-normalizer<4,>=2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from requests<3->idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (3.3.2)
  Requirement already satisfied: idna<4,>=2.5 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from requests<3->idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (3.7)
  Requirement already satisfied: certifi>=2017.4.17 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from requests<3->idf-component-manager->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 12)) (2024.6.2)
  Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from rich->esp-idf-size->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 17)) (3.0.0)
  Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from rich->esp-idf-size->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 17)) (2.18.0)
  Requirement already satisfied: mdurl~=0.1 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich->esp-idf-size->-r /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt (line 17)) (0.1.2)
  Upgrading pip and setuptools...
  Skipping the download of /Users/adrien/.espressif/espidf.constraints.v5.2.txt because it was downloaded recently.
  Installing Python packages
   Constraint file: /Users/adrien/.espressif/espidf.constraints.v5.2.txt
   Requirement files:
    - /Users/adrien/Dev/esp/esp-idf/tools/requirements/requirements.core.txt
  cargo:rerun-if-changed=/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/sdkconfig.defaults
  CMAKE_PREFIX_PATH_riscv32imc_zicsr_zifencei-esp-espidf = None
  CMAKE_PREFIX_PATH_riscv32imc_zicsr_zifencei_esp_espidf = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_riscv32imc_zicsr_zifencei-esp-espidf = None
  CMAKE_riscv32imc_zicsr_zifencei_esp_espidf = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/Users/adrien/Dev/esp/esp-idf" IDF_TARGET="esp32c3" IDF_TOOLS_PATH="/Users/adrien/.espressif" PATH="/Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/Users/adrien/.espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/adrien/.espressif/tools/ninja/1.11.1:/Users/adrien/.espressif/python_env/idf5.2_py3.10_env/bin:/Users/adrien/Dev/esp/esp-idf/components/espcoredump:/Users/adrien/Dev/esp/esp-idf/components/partition_table:/Users/adrien/Dev/esp/esp-idf/components/app_update:/Users/adrien/.espressif/tools/xtensa-esp-elf-gdb/14.2_20240403/xtensa-esp-elf-gdb/bin:/Users/adrien/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/adrien/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/adrien/.espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/adrien/.espressif/tools/openocd-esp32/v0.12.0-esp32-20240318/openocd-esp32/bin:/Users/adrien/.espressif/tools/ninja/1.11.1/:/Users/adrien/.espressif/tools/xtensa-esp-elf-gdb/14.2_20240403/xtensa-esp-elf-gdb/bin:/Users/adrien/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/adrien/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/adrien/.espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/adrien/.espressif/tools/openocd-esp32/v0.12.0-esp32-20240318/openocd-esp32/bin:/Users/adrien/.espressif/tools/ninja/1.11.1/:/Users/adrien/.espressif/python_env/idf5.2_py3.10_env/bin:/Users/adrien/Dev/esp/esp-idf/tools:/opt/homebrew/sbin:/Users/adrien/.pyenv/shims:/Users/adrien/.pyenv/bin:/Users/adrien/miniforge3/condabin:/Users/adrien/.nvm/versions/node/v14.17.4/bin:/usr/local/sbin:/usr/local/opt/llvm/bin:/Users/adrien/.rustup/toolchains/esp/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/adrien/.rustup/toolchains/esp/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/adrien/.rustup/toolchains/esp/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/adrien/.rustup/toolchains/esp/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/opt/homebrew/bin:/Users/adrien/.local/bin:/opt/homebrew/Cellar:/opt/homebrew/opt/make/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/gcc-arm-none-eabi-8-2019-q3-update/bin:/usr/local/nRF-Command-Line-Tools_10_13_0/mergehex:/usr/local/nRF-Command-Line-Tools_10_13_0/nrfjprog:/Users/adrien/pebble-dev/pebble-sdk-4.5-mac/bin:/usr/local/go/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/tools:/platform-tools:/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle:/Users/adrien/Dev/esp/xtensa-esp32-elf/bin:/Users/adrien/.cargo/bin:/usr/local/flutter/bin:/Users/adrien/.ebcli-virtual-env/executables:/Users/adrien/Dev/go/bin" PROJECT_DIR="/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check" SDKCONFIG_DEFAULTS="/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/gen-sdkconfig.defaults;/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/sdkconfig.defaults" "cmake" "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/Users/adrien/Dev/esp/esp-idf/tools/cmake/toolchain-esp32c3.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/Users/adrien/.espressif/python_env/idf5.2_py3.10_env/bin/python" "-DCMAKE_INSTALL_PREFIX=/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out" "-DCMAKE_C_FLAGS= -march=rv32imc_zicsr_zifencei -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf" "-DCMAKE_CXX_FLAGS= -march=rv32imc_zicsr_zifencei -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf" "-DCMAKE_ASM_FLAGS=  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf"
  -- The C compiler identification is GNU 13.2.0
  -- The CXX compiler identification is GNU 13.2.0
  -- The ASM compiler identification is GNU
  -- Found assembler: /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
  -- Check for working C compiler: /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc - broken
  -- Configuring incomplete, errors occurred!
  See also "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeOutput.log".
  See also "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: Some(
          Global,
      ),
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: Some(
          [
              "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/./sdkconfig.defaults",
          ],
      ),
      mcu: None,
      native: NativeConfig {
          esp_idf_version: Some(
              Tag(
                  "v5.2",
              ),
          ),
          esp_idf_repository: None,
          esp_idf_cmake_generator: None,
          idf_path: Some(
              "/Users/adrien/Dev/esp/esp-idf",
          ),
          extra_components: [],
          esp_idf_components: None,
          esp_idf_component_manager: None,
      },
      esp_idf_sys_root_crate: None,
  }
  Using custom user-supplied esp-idf repository at '/Users/adrien/Dev/esp/esp-idf' (detected from env variable `IDF_PATH`)
  Using esp-idf v5.2.2 at '/Users/adrien/Dev/esp/esp-idf'
  CMake Error at /Users/adrien/.espressif/tools/cmake/3.24.0/CMake.app/Contents/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeTmp
      
      Run Build Command(s):/Users/adrien/.espressif/tools/ninja/1.11.1/ninja cmTC_23ce2 && [1/2] Building C object CMakeFiles/cmTC_23ce2.dir/testCCompiler.c.obj
      FAILED: CMakeFiles/cmTC_23ce2.dir/testCCompiler.c.obj 
      /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc   -march=rv32imc_zicsr_zifencei  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf -o CMakeFiles/cmTC_23ce2.dir/testCCompiler.c.obj -c /Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      riscv32-esp-elf-gcc: error: unrecognized command-line option '--target=riscv32imc_zicsr_zifencei-esp-espidf'
      ninja: build stopped: subcommand failed.
      
      

    

    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    /Users/adrien/Dev/esp/esp-idf/tools/cmake/project.cmake:506 (__project)
    CMakeLists.txt:28 (project)


  thread 'main' panicked at /Users/adrien/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Any idea on how I can fix this ?

@Vollbrecht
Copy link
Contributor

You mention that you have experience with C IDF framework. Does your current environment have a IDF version activated?
Can you check that you don't provide a IDF_PATH and a ESP_IDF_VERSION env, and thouse not overriding the values used in our .config.toml.

In the training we setup a cloned version of ESP_IDF inside the .espressif dir according to the version that is set via the ESP_IDF_VERSION env variable and also try to populate the correct versioned compiler for that ESP-IDF version according the recommendation.

Furthermore can you go into /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc and check the output of ./riscv32-esp-elf-gcc --version

@adrien3d
Copy link
Author

Thanks for your quick answer.
I've tried to unset both variables, but still not successfull:

➜  hardware-check git:(main) unset ESP_IDF_VERSION
➜  hardware-check git:(main) unset IDF_PATH       
➜  hardware-check git:(main) cargo run
   Compiling esp-idf-sys v0.35.0
The following warnings were emitted during compilation:

warning: [email protected]: Configuring first supported MCU 'esp32c3' derived from the build target 'riscv32imc-esp-espidf' supporting MCUs [esp32c3, esp32c2]; explicitly specify an MCU to resolve this ambiguity

error: failed to run custom build command for `esp-idf-sys v0.35.0`

Caused by:
  process didn't exit successfully: `/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/debug/build/esp-idf-sys-bcf67bf22311802d/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=MCU
  cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=EXTRA-COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
  cargo:warning=Configuring first supported MCU 'esp32c3' derived from the build target 'riscv32imc-esp-espidf' supporting MCUs [esp32c3, esp32c2]; explicitly specify an MCU to resolve this ambiguity
  Submodule path 'components/bootloader/subproject/components/micro-ecc/micro-ecc': checked out '24c60e243580c7868f4334a1ba3123481fe1aa48'
  Submodule path 'components/bt/controller/lib_esp32': checked out '43ecd22ec6b5b484709693ae8e86478a7f130f17'
  Submodule path 'components/bt/controller/lib_esp32c2/esp32c2-bt-lib': checked out 'b9a902c3551ef4a2032b6662a4cbb018125ddfda'
  Submodule path 'components/bt/controller/lib_esp32c3_family': checked out '76ed4114ee7d081435a3c65793b4c8eb1dfaf199'
  Submodule path 'components/bt/controller/lib_esp32c6/esp32c6-bt-lib': checked out '0af472c6f95858e638565dad19a79fe47de1fff2'
  Submodule path 'components/bt/controller/lib_esp32h2/esp32h2-bt-lib': checked out '70612d08d1ff94dfb5da99d6a68aa4032cd63276'
  Submodule path 'components/bt/esp_ble_mesh/lib/lib': checked out '4934ca903807dd74f7f808dadcd9a478e18fc6c3'
  Submodule path 'components/bt/host/nimble/nimble': checked out 'a2acac3e14bb7810783ac5089ccf8229a2dd2f70'
  Submodule path 'components/cmock/CMock': checked out 'eeecc49ce8af123cf8ad40efdb9673e37b56230f'
  Submodule path 'components/cmock/CMock/vendor/c_exception': checked out '71b47be7c950f1bf5f7e5303779fa99a16224bb6'
  Submodule path 'components/cmock/CMock/vendor/unity': checked out 'cf949f45ca6d172a177b00da21310607b97bc7a7'
  Submodule path 'components/esp_coex/lib': checked out '2717868407a01878a49d19794538b6da120597ae'
  Submodule path 'components/esp_phy/lib': checked out '792ba5917ee8191e7264143e69f9e6f8c1c0eacc'
  Submodule path 'components/esp_wifi/lib': checked out 'd9a4b032efee9b50914cf38a6c1f41049811fa1e'
  Submodule path 'components/heap/tlsf': checked out 'd2e28f872472ffc6a704faae65ddee1f24e2dfba'
  Submodule path 'components/json/cJSON': checked out '87d8f0961a01bf09bef98ff89bae9fdec42181ee'
  Submodule path 'components/lwip/lwip': checked out 'f79221431fa9042b3572d271d687de66da7560c4'
  Submodule path 'components/mbedtls/mbedtls': checked out '72aa687352a469044cbb946f3fdb261430e41ce1'
  Submodule path 'components/mqtt/esp-mqtt': checked out 'aa6f889fb4f6f743b3a550aa587713aabbdca1fc'
  Submodule path 'components/openthread/lib': checked out 'a0f6a77960b36ebe357cc4bee280034f8c7120f1'
  Submodule path 'components/openthread/openthread': checked out 'be7d36e4ff9cf7df6dfce54e58a31163c87b93f7'
  Submodule path 'components/protobuf-c/protobuf-c': checked out 'abc67a11c6db271bedbb9f58be85d6f4e2ea8389'
  Submodule path 'components/spiffs/spiffs': checked out '0dbb3f71c5f6fae3747a9d935372773762baf852'
  Submodule path 'components/unity/unity': checked out '7d2bf62b7e6afaf38153041a9d53c21aeeca9a25'
  Python 3.10.1
  pip 24.1.2 from /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages/pip (python 3.10)
  Requirement already satisfied: pip in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (24.1.2)
  Requirement already satisfied: setuptools in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (70.3.0)
  Looking in indexes: https://pypi.org/simple, https://dl.espressif.com/pypi
  Ignoring importlib_metadata: markers 'python_version < "3.8"' don't match your environment
  Requirement already satisfied: setuptools in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 3)) (70.3.0)
  Requirement already satisfied: packaging in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 4)) (24.1)
  Requirement already satisfied: click in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 7)) (8.1.7)
  Requirement already satisfied: pyserial in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 8)) (3.5)
  Requirement already satisfied: cryptography in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 9)) (41.0.7)
  Requirement already satisfied: pyparsing in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 10)) (3.1.2)
  Requirement already satisfied: pyelftools in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 11)) (0.31)
  Requirement already satisfied: idf-component-manager in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (1.5.3)
  Requirement already satisfied: esp-coredump in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 13)) (1.11.0)
  Requirement already satisfied: esptool in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 14)) (4.7.0)
  Requirement already satisfied: esp-idf-kconfig in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 15)) (1.4.2)
  Requirement already satisfied: esp-idf-monitor in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 16)) (1.4.0)
  Requirement already satisfied: esp-idf-size in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 17)) (1.5.0)
  Requirement already satisfied: esp-idf-panic-decoder in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 18)) (1.1.0)
  Requirement already satisfied: pyclang in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 19)) (0.4.2)
  Requirement already satisfied: construct in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 20)) (2.10.70)
  Requirement already satisfied: freertos_gdb in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from -r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 23)) (1.0.3)
  Requirement already satisfied: cffi>=1.12 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cryptography->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 9)) (1.16.0)
  Requirement already satisfied: requests<3 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (2.32.3)
  Requirement already satisfied: urllib3<2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (1.26.19)
  Requirement already satisfied: requests-file<2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (1.5.1)
  Requirement already satisfied: requests-toolbelt in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (1.0.0)
  Requirement already satisfied: schema<=0.7.5 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (0.7.5)
  Requirement already satisfied: six in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (1.16.0)
  Requirement already satisfied: tqdm<5 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (4.66.4)
  Requirement already satisfied: colorama in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (0.4.6)
  Requirement already satisfied: pyyaml>5.2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (6.0.1)
  Requirement already satisfied: cachecontrol>0.12.6 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (0.14.0)
  Requirement already satisfied: contextlib2>0.6.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (21.6.0)
  Requirement already satisfied: pygdbmi>=0.9.0.2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esp-coredump->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 13)) (0.11.0.0)
  Requirement already satisfied: bitstring>=3.1.6 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esptool->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 14)) (4.2.3)
  Requirement already satisfied: ecdsa>=0.16.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esptool->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 14)) (0.19.0)
  Requirement already satisfied: reedsolo<1.8,>=1.5.3 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esptool->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 14)) (1.7.0)
  Requirement already satisfied: intelhex in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esptool->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 14)) (2.3.0)
  Requirement already satisfied: kconfiglib>=13.7.1 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esp-idf-kconfig->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 15)) (14.1.0)
  Requirement already satisfied: rich in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from esp-idf-size->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 17)) (13.7.1)
  Requirement already satisfied: bitarray<3.0.0,>=2.9.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from bitstring>=3.1.6->esptool->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 14)) (2.9.2)
  Requirement already satisfied: msgpack<2.0.0,>=0.5.2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cachecontrol>0.12.6->cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (1.0.8)
  Requirement already satisfied: filelock>=3.8.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (3.15.3)
  Requirement already satisfied: pycparser in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from cffi>=1.12->cryptography->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 9)) (2.22)
  Requirement already satisfied: charset-normalizer<4,>=2 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from requests<3->idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (3.3.2)
  Requirement already satisfied: idna<4,>=2.5 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from requests<3->idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (3.7)
  Requirement already satisfied: certifi>=2017.4.17 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from requests<3->idf-component-manager->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 12)) (2024.6.2)
  Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from rich->esp-idf-size->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 17)) (3.0.0)
  Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from rich->esp-idf-size->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 17)) (2.18.0)
  Requirement already satisfied: mdurl~=0.1 in /Users/adrien/.espressif/python_env/idf5.2_py3.10_env/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich->esp-idf-size->-r /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt (line 17)) (0.1.2)
  Upgrading pip and setuptools...
  Skipping the download of /Users/adrien/.espressif/espidf.constraints.v5.2.txt because it was downloaded recently.
  Installing Python packages
   Constraint file: /Users/adrien/.espressif/espidf.constraints.v5.2.txt
   Requirement files:
    - /Users/adrien/.espressif/esp-idf/v5.2.2/tools/requirements/requirements.core.txt
  cargo:rerun-if-changed=/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/sdkconfig.defaults
  CMAKE_PREFIX_PATH_riscv32imc_zicsr_zifencei-esp-espidf = None
  CMAKE_PREFIX_PATH_riscv32imc_zicsr_zifencei_esp_espidf = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_riscv32imc_zicsr_zifencei-esp-espidf = None
  CMAKE_riscv32imc_zicsr_zifencei_esp_espidf = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/Users/adrien/.espressif/esp-idf/v5.2.2" IDF_TARGET="esp32c3" IDF_TOOLS_PATH="/Users/adrien/.espressif" PATH="/Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/Users/adrien/.espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/adrien/.espressif/tools/ninja/1.11.1:/Users/adrien/.espressif/python_env/idf5.2_py3.10_env/bin:/opt/homebrew/sbin:/Users/adrien/.pyenv/shims:/Users/adrien/.pyenv/bin:/Users/adrien/miniforge3/condabin:/Users/adrien/.nvm/versions/node/v14.17.4/bin:/usr/local/sbin:/usr/local/opt/llvm/bin:/Users/adrien/.rustup/toolchains/esp/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/Users/adrien/.rustup/toolchains/esp/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/Users/adrien/.rustup/toolchains/esp/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/Users/adrien/.rustup/toolchains/esp/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/opt/homebrew/bin:/Users/adrien/.local/bin:/opt/homebrew/Cellar:/opt/homebrew/opt/make/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/gcc-arm-none-eabi-8-2019-q3-update/bin:/usr/local/nRF-Command-Line-Tools_10_13_0/mergehex:/usr/local/nRF-Command-Line-Tools_10_13_0/nrfjprog:/Users/adrien/pebble-dev/pebble-sdk-4.5-mac/bin:/usr/local/go/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/tools:/platform-tools:/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle:/Users/adrien/Dev/esp/xtensa-esp32-elf/bin:/Users/adrien/.cargo/bin:/usr/local/flutter/bin:/Users/adrien/.ebcli-virtual-env/executables:/Users/adrien/Dev/go/bin" PROJECT_DIR="/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check" SDKCONFIG_DEFAULTS="/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/gen-sdkconfig.defaults;/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/sdkconfig.defaults" "cmake" "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/Users/adrien/.espressif/esp-idf/v5.2.2/tools/cmake/toolchain-esp32c3.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/Users/adrien/.espressif/python_env/idf5.2_py3.10_env/bin/python" "-DCMAKE_INSTALL_PREFIX=/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out" "-DCMAKE_C_FLAGS= -march=rv32imc_zicsr_zifencei -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf" "-DCMAKE_CXX_FLAGS= -march=rv32imc_zicsr_zifencei -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf" "-DCMAKE_ASM_FLAGS=  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf"
  -- The C compiler identification is GNU 13.2.0
  -- The CXX compiler identification is GNU 13.2.0
  -- The ASM compiler identification is GNU
  -- Found assembler: /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
  -- Check for working C compiler: /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc - broken
  -- Configuring incomplete, errors occurred!
  See also "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeOutput.log".
  See also "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: Some(
          Global,
      ),
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: Some(
          [
              "/Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/./sdkconfig.defaults",
          ],
      ),
      mcu: None,
      native: NativeConfig {
          esp_idf_version: Some(
              Tag(
                  "v5.2.2",
              ),
          ),
          esp_idf_repository: None,
          esp_idf_cmake_generator: None,
          idf_path: None,
          extra_components: [],
          esp_idf_components: None,
          esp_idf_component_manager: None,
      },
      esp_idf_sys_root_crate: None,
  }
  Using managed esp-idf repository: RemoteSdk { repo_url: None, git_ref: Tag("v5.2.2") }
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2'...
  Note: switching to '3b8741b172dc951e18509698dee938304bcf1523'.

  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by switching back to a branch.

  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -c with the switch command. Example:

    git switch -c <new-branch-name>

  Or undo this operation with:

    git switch -

  Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (13130/13130), done.
  Submodule 'components/bootloader/subproject/components/micro-ecc/micro-ecc' (https://github.com/kmackay/micro-ecc.git) registered for path 'components/bootloader/subproject/components/micro-ecc/micro-ecc'
  Submodule 'components/bt/controller/lib_esp32' (https://github.com/espressif/esp32-bt-lib.git) registered for path 'components/bt/controller/lib_esp32'
  Submodule 'components/bt/controller/lib_esp32c2/esp32c2-bt-lib' (https://github.com/espressif/esp32c2-bt-lib.git) registered for path 'components/bt/controller/lib_esp32c2/esp32c2-bt-lib'
  Submodule 'components/bt/controller/lib_esp32c3_family' (https://github.com/espressif/esp32c3-bt-lib.git) registered for path 'components/bt/controller/lib_esp32c3_family'
  Submodule 'components/bt/controller/lib_esp32c6/esp32c6-bt-lib' (https://github.com/espressif/esp32c6-bt-lib.git) registered for path 'components/bt/controller/lib_esp32c6/esp32c6-bt-lib'
  Submodule 'components/bt/controller/lib_esp32h2/esp32h2-bt-lib' (https://github.com/espressif/esp32h2-bt-lib.git) registered for path 'components/bt/controller/lib_esp32h2/esp32h2-bt-lib'
  Submodule 'components/bt/esp_ble_mesh/lib/lib' (https://github.com/espressif/esp-ble-mesh-lib.git) registered for path 'components/bt/esp_ble_mesh/lib/lib'
  Submodule 'components/bt/host/nimble/nimble' (https://github.com/espressif/esp-nimble.git) registered for path 'components/bt/host/nimble/nimble'
  Submodule 'components/cmock/CMock' (https://github.com/ThrowTheSwitch/CMock.git) registered for path 'components/cmock/CMock'
  Submodule 'components/esp_coex/lib' (https://github.com/espressif/esp-coex-lib.git) registered for path 'components/esp_coex/lib'
  Submodule 'components/esp_phy/lib' (https://github.com/espressif/esp-phy-lib.git) registered for path 'components/esp_phy/lib'
  Submodule 'components/esp_wifi/lib' (https://github.com/espressif/esp32-wifi-lib.git) registered for path 'components/esp_wifi/lib'
  Submodule 'components/heap/tlsf' (https://github.com/espressif/tlsf.git) registered for path 'components/heap/tlsf'
  Submodule 'components/json/cJSON' (https://github.com/DaveGamble/cJSON.git) registered for path 'components/json/cJSON'
  Submodule 'components/lwip/lwip' (https://github.com/espressif/esp-lwip.git) registered for path 'components/lwip/lwip'
  Submodule 'components/mbedtls/mbedtls' (https://github.com/espressif/mbedtls.git) registered for path 'components/mbedtls/mbedtls'
  Submodule 'components/mqtt/esp-mqtt' (https://github.com/espressif/esp-mqtt.git) registered for path 'components/mqtt/esp-mqtt'
  Submodule 'components/openthread/lib' (https://github.com/espressif/esp-thread-lib.git) registered for path 'components/openthread/lib'
  Submodule 'components/openthread/openthread' (https://github.com/espressif/openthread.git) registered for path 'components/openthread/openthread'
  Submodule 'components/protobuf-c/protobuf-c' (https://github.com/protobuf-c/protobuf-c.git) registered for path 'components/protobuf-c/protobuf-c'
  Submodule 'components/spiffs/spiffs' (https://github.com/pellepl/spiffs.git) registered for path 'components/spiffs/spiffs'
  Submodule 'components/unity/unity' (https://github.com/ThrowTheSwitch/Unity.git) registered for path 'components/unity/unity'
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/bootloader/subproject/components/micro-ecc/micro-ecc'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/esp_coex/lib'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/bt/controller/lib_esp32'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/bt/controller/lib_esp32c3_family'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/bt/controller/lib_esp32c2/esp32c2-bt-lib'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/json/cJSON'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/cmock/CMock'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/bt/esp_ble_mesh/lib/lib'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/bt/controller/lib_esp32h2/esp32h2-bt-lib'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/bt/controller/lib_esp32c6/esp32c6-bt-lib'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/bt/host/nimble/nimble'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/heap/tlsf'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/spiffs/spiffs'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/openthread/lib'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/esp_wifi/lib'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/esp_phy/lib'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/protobuf-c/protobuf-c'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/mqtt/esp-mqtt'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/lwip/lwip'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/openthread/openthread'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/mbedtls/mbedtls'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/unity/unity'...
  From ssh://github.com/kmackay/micro-ecc
   * branch            24c60e243580c7868f4334a1ba3123481fe1aa48 -> FETCH_HEAD
  From ssh://github.com/espressif/esp32-bt-lib
   * branch            43ecd22ec6b5b484709693ae8e86478a7f130f17 -> FETCH_HEAD
  From ssh://github.com/espressif/esp32c2-bt-lib
   * branch            b9a902c3551ef4a2032b6662a4cbb018125ddfda -> FETCH_HEAD
  From ssh://github.com/espressif/esp32c3-bt-lib
   * branch            76ed4114ee7d081435a3c65793b4c8eb1dfaf199 -> FETCH_HEAD
  From ssh://github.com/espressif/esp32c6-bt-lib
   * branch            0af472c6f95858e638565dad19a79fe47de1fff2 -> FETCH_HEAD
  From ssh://github.com/espressif/esp32h2-bt-lib
   * branch            70612d08d1ff94dfb5da99d6a68aa4032cd63276 -> FETCH_HEAD
  From ssh://github.com/espressif/esp-ble-mesh-lib
   * branch            4934ca903807dd74f7f808dadcd9a478e18fc6c3 -> FETCH_HEAD
  From ssh://github.com/espressif/esp-nimble
   * branch            a2acac3e14bb7810783ac5089ccf8229a2dd2f70 -> FETCH_HEAD
  From ssh://github.com/ThrowTheSwitch/CMock
   * branch            eeecc49ce8af123cf8ad40efdb9673e37b56230f -> FETCH_HEAD
  Submodule 'vendor/c_exception' (https://github.com/throwtheswitch/cexception.git) registered for path 'components/cmock/CMock/vendor/c_exception'
  Submodule 'vendor/unity' (https://github.com/throwtheswitch/unity.git) registered for path 'components/cmock/CMock/vendor/unity'
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/cmock/CMock/vendor/c_exception'...
  Cloning into '/Users/adrien/.espressif/esp-idf/v5.2.2/components/cmock/CMock/vendor/unity'...
  From ssh://github.com/throwtheswitch/cexception
   * branch            71b47be7c950f1bf5f7e5303779fa99a16224bb6 -> FETCH_HEAD
  From ssh://github.com/throwtheswitch/unity
   * branch            cf949f45ca6d172a177b00da21310607b97bc7a7 -> FETCH_HEAD
  From ssh://github.com/espressif/esp-coex-lib
   * branch            2717868407a01878a49d19794538b6da120597ae -> FETCH_HEAD
  From ssh://github.com/espressif/esp-phy-lib
   * branch            792ba5917ee8191e7264143e69f9e6f8c1c0eacc -> FETCH_HEAD
  From ssh://github.com/espressif/esp32-wifi-lib
   * branch            d9a4b032efee9b50914cf38a6c1f41049811fa1e -> FETCH_HEAD
  From ssh://github.com/espressif/tlsf
   * branch            d2e28f872472ffc6a704faae65ddee1f24e2dfba -> FETCH_HEAD
  From ssh://github.com/DaveGamble/cJSON
   * branch            87d8f0961a01bf09bef98ff89bae9fdec42181ee -> FETCH_HEAD
  From ssh://github.com/espressif/esp-lwip
   * branch            f79221431fa9042b3572d271d687de66da7560c4 -> FETCH_HEAD
  From ssh://github.com/espressif/mbedtls
   * branch            72aa687352a469044cbb946f3fdb261430e41ce1 -> FETCH_HEAD
  From ssh://github.com/espressif/esp-mqtt
   * branch            aa6f889fb4f6f743b3a550aa587713aabbdca1fc -> FETCH_HEAD
  From ssh://github.com/espressif/esp-thread-lib
   * branch            a0f6a77960b36ebe357cc4bee280034f8c7120f1 -> FETCH_HEAD
  From ssh://github.com/espressif/openthread
   * branch            be7d36e4ff9cf7df6dfce54e58a31163c87b93f7 -> FETCH_HEAD
  From ssh://github.com/protobuf-c/protobuf-c
   * branch            abc67a11c6db271bedbb9f58be85d6f4e2ea8389 -> FETCH_HEAD
  From ssh://github.com/pellepl/spiffs
   * branch            0dbb3f71c5f6fae3747a9d935372773762baf852 -> FETCH_HEAD
  From ssh://github.com/ThrowTheSwitch/Unity
   * branch            7d2bf62b7e6afaf38153041a9d53c21aeeca9a25 -> FETCH_HEAD
  Using esp-idf v5.2.2 at '/Users/adrien/.espressif/esp-idf/v5.2.2'
  CMake Error at /Users/adrien/.espressif/tools/cmake/3.24.0/CMake.app/Contents/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeTmp
      
      Run Build Command(s):/Users/adrien/.espressif/tools/ninja/1.11.1/ninja cmTC_e06fc && [1/2] Building C object CMakeFiles/cmTC_e06fc.dir/testCCompiler.c.obj
      FAILED: CMakeFiles/cmTC_e06fc.dir/testCCompiler.c.obj 
      /Users/adrien/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc   -march=rv32imc_zicsr_zifencei  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf -o CMakeFiles/cmTC_e06fc.dir/testCCompiler.c.obj -c /Users/adrien/Dev/esp/projects/std-training/intro/hardware-check/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-c3e48119a5703967/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      riscv32-esp-elf-gcc: error: unrecognized command-line option '--target=riscv32imc_zicsr_zifencei-esp-espidf'
      ninja: build stopped: subcommand failed.
      
      

    

    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    /Users/adrien/.espressif/esp-idf/v5.2.2/tools/cmake/project.cmake:506 (__project)
    CMakeLists.txt:28 (project)


  thread 'main' panicked at /Users/adrien/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

For the command you asked me to run:

➜  bin ./riscv32-esp-elf-gcc --version
riscv32-esp-elf-gcc (crosstool-NG esp-13.2.0_20230928) 13.2.0

@Vollbrecht
Copy link
Contributor

can you please try to add the following in the .cargo/config.toml file under the [env] section: CRATE_CC_NO_DEFAULTS = "1"

Test only that change with cargo clean + cargo build, and please tell if you observe a difference here.

If that was not fruitful can you also test if there are changes when you change the rustflag line in the same file into the following rustflags = [ "--cfg", "espidf_time64"] e.g removing the default-linker-library stuff

@adrien3d
Copy link
Author

Thank you very much, it is working fine with CRATE_CC_NO_DEFAULTS = "1"
Can you tell me the meaning of that parameter?

@Vollbrecht
Copy link
Contributor

Vollbrecht commented Jul 10, 2024

We should have had it included when we last updated the training but forgot. This is a env variable that is used by the cc-rs crate. The cc-rs crate is the thing that gets called from our embuild build-system to run the xtensa/riscv-gcc compiler. Since you know that esp-idf is using cmake, we also actually are using the cmake crate to interface with it, and it internally is going through cc-rs to call the compiler. So we don't directly control the calling to the cc-rs crate. Since we dont control it directly, we do that with that env var. We instruct it to only use the flags that we explicitly want to use and don't pick something up from the systems default.

If you see in the esp-rs/esp-idf-template we provide it in the .cargo/config.toml by default.

@Vollbrecht
Copy link
Contributor

i added it to all .configs in #263 so hopefully that should not be a problem anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants