Make px4_fmu-v3_rtps upload

I’m trying to flash my pixhawk with px4 with rtps from a raspberry pi 4 using Ubuntu 20.04 LTS. However, when I run make px4_fmu-v3_rtps I get the following error below. How can I fix this error?

pi4@pi4-desktop:~/PX4-Autopilot$ make px4_fmu-v3_rtps
-- PX4 version: v1.11.0-rc3-1014-g850d0bc588
-- PX4 config file: /home/pi4/PX4-Autopilot/boards/px4/fmu-v3/rtps.cmake
-- PX4 config: px4_fmu-v3_rtps
-- PX4 platform: nuttx
-- cmake build type: MinSizeRel
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
-- Check for working CXX compiler: /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
-- Check for working CXX compiler: /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
  The C++ compiler


  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/pi4/PX4-Autopilot/build/px4_fmu-v3_rtps/CMakeFiles/CMakeTmp
    Run Build Command(s):/usr/bin/ninja cmTC_565d2 && [1/2] Building CXX object CMakeFiles/cmTC_565d2.dir/testCXXCompiler.cxx.obj
    FAILED: CMakeFiles/cmTC_565d2.dir/testCXXCompiler.cxx.obj 
    /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++     -o CMakeFiles/cmTC_565d2.dir/testCXXCompiler.cxx.obj -c testCXXCompiler.cxx
    /bin/sh: 1: /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++: Exec format error
    ninja: build stopped: subcommand failed.


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:202 (project)

-- Configuring incomplete, errors occurred!
See also "/home/pi4/PX4-Autopilot/build/px4_fmu-v3_rtps/CMakeFiles/CMakeOutput.log".
See also "/home/pi4/PX4-Autopilot/build/px4_fmu-v3_rtps/CMakeFiles/CMakeError.log".
Error: /home/pi4/PX4-Autopilot/build/px4_fmu-v3_rtps is not a directory
make: *** [Makefile:219: px4_fmu-v3_rtps] Error 1

It looks like your compiler binary is not the proper one for your platform.

Could you please run this command and check the output:

If you still get the “Exec format error” please check this command:
file /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++

Thank you for the reply! After running this second command, I get:

$ file /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/, for GNU/Linux 2.6.24, BuildID[sha1]=2a352bec28232f5df202365d42b71927e5717324, stripped

Does “stripped” mean it is not working?


Your problem seems to be that you’re trying to run an x86_64 executable under ARM OS…

It looks like you’ve installed a GCC cross-compiler for RPi 4, one that produces ARM output but meant to run in x86_64 platforms.

You just need to have a native GCC compiler running in the RPi 4 device.

Ok thank you for your help. I was trying to avoid it, but I will go ahead and try this on a real linux computer instead.