I have the ESP32-C3-Devkit-RUST-1 board and I'm trying to follow the Embedded Rust on Espressif book. I'm at the point where I'm trying to compile the hardware-check application, but it's failing with these errors:
<lots more output snipped>
Using custom user-supplied esp-idf repository at '/Users/gordon/esp/esp-idf' (detected from env variable `IDF_PATH`)
Using esp-idf v5.1.0 at '/Users/gordon/esp/esp-idf'
Output: "/Users/gordon/dev/esp32-rust/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-d1a5f1a58ff63106/out/bindings.rs"
Bindgen builder flags: ["/Users/gordon/.cargo/registry/src/github.com-1ecc6299db9ec823/esp-idf-sys-0.31.5/src/include/esp-idf/bindings.h", "--rust-target", "1.47", "--blocklist-function", "strtold", "--blocklist-function", "_strtold_r", "--blocklist-function", "v.*printf", "--blocklist-function", "v.*scanf", "--blocklist-function", "_v.*printf_r", "--blocklist-function", "_v.*scanf_r", "--blocklist-function", "esp_log_writev", "--no-layout-tests", "--with-derive-default", "--ctypes-prefix", "c_types", "--generate", "functions,types,vars,methods,constructors,destructors", "--use-core", "--no-rustfmt-bindings", "--", "-D__bindgen", "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"", "-DUNITY_INCLUDE_CONFIG_H", "-I/Users/gordon/esp/esp-idf/components/riscv/include", "-I/Users/gordon/dev/esp32-rust/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-d1a5f1a58ff63106/out/build/config", "-I/Users/gordon/esp/esp-idf/components/newlib/platform_include", "-I/Users/gordon/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include", "-I/Users/gordon/esp/esp-idf/components/freertos/esp_additions/include/freertos", "-I/Users/gordon/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include", "-I/Users/gordon/esp/esp-idf/components/freertos/esp_additions/include", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/include", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/include/soc", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/include/soc/esp32c3", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/port/esp32c3/.", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/port/esp32c3/private_include", "-I/Users/gordon/esp/esp-idf/components/heap/include", "-I/Users/gordon/esp/esp-idf/components/log/include", "-I/Users/gordon/esp/esp-idf/components/soc/include", "-I/Users/gordon/esp/esp-idf/components/soc/esp32c3/.", "-I/Users/gordon/esp/esp-idf/components/soc/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/hal/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/hal/include", "-I/Users/gordon/esp/esp-idf/components/hal/platform_port/include", "-I/Users/gordon/esp/esp-idf/components/esp_rom/include", "-I/Users/gordon/esp/esp-idf/components/esp_rom/include/esp32c3", "-I/Users/gordon/esp/esp-idf/components/esp_rom/esp32c3", "-I/Users/gordon/esp/esp-idf/components/esp_common/include", "-I/Users/gordon/esp/esp-idf/components/esp_system/include", "-I/Users/gordon/esp/esp-idf/components/esp_system/port/soc", "-I/Users/gordon/esp/esp-idf/components/esp_system/port/include/riscv", "-I/Users/gordon/esp/esp-idf/components/esp_system/port/include/private", "-I/Users/gordon/esp/esp-idf/components/lwip/include", "-I/Users/gordon/esp/esp-idf/components/lwip/include/apps", "-I/Users/gordon/esp/esp-idf/components/lwip/include/apps/sntp", "-I/Users/gordon/esp/esp-idf/components/lwip/lwip/src/include", "-I/Users/gordon/esp/esp-idf/components/lwip/port/esp32/include", "-I/Users/gordon/esp/esp-idf/components/lwip/port/esp32/include/arch", "-I/Users/gordon/esp/esp-idf/components/esp_ringbuf/include", "-I/Users/gordon/esp/esp-idf/components/efuse/include", "-I/Users/gordon/esp/esp-idf/components/efuse/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/driver/include", "-I/Users/gordon/esp/esp-idf/components/driver/deprecated", "-I/Users/gordon/esp/esp-idf/components/esp_pm/include", "-I/Users/gordon/esp/esp-idf/components/mbedtls/port/include", "-I/Users/gordon/esp/esp-idf/components/mbedtls/mbedtls/include", "-I/Users/gordon/esp/esp-idf/components/mbedtls/mbedtls/library", "-I/Users/gordon/esp/esp-idf/components/esp_app_format/include", "-I/Users/gordon/esp/esp-idf/components/bootloader_support/include", "-I/Users/gordon/esp/esp-idf/components/bootloader_support/bootloader_flash/include", "-I/Users/gordon/esp/esp-idf/components/app_update/include", "-I/Users/gordon/esp/esp-idf/components/spi_flash/include", "-I/Users/gordon/esp/esp-idf/components/pthread/include", "-I/Users/gordon/esp/esp-idf/components/esp_timer/include", "-I/Users/gordon/esp/esp-idf/components/app_trace/include", "-I/Users/gordon/esp/esp-idf/components/esp_event/include", "-I/Users/gordon/esp/esp-idf/components/nvs_flash/include", "-I/Users/gordon/esp/esp-idf/components/esp_phy/include", "-I/Users/gordon/esp/esp-idf/components/esp_phy/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/vfs/include", "-I/Users/gordon/esp/esp-idf/components/esp_netif/include", "-I/Users/gordon/esp/esp-idf/components/wpa_supplicant/include", "-I/Users/gordon/esp/esp-idf/components/wpa_supplicant/port/include", "-I/Users/gordon/esp/esp-idf/components/wpa_supplicant/esp_supplicant/include", "-I/Users/gordon/esp/esp-idf/components/esp_wifi/include", "-I/Users/gordon/esp/esp-idf/components/unity/include", "-I/Users/gordon/esp/esp-idf/components/unity/unity/src", "-I/Users/gordon/esp/esp-idf/components/cmock/CMock/src", "-I/Users/gordon/esp/esp-idf/components/console", "-I/Users/gordon/esp/esp-idf/components/http_parser", "-I/Users/gordon/esp/esp-idf/components/esp-tls", "-I/Users/gordon/esp/esp-idf/components/esp-tls/esp-tls-crypto", "-I/Users/gordon/esp/esp-idf/components/esp_adc/include", "-I/Users/gordon/esp/esp-idf/components/esp_adc/interface", "-I/Users/gordon/esp/esp-idf/components/esp_adc/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/esp_adc/deprecated/include", "-I/Users/gordon/esp/esp-idf/components/esp_eth/include", "-I/Users/gordon/esp/esp-idf/components/esp_gdbstub/include", "-I/Users/gordon/esp/esp-idf/components/esp_gdbstub/riscv", "-I/Users/gordon/esp/esp-idf/components/esp_gdbstub/esp32c3", "-I/Users/gordon/esp/esp-idf/components/esp_hid/include", "-I/Users/gordon/esp/esp-idf/components/tcp_transport/include", "-I/Users/gordon/esp/esp-idf/components/esp_http_client/include", "-I/Users/gordon/esp/esp-idf/components/esp_http_server/include", "-I/Users/gordon/esp/esp-idf/components/esp_https_ota/include", "-I/Users/gordon/esp/esp-idf/components/esp_lcd/include", "-I/Users/gordon/esp/esp-idf/components/esp_lcd/interface", "-I/Users/gordon/esp/esp-idf/components/protobuf-c/protobuf-c", "-I/Users/gordon/esp/esp-idf/components/protocomm/include/common", "-I/Users/gordon/esp/esp-idf/components/protocomm/include/security", "-I/Users/gordon/esp/esp-idf/components/protocomm/include/transports", "-I/Users/gordon/esp/esp-idf/components/esp_local_ctrl/include", "-I/Users/gordon/esp/esp-idf/components/esp_psram/include", "-I/Users/gordon/esp/esp-idf/components/sdmmc/include", "-I/Users/gordon/esp/esp-idf/components/esp_serial_slave_link/include", "-I/Users/gordon/esp/esp-idf/components/espcoredump/include", "-I/Users/gordon/esp/esp-idf/components/espcoredump/include/port/riscv", "-I/Users/gordon/esp/esp-idf/components/wear_levelling/include", "-I/Users/gordon/esp/esp-idf/components/fatfs/diskio", "-I/Users/gordon/esp/esp-idf/components/fatfs/vfs", "-I/Users/gordon/esp/esp-idf/components/fatfs/src", "-I/Users/gordon/esp/esp-idf/components/idf_test/include", "-I/Users/gordon/esp/esp-idf/components/idf_test/include/esp32c3", "-I/Users/gordon/esp/esp-idf/components/ieee802154/include", "-I/Users/gordon/esp/esp-idf/components/json/cJSON", "-I/Users/gordon/esp/esp-idf/components/mqtt/esp-mqtt/include", "-I/Users/gordon/esp/esp-idf/components/spiffs/include", "-I/Users/gordon/esp/esp-idf/components/wifi_provisioning/include", "--sysroot=/Users/gordon/.espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../riscv32-esp-elf", "-I/Users/gordon/.espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../riscv32-esp-elf/include", "-x", "c", "-DESP_IDF_COMP_BOOTLOADER_SUPPORT_ENABLED", "-DESP_IDF_COMP_IEEE802154_ENABLED", "-DESP_IDF_COMP_UNITY_ENABLED", "-DESP_IDF_COMP_ESP_PHY_ENABLED", "-DESP_IDF_COMP_WEAR_LEVELLING_ENABLED", "-DESP_IDF_COMP_FATFS_ENABLED", "-DESP_IDF_COMP_VFS_ENABLED", "-DESP_IDF_COMP_PERFMON_ENABLED", "-DESP_IDF_COMP_ESP_APP_FORMAT_ENABLED", "-DESP_IDF_COMP_XTENSA_ENABLED", "-DESP_IDF_COMP_ESPCOREDUMP_ENABLED", "-DESP_IDF_COMP_ESP_HW_SUPPORT_ENABLED", "-DESP_IDF_COMP_OPENTHREAD_ENABLED", "-DESP_IDF_COMP_PARTITION_TABLE_ENABLED", "-DESP_IDF_COMP_SPIFFS_ENABLED", "-DESP_IDF_COMP_HAL_ENABLED", "-DESP_IDF_COMP_ESPTOOL_PY_ENABLED", "-DESP_IDF_COMP_DRIVER_ENABLED", "-DESP_IDF_COMP_LWIP_ENABLED", "-DESP_IDF_COMP_SOC_ENABLED", "-DESP_IDF_COMP_BOOTLOADER_ENABLED", "-DESP_IDF_COMP_ESP_SYSTEM_ENABLED", "-DESP_IDF_COMP_ESP_EVENT_ENABLED", "-DESP_IDF_COMP_ESP_COMMON_ENABLED", "-DESP_IDF_COMP_PROTOBUF_C_ENABLED", "-DESP_IDF_COMP_CXX_ENABLED", "-DESP_IDF_COMP_MBEDTLS_ENABLED", "-DESP_IDF_COMP_NEWLIB_ENABLED", "-DESP_IDF_COMP_APP_UPDATE_ENABLED", "-DESP_IDF_COMP_ESP_HTTP_CLIENT_ENABLED", "-DESP_IDF_COMP_FREERTOS_ENABLED", "-DESP_IDF_COMP_TOUCH_ELEMENT_ENABLED", "-DESP_IDF_COMP_TCP_TRANSPORT_ENABLED", "-DESP_IDF_COMP_PTHREAD_ENABLED", "-DESP_IDF_COMP_ESP_PSRAM_ENABLED", "-DESP_IDF_COMP_ESP_HTTPS_OTA_ENABLED", "-DESP_IDF_COMP_HTTP_PARSER_ENABLED", "-DESP_IDF_COMP_USB_ENABLED", "-DESP_IDF_COMP_PROTOCOMM_ENABLED", "-DESP_IDF_COMP_ESP_LOCAL_CTRL_ENABLED", "-DESP_IDF_COMP_ESP_PM_ENABLED", "-DESP_IDF_COMP_JSON_ENABLED", "-DESP_IDF_COMP_HEAP_ENABLED", "-DESP_IDF_COMP_LINUX_ENABLED", "-DESP_IDF_COMP_SDMMC_ENABLED", "-DESP_IDF_COMP_ESP_ETH_ENABLED", "-DESP_IDF_COMP_WPA_SUPPLICANT_ENABLED", "-DESP_IDF_COMP_BT_ENABLED", "-DESP_IDF_COMP_ESP_RINGBUF_ENABLED", "-DESP_IDF_COMP_ESP_GDBSTUB_ENABLED", "-DESP_IDF_COMP_LOG_ENABLED", "-DESP_IDF_COMP_ESP_LCD_ENABLED", "-DESP_IDF_COMP_WIFI_PROVISIONING_ENABLED", "-DESP_IDF_COMP_IDF_TEST_ENABLED", "-DESP_IDF_COMP_CMOCK_ENABLED", "-DESP_IDF_COMP_MQTT_ENABLED", "-DESP_IDF_COMP_ESP_HID_ENABLED", "-DESP_IDF_COMP_ULP_ENABLED", "-DESP_IDF_COMP_RISCV_ENABLED", "-DESP_IDF_COMP_SPI_FLASH_ENABLED", "-DESP_IDF_COMP_ESP_SERIAL_SLAVE_LINK_ENABLED", "-DESP_IDF_COMP_ESP_HTTPS_SERVER_ENABLED", "-DESP_IDF_COMP_TINYUSB_ENABLED", "-DESP_IDF_COMP_ESP_ROM_ENABLED", "-DESP_IDF_COMP_ESP_TIMER_ENABLED", "-DESP_IDF_COMP_ESP_TLS_ENABLED", "-DESP_IDF_COMP_EFUSE_ENABLED", "-DESP_IDF_COMP_NVS_FLASH_ENABLED", "-DESP_IDF_COMP_ESP_WIFI_ENABLED", "-DESP_IDF_COMP_APP_TRACE_ENABLED", "-DESP_IDF_COMP_ESP_HTTP_SERVER_ENABLED", "-DESP_IDF_COMP_ESP_ADC_ENABLED", "-DESP_IDF_COMP_ESP_NETIF_ENABLED", "-DESP_IDF_COMP_CONSOLE_ENABLED", "-target", "riscv32"]
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:65:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:79:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:87:28: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:89:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:95:28: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:97:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:124:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:125:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:126:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:127:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:132:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:133:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:134:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:143:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:144:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:145:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:146:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:152:9: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:155:9: error: invalid input constraint 'rK' in asm
fatal error: too many errors emitted, stopping now [-ferror-limit=]
I'm using macOS 10.15.7 on an Intel MacBook. I installed the software prerequisites as described in the book using rustup
and brew
. I installed esp-idf
v5.1.0 from git master and was able to successfully compile and flash the C hello_world application from esp-idf
onto my device.