Skip to content

Support additional targest with Rust (was samples/hello_world: build fail.) #52

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

Open
zhang-wenchao opened this issue Feb 3, 2025 · 3 comments

Comments

@zhang-wenchao
Copy link

zhang-wenchao commented Feb 3, 2025

version: c94328f

 west build -p always -b esp32c3_luatos_core/esp32c3/usb

or:

west build -p always -b frdm_k64f

It seems that only the nrf52840 chip is normal

log:

west build -p always -b esp32c3_luatos_core/esp32c3/usb && west flash && west espressif monitor
-- west build: making build dir /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world
-- CMake version: 3.30.5
-- Found Python3: /home/life/Develop/platform/zephyr-project/.venv/bin/python3 (found suitable version "3.11.2", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /home/life/.cache/zephyr
-- Zephyr version: 4.0.0 (/home/life/Develop/platform/zephyr-project/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: esp32c3_luatos_core, qualifiers: esp32c3/usb
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.16.8 (/home/life/Develop/platform/zephyr-project/sdk/zephyr-sdk-0.16.8)
-- Found toolchain: zephyr 0.16.8 (/home/life/Develop/platform/zephyr-project/sdk/zephyr-sdk-0.16.8)
-- Found Dtc: /home/life/Develop/platform/zephyr-project/sdk/zephyr-sdk-0.16.8/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/life/Develop/platform/zephyr-project/zephyr/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_esp32c3_usb.dts
-- Generated zephyr.dts: /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/zephyr.dts
-- Generated pickled edt: /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/edt.pickle
-- Generated zephyr.dts: /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/dts.cmake
Parsing /home/life/Develop/platform/zephyr-project/zephyr/Kconfig
Loaded configuration '/home/life/Develop/platform/zephyr-project/zephyr/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_esp32c3_usb_defconfig'
Merged configuration '/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/prj.conf'
Configuration saved to '/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/.config'
Kconfig header saved to '/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/life/Develop/platform/zephyr-project/sdk/zephyr-sdk-0.16.8/riscv64-zephyr-elf/riscv64-zephyr-elf/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/life/Develop/platform/zephyr-project/sdk/zephyr-sdk-0.16.8/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gcc
ESP-IDF path: /home/life/Develop/platform/zephyr-project/modules/hal/espressif
esptool path: /home/life/Develop/platform/zephyr-project/modules/hal/espressif/tools/esptool_py/esptool.py
-- Using ccache: /usr/bin/ccache
-- Includes: /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/include/generated/zephyr;/home/life/Develop/platform/zephyr-project/zephyr/include;/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/include/generated;/home/life/Develop/platform/zephyr-project/zephyr/soc/espressif;/home/life/Develop/platform/zephyr-project/zephyr/lib/libc/common/include;/home/life/Develop/platform/zephyr-project/zephyr/soc/espressif/common/include;/home/life/Develop/platform/zephyr-project/zephyr/soc/espressif/esp32c3/.;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/include/bt;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../esp_shared/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../esp_shared/components/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../port/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/private_include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/esp32c3/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/esp32c3/private_include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_common/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/dma;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include/esp_private;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include/hal;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include/soc;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include/soc/esp32c3;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/port/esp32c3;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/port/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3/ld;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/include/;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/include/esp32c3;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_system/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_system/include/esp_private;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_system/port/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_system/port/include/private;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/hal/esp32c3/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/hal/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/hal/platform_port/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/log/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/soc/esp32c3/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/soc/esp32c3/ld;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/soc/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/riscv/esp32c3/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/riscv/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/riscv/include/esp_private;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/riscv/include/xtensa;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_timer/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_timer/private_include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/deprecated;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/gpio/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/uart/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/touch_sensor/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/touch_sensor/esp32c3/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/spi/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/spi_flash/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/spi_flash/include/spi_flash;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_pm/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/bootloader_support/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/bootloader_support/private_include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/bootloader_support/bootloader_flash/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/heap/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_mm/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_netif/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_coex/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_phy/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_phy/include/esp_private;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_phy/esp32c3/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_wifi/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_event/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/esp_supplicant/src;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/esp_supplicant/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/include/esp_supplicant;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/port/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/src;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/src/crypto;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/src/utils;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/src/eap_peer;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/mbedtls/port/include;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3;/home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../port/include/boot;$<TARGET_PROPERTY:compiler,nostdinc_include>
-- Defines: KERNEL;__ZEPHYR__=1;$<TARGET_PROPERTY:compiler,security_fortify_compile_time>;__LINUX_ERRNO_EXTENSIONS__;PICOLIBC_LONG_LONG_PRINTF_SCANF;CONFIG_APP_BUILD_USE_FLASH_SECTIONS;asm=__asm__;CONFIG_IDF_TARGET_ARCH_RISCV;ESP_PLATFORM;K_HEAP_MEM_POOL_SIZE=4096
-- Building Rust llvm target riscv32i-unknown-none-elf
-- Processing crates: 
-- module: zephyr
-- module: zephyr-build
-- module: zephyr-sys
-- Configuring done (4.5s)
-- Generating done (0.2s)
-- Build files have been written to: /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build
-- west build: building application
[1/207] Preparing syscall dependency handling

[2/207] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.0.0 (/home/life/Develop/platform/zephyr-project/zephyr), build: v4.0.0-49-g2f0e67fee81d
[197/207] Building Rust application
FAILED: always-run-cargo.dummy rust/target/riscv32i-unknown-none-elf/release/librustapp.a rust/wrapper.c /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/always-run-cargo.dummy /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/target/riscv32i-unknown-none-elf/release/librustapp.a /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/wrapper.c 
cd /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world && /home/linuxbrew/.linuxbrew/Cellar/cmake/3.30.5/bin/cmake -E env BUILD_DIR=/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build ZEPHYR_BASE=/home/life/Develop/platform/zephyr-project/zephyr DOTCONFIG=/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/.config ZEPHYR_DTS=/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/zephyr.dts INCLUDE_DIRS="/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/include/generated/zephyr /home/life/Develop/platform/zephyr-project/zephyr/include /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/include/generated /home/life/Develop/platform/zephyr-project/zephyr/soc/espressif /home/life/Develop/platform/zephyr-project/zephyr/lib/libc/common/include /home/life/Develop/platform/zephyr-project/zephyr/soc/espressif/common/include /home/life/Develop/platform/zephyr-project/zephyr/soc/espressif/esp32c3/. /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/include/bt /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../esp_shared/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../esp_shared/components/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../port/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/private_include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/esp32c3/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/esp32c3/private_include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_common/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/dma /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include/esp_private /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include/hal /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include/soc /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/include/soc/esp32c3 /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/port/esp32c3 /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_hw_support/port/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3 /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3/ld /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/include/ /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/include/esp32c3 /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_system/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_system/include/esp_private /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_system/port/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_system/port/include/private /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/hal/esp32c3/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/hal/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/hal/platform_port/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/log/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/soc/esp32c3/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/soc/esp32c3/ld /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/soc/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/riscv/esp32c3/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/riscv/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/riscv/include/esp_private /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/riscv/include/xtensa /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_timer/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_timer/private_include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/deprecated /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/gpio/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/uart/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/touch_sensor/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/touch_sensor/esp32c3/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/driver/spi/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/spi_flash/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/spi_flash/include/spi_flash /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_pm/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/bootloader_support/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/bootloader_support/private_include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/bootloader_support/bootloader_flash/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/heap/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_mm/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_netif/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_coex/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_phy/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_phy/include/esp_private /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_phy/esp32c3/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_wifi/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_event/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/esp_supplicant/src /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/esp_supplicant/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/include/esp_supplicant /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/port/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/src /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/src/crypto /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/src/utils /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/wpa_supplicant/src/eap_peer /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/mbedtls/port/include /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3 /home/life/Develop/platform/zephyr-project/modules/hal/espressif/zephyr/esp32c3/../port/include/boot " INCLUDE_DEFINES="KERNEL __ZEPHYR__=1  __LINUX_ERRNO_EXTENSIONS__ PICOLIBC_LONG_LONG_PRINTF_SCANF CONFIG_APP_BUILD_USE_FLASH_SECTIONS asm=__asm__ CONFIG_IDF_TARGET_ARCH_RISCV ESP_PLATFORM K_HEAP_MEM_POOL_SIZE=4096" WRAPPER_FILE="/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/wrapper.c" DT_AUGMENTS="/home/life/Develop/platform/zephyr-project/modules/lang/rust/dt-rust.yaml" BINARY_DIR_INCLUDE_GENERATED="/home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/zephyr/include/generated/zephyr" cargo build --release --config patch.crates-io.zephyr.path=\"/home/life/Develop/platform/zephyr-project/modules/lang/rust/zephyr\" --config patch.crates-io.zephyr-build.path=\"/home/life/Develop/platform/zephyr-project/modules/lang/rust/zephyr-build\" --config patch.crates-io.zephyr-sys.path=\"/home/life/Develop/platform/zephyr-project/modules/lang/rust/zephyr-sys\" --target riscv32i-unknown-none-elf --target-dir /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/target
   Compiling proc-macro2 v1.0.93
   Compiling unicode-ident v1.0.16
   Compiling memchr v2.7.4
   Compiling regex-syntax v0.8.5
   Compiling thiserror v2.0.11
   Compiling glob v0.3.2
   Compiling anyhow v1.0.95
   Compiling libc v0.2.169
   Compiling ucd-trie v0.1.7
   Compiling prettyplease v0.2.29
   Compiling cfg-if v1.0.0
   Compiling minimal-lexical v0.2.1
   Compiling once_cell v1.20.2
   Compiling serde v1.0.217
   Compiling unicode-width v0.1.14
   Compiling either v1.13.0
   Compiling libloading v0.8.6
   Compiling equivalent v1.0.1
   Compiling bindgen v0.70.1
   Compiling yansi-term v0.1.2
   Compiling hashbrown v0.15.2
   Compiling itertools v0.13.0
   Compiling unsafe-libyaml v0.2.11
   Compiling shlex v1.3.0
   Compiling rustc-hash v1.1.0
   Compiling ryu v1.0.19
   Compiling annotate-snippets v0.9.2
   Compiling bitflags v2.8.0
   Compiling log v0.4.25
   Compiling itoa v1.0.14
   Compiling portable-atomic v1.10.0
   Compiling paste v1.0.15
   Compiling clang-sys v1.8.1
   Compiling portable-atomic-util v0.2.4
   Compiling critical-section v1.2.0
   Compiling gcd v2.3.0
   Compiling aho-corasick v1.1.3
   Compiling nom v7.1.3
   Compiling fugit v0.3.7
   Compiling indexmap v2.7.1
   Compiling quote v1.0.38
   Compiling syn v2.0.98
   Compiling regex-automata v0.4.9
   Compiling cexpr v0.6.0
   Compiling regex v1.11.1
   Compiling thiserror-impl v2.0.11
   Compiling serde_derive v1.0.217
   Compiling pest v2.7.15
   Compiling pest_meta v2.7.15
   Compiling pest_generator v2.7.15
   Compiling pest_derive v2.7.15
   Compiling zephyr-sys v0.1.0 (/home/life/Develop/platform/zephyr-project/modules/lang/rust/zephyr-sys)
   Compiling serde_yaml_ng v0.10.0
   Compiling zephyr-build v0.1.0 (/home/life/Develop/platform/zephyr-project/modules/lang/rust/zephyr-build)
   Compiling zephyr v0.1.0 (/home/life/Develop/platform/zephyr-project/modules/lang/rust/zephyr)
error[E0425]: cannot find function `get_instance_raw` in module `super::super::super`
   --> /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/target/riscv32i-unknown-none-elf/release/build/zephyr-0ec76c6da42ac241/out/devicetree.rs:238:63
    |
238 | ...                   let device = super::super::super::get_instance_raw();
    |                                                         ^^^^^^^^^^^^^^^^ not found in `super::super::super`
    |
help: consider importing this function through its public re-export
    |
231 +                     use crate::devicetree::labels::gpio0::get_instance_raw;
    |
help: if you import `get_instance_raw`, refer to it directly
    |
238 -                             let device = super::super::super::get_instance_raw();
238 +                             let device = get_instance_raw();
    |

error[E0425]: cannot find function `get_instance_raw` in module `super::super::super`
   --> /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/target/riscv32i-unknown-none-elf/release/build/zephyr-0ec76c6da42ac241/out/devicetree.rs:252:63
    |
252 | ...                   let device = super::super::super::get_instance_raw();
    |                                                         ^^^^^^^^^^^^^^^^ not found in `super::super::super`
    |
help: consider importing this function through its public re-export
    |
246 +                     use crate::devicetree::labels::gpio0::get_instance_raw;
    |
help: if you import `get_instance_raw`, refer to it directly
    |
252 -                             let device = super::super::super::get_instance_raw();
252 +                             let device = get_instance_raw();
    |

error[E0425]: cannot find function `get_instance_raw` in module `super::super::super`
   --> /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/target/riscv32i-unknown-none-elf/release/build/zephyr-0ec76c6da42ac241/out/devicetree.rs:266:63
    |
266 | ...                   let device = super::super::super::get_instance_raw();
    |                                                         ^^^^^^^^^^^^^^^^ not found in `super::super::super`
    |
help: consider importing this function through its public re-export
    |
260 +                     use crate::devicetree::labels::gpio0::get_instance_raw;
    |
help: if you import `get_instance_raw`, refer to it directly
    |
266 -                             let device = super::super::super::get_instance_raw();
266 +                             let device = get_instance_raw();
    |

error[E0425]: cannot find function `get_instance_raw` in module `super::super::super`
   --> /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/target/riscv32i-unknown-none-elf/release/build/zephyr-0ec76c6da42ac241/out/devicetree.rs:280:63
    |
280 | ...                   let device = super::super::super::get_instance_raw();
    |                                                         ^^^^^^^^^^^^^^^^ not found in `super::super::super`
    |
help: consider importing this function through its public re-export
    |
274 +                     use crate::devicetree::labels::gpio0::get_instance_raw;
    |
help: if you import `get_instance_raw`, refer to it directly
    |
280 -                             let device = super::super::super::get_instance_raw();
280 +                             let device = get_instance_raw();
    |

error[E0425]: cannot find function `get_instance_raw` in module `super::super::super`
   --> /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build/rust/target/riscv32i-unknown-none-elf/release/build/zephyr-0ec76c6da42ac241/out/devicetree.rs:294:63
    |
294 | ...                   let device = super::super::super::get_instance_raw();
    |                                                         ^^^^^^^^^^^^^^^^ not found in `super::super::super`
    |
help: consider importing this function through its public re-export
    |
288 +                     use crate::devicetree::labels::gpio0::get_instance_raw;
    |
help: if you import `get_instance_raw`, refer to it directly
    |
294 -                             let device = super::super::super::get_instance_raw();
294 +                             let device = get_instance_raw();
    |

For more information about this error, try `rustc --explain E0425`.
error: could not compile `zephyr` (lib) due to 5 previous errors
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/linuxbrew/.linuxbrew/bin/cmake --build /home/life/Develop/platform/zephyr-project/modules/lang/rust/samples/hello_world/build
@aolowin
Copy link
Contributor

aolowin commented Feb 7, 2025

I see this same error compiling for an nrf5340.

@biglben
Copy link

biglben commented Feb 10, 2025

I have the same with stm32h743. I got it working with the following patch. All rust samples seems to work but they don't need the flash, so i don't know if this would work.

--- a/dt-rust.yaml
+++ b/dt-rust.yaml
@@ -44,6 +44,7 @@
       - "nordic,nrf52-flash-controller"
       - "nordic,nrf51-flash-controller"
       - "raspberrypi,pico-flash-controller"
+      - "st,stm32-flash-controller"
       level: 0
   actions:
   - type: instance

@d3zd3z
Copy link
Collaborator

d3zd3z commented Feb 26, 2025

As you've discovered, this is fairly easy to fix, but points out a deeper issue that we don't have a solid mapping in Zephyr between nodes in the DT and what interface supports them. Unfortunately, that means to add new targets, it usually just takes some simple additions to the yaml file.

I'll describe this as an enhancement, because it is about running this on a platform not listed in etc/platforms.txt. However, it is fairly easy to add most of these.

@d3zd3z d3zd3z changed the title samples/hello_world: build fail. Support additional targest with Rust (was samples/hello_world: build fail.) Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants