micro-ROS / micro-ROS/micro_ros_setup

"ELF: not found error" running "micro_ros_setup build_firmware.sh" for nucleo_f767zi on Raspberry Pi

未關閉
#623 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Shell
星號
509
分支
183
平均合併
22 小時 26 分鐘
30 天內合併 PR
7

描述

Issue template

  • Hardware description: Raspberry Pi 4B 4gb (with BCM2711 soc) running Ubuntu server 22.04 (LTS) 64-bit
  • RTOS: Free RTOS
  • Installation type: ping pong example on nucleo_f767zi on ROS2 Humble latest release
  • Version or commit hash: (default) humble
Steps to reproduce the issue

I followed the tutorial steps specified on the following page [https://micro.ros.org/docs/tutorials/core/first_application_rtos/freertos/]

I adjusted the line "ros2 run micro_ros_setup create_firmware_ws.sh freertos olimex-stm32-e407"
into "ros2 run micro_ros_setup create_firmware_ws.sh freertos nucleo_f767zi"

After that I entered the command "ros2 run micro_ros_setup configure_firmware.sh ping_pong --transport serial" according to the tutorial.

Errors occur at the buildstep "ros2 run micro_ros_setup build_firmware.sh"

Expected behavior

I expected that the build would happen without any problems. I followed the exact same steps within a docker container on my PC with an amd chipset without any problems. At the moment I try it on the arm infrastructure it does not work. I tried it in a docker image and with a local installation of ROS2.

Actual behavior

The following output is created showing an "ELF: not found" error:

root@daniel:/home/daniel/microros_ws# ros2 run micro_ros_setup build_firmware.sh
Crosscompiled environment: cleaning path
Building firmware for freertos platform nucleo_f767zi
Selected app: ping_pong
rm -fR /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/build
rm -f /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/arm_toolchain.cmake; \
cat /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/arm_toolchain.cmake.in | \
	sed "s/@CROSS_COMPILE@/\/home\/daniel\/microros_ws\/firmware\/freertos_apps\/microros_nucleo_f767zi_extensions\/..\/..\/toolchain\/bin\/arm-none-eabi-/g" | \
	sed "s/@FREERTOS_TOPDIR@/\/home\/daniel\/microros_ws\/firmware\/freertos_apps\/microros_nucleo_f767zi_extensions\/..\/../g" | \
	sed "s/@ARCH_CPU_FLAGS@/\"-mcpu=cortex-m7 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F767xx -Og -Wall -fdata-sections -ffunction-sections\"/g" | \
	sed "s/@ARCH_OPT_FLAGS@/\"\"/g" \
	> /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/arm_toolchain.cmake
cd /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/../../mcu_ws; \
colcon build \
	--packages-ignore-regex=.*_cpp \
	--metas /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/../../mcu_ws/colcon.meta /home/daniel/microros_ws/firmware/freertos_apps/apps/ping_pong/app-colcon.meta \
	--cmake-args \
	"--no-warn-unused-cli" \
	-DCMAKE_POSITION_INDEPENDENT_CODE=OFF \
	-DTHIRDPARTY=ON \
	-DBUILD_SHARED_LIBS=OFF \
	-DBUILD_TESTING=OFF \
	-DCMAKE_BUILD_TYPE= \
	-DCMAKE_TOOLCHAIN_FILE=/home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/arm_toolchain.cmake \
	-DCMAKE_VERBOSE_MAKEFILE=ON; \

Starting >>> rcutils 
Starting >>> rosidl_cli                
Starting >>> rosidl_typesupport_interface                              
Starting >>> microcdr                                                                                        
--- stderr: rcutils                                                              
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/../../toolchain/bin/arm-none-eabi-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/daniel/microros_ws/firmware/mcu_ws/build/rcutils/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_947dd/fast && gmake[1]: Entering directory '/home/daniel/microros_ws/firmware/mcu_ws/build/rcutils/CMakeFiles/CMakeTmp'
    /usr/bin/gmake  -f CMakeFiles/cmTC_947dd.dir/build.make CMakeFiles/cmTC_947dd.dir/build
    gmake[2]: Entering directory '/home/daniel/microros_ws/firmware/mcu_ws/build/rcutils/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_947dd.dir/testCCompiler.c.obj
    /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/../../toolchain/bin/arm-none-eabi-gcc   -std=c11 -mcpu=cortex-m7 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F767xx -Og -Wall -fdata-sections -ffunction-sections  -DCLOCK_MONOTONIC=0  -o CMakeFiles/cmTC_947dd.dir/testCCompiler.c.obj -c /home/daniel/microros_ws/firmware/mcu_ws/build/rcutils/CMakeFiles/CMakeTmp/testCCompiler.c
    /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/../../toolchain/bin/arm-none-eabi-gcc: 1: ELF: not found
    /home/daniel/microros_ws/firmware/freertos_apps/microros_nucleo_f767zi_extensions/../../toolchain/bin/arm-none-eabi-gcc: 4: Syntax error: "(" unexpected
    gmake[2]: *** [CMakeFiles/cmTC_947dd.dir/build.make:78: CMakeFiles/cmTC_947dd.dir/testCCompiler.c.obj] Error 2
    gmake[2]: Leaving directory '/home/daniel/microros_ws/firmware/mcu_ws/build/rcutils/CMakeFiles/CMakeTmp'
    gmake[1]: *** [Makefile:127: cmTC_947dd/fast] Error 2
    gmake[1]: Leaving directory '/home/daniel/microros_ws/firmware/mcu_ws/build/rcutils/CMakeFiles/CMakeTmp'
    
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


---
Failed   <<< rcutils [2.99s, exited with code 1]
Aborted  <<< microcdr [2.80s]                                                                                    
Aborted  <<< rosidl_cli [4.06s]                                                                              
Aborted  <<< rosidl_typesupport_interface [4.95s]                            

Summary: 0 packages finished [7.39s]
  1 package failed: rcutils
  3 packages aborted: microcdr rosidl_cli rosidl_typesupport_interface
  2 packages had stderr output: microcdr rcutils
  63 packages not processed
make: *** [Makefile:315: colcon_compile] Error 1
[ros2run]: Process exited with failure 2
Additional information

Any help will be greatly appreciated. Feel free to ask for additional information!

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 micro_ros_setup 的 build_firmware.sh 入口點和產生的 freertos_apps/microros_nucleo_f767zi_extensions/arm_toolchain.cmake 開始。在 Raspberry Pi 上重現針對 arm-none-eabi-gcc 的 CMake 編譯器測試,並檢查 toolchain 可執行檔為什麼會產生「ELF: not found」;完成標準是 nucleo_f767zi 的 ping_pong 韌體建置成功完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
cmake, shell
領域
build-system, embedded-iot
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。