Using Rust on ESP32 from Windows

Ryan L. Kopf
7 min readMar 15, 2024

Building on Windows for the ESP32 Xtensa architecture can be a real pain in the butt. Navigating through the maze of toolchain setup, compatibility issues, and the intricate dance of dependencies can easily turn an exciting development project into a daunting task. For developers accustomed to the plug-and-play nature of many modern development environments, adjusting to the nuances of ESP32 development on Windows can be particularly jarring.

ESP32-WROVER-DEV

This article aims to serve as a beacon for weary developers, offering practical solutions, streamlined workflows, and a dash of insider knowledge to make your journey into ESP32 development on Windows not just bearable, but enjoyable. We’ll cover the essential tools and configurations needed to set up a productive development environment, demystify common pitfalls, and provide step-by-step guidance to ensure your projects get off the ground without a hitch.

From installing the ESP-IDF (Espressif IoT Development Framework) to configuring Visual Studio Code for seamless integration with ESP32 projects, we’ll guide you through the necessary steps to transform your Windows workstation into a powerhouse for ESP32 development. Whether you’re building IoT applications, experimenting with Bluetooth connectivity, or creating intricate sensor networks, this guide is designed to catapult your projects from concept to reality, all while navigating the complexities of the ESP32 architecture on Windows with confidence and ease.

Use ESPUP

espup is a tool for installing and maintaining the required toolchains for developing applications in Rust for Espressif SoC’s. In theory, it should do all the heavy lifting for you. On Windows this includes installing: Python, Git, Windows10SDK, and a Windows MSVC compiler of the right version. It also sets some environment variables necessary for compiling to ESP32 “xtensa” targets.

cargo install espup
espup install

espup will create an export file that contains some environment variables required to build projects.

The documentation says “There is no need to execute the file for Windows users. It is only created to show the modified environment variables.” however this is wrong.

Run the file. In my case, it was just typing this, as though it were a command by itself, into powershell:

C:\Users\ryankopf\export-esp.ps1

Then:

cargo generate esp-rs/esp-template
cargo build
cargo run

And boom, it works.

I currently have a pull request requesting a change in the documentation and in the command’s output message.

Common Errors

All the errors I got before appropriately importing the environmental variables were related to the inability to find the right build tools.

PS F:\esp1> cargo build
Blocking waiting for file lock on build directory
Compiling byteorder v1.5.0
Compiling nb v1.1.0
Compiling embedded-io v0.6.1
Compiling stable_deref_trait v1.2.0
Compiling futures-core v0.3.30
Compiling futures-task v0.3.30
Compiling embedded-hal v1.0.0
Compiling pin-project-lite v0.2.13
Compiling pin-utils v0.1.0
Compiling void v1.0.2
Compiling libc v0.2.153
Compiling const_format v0.2.32
Compiling critical-section v1.1.2
Compiling cfg-if v1.0.0
Compiling num_enum v0.7.2
Compiling serde v1.0.197
Compiling esp-idf-sys v0.34.1
Compiling enumset v1.1.3
Compiling atomic-waker v1.1.2
Compiling no-std-net v0.5.0
Compiling futures-util v0.3.30
Compiling nb v0.1.3
Compiling embedded-can v0.4.1
Compiling log v0.4.21
Compiling uncased v0.9.10
Compiling embedded-io-async v0.6.1
Compiling embedded-hal v0.2.7
Compiling embedded-hal-nb v1.0.0
Compiling embedded-hal-async v1.0.0
Compiling hash32 v0.3.1
Compiling embassy-time-driver v0.1.0
Compiling embassy-futures v0.1.1
Compiling heapless v0.8.0
Compiling embassy-sync v0.5.0
Compiling embedded-svc v0.27.1
The following warnings were emitted during compilation:

warning: esp-idf-sys@0.34.1: Failed to run: “cc” “ — version”
warning: esp-idf-sys@0.34.1: Compiler version doesn’t include clang or GCC: “c++” “ — version”

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

Caused by:
process didn’t exit successfully: `F:\esp1\target\debug\build\esp-idf-sys-ac7a74d02cec0644\build-script-build` (exit code: 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
IDF_PYTHON_ENV_PATH=F:\esp1\.embuild\espressif\python_env\idf5.1_py3.11_env
ESP_IDF_VERSION=5.1
PATH=F:\esp1\.embuild\espressif\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin;F:\esp1\.embuild\espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;F:\esp1\.embuild\espressif\tools\cmake\3.24.0\bin;F:\esp1\.embuild\espressif\tools\ninja\1.10.2\;F:\esp1\.embuild\espressif\python_env\idf5.1_py3.11_env\Scripts;F:\esp1\.embuild\espressif\esp-idf\v5.1.3\tools;%PATH%
IDF_DEACTIVATE_FILE_PATH=C:\Users\ryankopf\AppData\Local\Temp\tmpsp3zxnzlidf_21616
Current system platform: win64
Installing tools: xtensa-esp32-elf, cmake, ninja, esp32ulp-elf
Skipping xtensa-esp32-elf@esp-12.2.0_20230208 (already installed)
Skipping cmake@3.24.0 (already installed)
Skipping ninja@1.10.2 (already installed)
Skipping esp32ulp-elf@2.35_20220830 (already installed)
IDF_PYTHON_ENV_PATH=F:\esp1\.embuild\espressif\python_env\idf5.1_py3.11_env
ESP_IDF_VERSION=5.1
PATH=F:\esp1\.embuild\espressif\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin;F:\esp1\.embuild\espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;F:\esp1\.embuild\espressif\tools\cmake\3.24.0\bin;F:\esp1\.embuild\espressif\tools\ninja\1.10.2\;F:\esp1\.embuild\espressif\python_env\idf5.1_py3.11_env\Scripts;F:\esp1\.embuild\espressif\esp-idf\v5.1.3\tools;%PATH%
IDF_DEACTIVATE_FILE_PATH=C:\Users\ryankopf\AppData\Local\Temp\tmp0b6qb6hoidf_27768
cargo:rerun-if-changed=F:\esp1\sdkconfig.defaults
cargo:warning=Failed to run: “cc” “ — version”
cargo:warning=Compiler version doesn’t include clang or GCC: “c++” “ — version”
CMAKE_PREFIX_PATH_xtensa-esp32-espidf = None
CMAKE_PREFIX_PATH_xtensa_esp32_espidf = None
TARGET_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_xtensa-esp32-espidf = None
CMAKE_xtensa_esp32_espidf = None
TARGET_CMAKE = None
CMAKE = None
running: “cmake” “F:\\esp1\\target\\xtensa-esp32-espidf\\debug\\build\\esp-idf-sys-e88fb6f8876aeb17\\out” “-G” “Ninja” “-DCMAKE_TOOLCHAIN_FILE=F:\\esp1\\.embuild\\espressif\\esp-idf\\v5.1.3\\tools\\cmake\\toolchain-esp32.cmake” “-DCMAKE_BUILD_TYPE=” “-DPYTHON=F:/esp1/.embuild/espressif/python_env/idf5.1_py3.11_env/Scripts/python.exe” “-DCMAKE_INSTALL_PREFIX=F:\\esp1\\target\\xtensa-esp32-espidf\\debug\\build\\esp-idf-sys-e88fb6f8876aeb17\\out” “-DCMAKE_C_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections” “-DCMAKE_CXX_FLAGS= -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections” “-DCMAKE_ASM_FLAGS= -mlongcalls -ffunction-sections -fdata-sections”
— git describe returned ‘fatal: bad revision ‘HEAD’’
— Could not use ‘git describe’ to determine PROJECT_VER.
— Building ESP-IDF components for target esp32
— Checking Python dependencies…
Python requirements are satisfied.
Constraint file: F:\esp1\.embuild\espressif\espidf.constraints.v5.1.txt
Requirement files:
— F:\esp1\.embuild\espressif\esp-idf\v5.1.3\tools\requirements\requirements.core.txt
Python being checked: F:\esp1\.embuild\espressif\python_env\idf5.1_py3.11_env\Scripts\python.exe
— Project sdkconfig file F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/sdkconfig
Loading defaults file F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/gen-sdkconfig.defaults…
Loading defaults file F:/esp1/sdkconfig.defaults…
— App “libespidf” version: 1
— Adding linker script F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/build/esp-idf/esp_system/ld/memory.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_system/ld/esp32/sections.ld.in
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.api.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/soc/esp32/ld/esp32.peripherals.ld
— Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport ulp
unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
— Component paths: F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/app_trace F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/app_update F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bootloader F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bootloader_support F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bt F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/cmock F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/console F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/cxx F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/driver F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/efuse F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp-tls F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_adc F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_app_format F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_coex F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_common F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_eth F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_event F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_gdbstub F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_hid F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_http_client F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_http_server F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_https_ota F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_https_server F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_hw_support F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_lcd F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_local_ctrl F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_mm F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_netif F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_netif_stack F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_partition F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_phy F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_pm F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_psram F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_ringbuf F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_system F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_timer F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_wifi F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/espcoredump F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esptool_py F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/fatfs F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/freertos F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/hal F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/heap F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/http_parser F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/idf_test F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/ieee802154 F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/json F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/log F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/lwip F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/main F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/mbedtls F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/mqtt F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/newlib F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/nvs_flash F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/openthread F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/partition_table F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/perfmon F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/protobuf-c F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/protocomm F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/pthread F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/sdmmc F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/soc F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/spi_flash F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/spiffs F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/tcp_transport F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/ulp F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/unity F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/usb F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/vfs F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/wear_levelling F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/wifi_provisioning F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/wpa_supplicant F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/xtensa
— Configuring done
— Generating done
— Build files have been written to: F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/build
running: “cmake” “ — build” “.” “ — config” “MinSizeRel” “ — parallel” “20”
[1/7] Generating ld/sections.ld
[2/7] Performing build step for ‘bootloader’
[0/1] Re-running CMake…
— Building ESP-IDF components for target esp32
— Project sdkconfig file F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/sdkconfig
Compiler supported targets: xtensa-esp32-elf

— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/soc/esp32/ld/esp32.peripherals.ld
— App “bootloader” version: v5.1.3
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.api.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bootloader/subproject/main/ld/esp32/bootloader.ld
— Adding linker script F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld
— Components: bootloader bootloader_support efuse esp_app_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
— Component paths: F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bootloader F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bootloader_support F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/efuse
F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_app_format F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_common F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_hw_support F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_rom F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esp_system F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/esptool_py F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/freertos F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/hal F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/log F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bootloader/subproject/main F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/bootloader/subproject/components/micro-ecc F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/newlib F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/partition_table F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/soc F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/spi_flash F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/xtensa
— Configuring done
— Generating done
— Build files have been written to: F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/build/bootloader
[1/1] cmd.exe /C “cd /D F:\esp1\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-e88fb6f8876aeb17\out\build\bootloader\esp-idf\esptool_py && F:\esp1\.embuild\espressif\python_env\idf5.1_py3.11_env\Scripts\python.exe F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/partition_table/check_sizes.py — offset 0x8000 bootloader 0x1000 F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/build/bootloader/bootloader.bin”
Bootloader binary size 0x6850 bytes. 0x7b0 bytes (7%) free.
[3/5] Linking CXX executable libespidf.elf
[4/5] Generating binary image from built executable
esptool.py v4.7.0
Creating esp32 image…
Merged 2 ELF sections
Successfully created esp32 image.
Generated F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/build/libespidf.bin
[5/5] cmd.exe /C “cd /D F:\esp1\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-e88fb6f8876aeb17\out\build\esp-idf\esptool_py && F:\esp1\.embuild\espressif\python_env\idf5.1_py3.11_env\Scripts\python.exe F:/esp1/.embuild/espressif/esp-idf/v5.1.3/components/partition_table/check_sizes.py — offset 0x8000 partition — type app F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/build/partition_table/partition-table.bin F:/esp1/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-e88fb6f8876aeb17/out/build/libespidf.bin”
libespidf.bin binary size 0x27550 bytes. Smallest app partition is 0x100000 bytes. 0xd8ab0 bytes (85%) free.
cargo:root=F:\esp1\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-e88fb6f8876aeb17\out
cargo:rerun-if-changed=C:\Users\ryankopf\.cargo\registry\src\index.crates.io-6f17d22bba15001f\esp-idf-sys-0.34.1\src\include\esp-idf\bindings.h
cargo:rustc-env=EMBUILD_GENERATED_BINDINGS_FILE=F:\esp1\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-e88fb6f8876aeb17\out\bindings.rs

— — stderr
Build configuration: BuildConfig {
esp_idf_tools_install_dir: None,
esp_idf_sdkconfig: None,
esp_idf_sdkconfig_defaults: None,
mcu: Some(
“esp32”,
),
native: NativeConfig {
esp_idf_version: Some(
Tag(
“v5.1.3”,
),
),
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 esp-idf v5.1.3 at ‘F:\esp1\.embuild\espressif\esp-idf\v5.1.3’
Compiler supported targets: xtensa-esp32-elf

Built components: xtensa, esp_ringbuf, efuse, driver, esp_pm, mbedtls, esp_app_format, bootloader_support, bootloader, esptool_py, partition_table, esp_partition, app_update, esp_mm, spi_flash, pthread, esp_system,
esp_rom, hal, log, heap, soc, esp_hw_support, freertos, newlib, cxx, esp_common, esp_timer, app_trace, esp_event, nvs_flash, esp_phy, vfs, lwip, esp_netif_stack, esp_netif, wpa_supplicant, esp_coex, esp_wifi, bt, unity, cmock, console, http_parser, esp-tls, esp_adc, esp_eth, esp_gdbstub, esp_hid, tcp_transport, esp_http_client, esp_http_server, esp_https_ota, esp_https_server, esp_psram, esp_lcd, protobuf-c, protocomm, esp_local_ctrl, espcoredump, wear_levelling, sdmmc, fatfs, idf_test, ieee802154, json, mqtt, openthread, perfmon, spiffs, ulp, usb, wifi_provisioning, main
error: unknown target triple ‘xtensa’, please use -triple or -arch
thread ‘main’ panicked at C:\Users\ryankopf\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bindgen-0.63.0\ir\context.rs:530:15:
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!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What Next?

Here’s how to blink the onboard LED of a ESP32-WROVER-DEV, the board I am currently developing on.

--

--

Ryan L. Kopf

Serial C.E.O. and Entrepreneur. Great at technology, innovation, and entertainment arts.