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

    "/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++"

  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:
/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++

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/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=2a352bec28232f5df202365d42b71927e5717324, stripped

Does “stripped” mean it is not working?

No

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.

Hello @HatTricker12 I am getting the same issue, I am trying to build this in cygwin for windows development and this is the error :

Dell@Harsh ~/PX4-Autopilot
$ make px4_fmu-v3_default VERBOSE=1
Re-run cmake no build system arguments
-- PX4_GIT_TAG: v1.15.0-beta1-2620-ge8f8bc9af7
CMake Warning (dev) at CMakeLists.txt:176 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.9.16", minimum required is "3")
-- PX4 config file: /cygdrive/c/PX4/home/PX4-Autopilot/boards/px4/fmu-v3/default.px4board
-- PLATFORM nuttx
-- TOOLCHAIN arm-none-eabi
-- ARCHITECTURE cortex-m4
-- ROMFSROOT px4fmu_common
-- IO px4_io-v2_default
-- CONSTRAINED_MEMORY y
-- SERIAL_GPS1 /dev/ttyS3
-- SERIAL_TEL1 /dev/ttyS1
-- SERIAL_TEL2 /dev/ttyS2
-- SERIAL_TEL4 /dev/ttyS6
-- ROOT_PATH /fs/microsd
-- PARAM_FILE /fs/mtd_params
-- UAVCAN_INTERFACES 2
-- PX4 config: px4_fmu-v3_default
-- PX4 platform: nuttx
-- The CXX compiler identification is GNU 9.3.1
-- The C compiler identification is GNU 9.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /cygdrive/c/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-gcc.exe
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /cygdrive/c/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-g++.exe
-- Check for working CXX compiler: /cygdrive/c/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-g++.exe - broken
CMake Error at /usr/share/cmake-3.28.3/Modules/CMakeTestCXXCompiler.cmake:60 (message):
  The C++ compiler

    "/cygdrive/c/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-g++.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/cygdrive/c/PX4/home/PX4-Autopilot/build/px4_fmu-v3_default/CMakeFiles/CMakeScratch/TryCompile-sRqtpb'

    Run Build Command(s): /usr/bin/ninja.exe -v cmTC_88049
    [1/2] "/cygdrive/c/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-g++.exe"    -o CMakeFiles/cmTC_88049.dir/testCXXCompiler.cxx.obj -c /cygdrive/c/PX4/home/PX4-Autopilot/build/px4_fmu-v3_default/CMakeFiles/CMakeScratch/TryCompile-sRqtpb/testCXXCompiler.cxx
    FAILED: CMakeFiles/cmTC_88049.dir/testCXXCompiler.cxx.obj
    "/cygdrive/c/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/arm-none-eabi-g++.exe"    -o CMakeFiles/cmTC_88049.dir/testCXXCompiler.cxx.obj -c /cygdrive/c/PX4/home/PX4-Autopilot/build/px4_fmu-v3_default/CMakeFiles/CMakeScratch/TryCompile-sRqtpb/testCXXCompiler.cxx
    arm-none-eabi-g++.exe: error: /cygdrive/c/PX4/home/PX4-Autopilot/build/px4_fmu-v3_default/CMakeFiles/CMakeScratch/TryCompile-sRqtpb/testCXXCompiler.cxx: No such file or directory
    arm-none-eabi-g++.exe: fatal error: no input files
    compilation terminated.
    ninja: build stopped: subcommand failed.





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


-- Configuring incomplete, errors occurred!
Error: /cygdrive/c/PX4/home/PX4-Autopilot/build/px4_fmu-v3_default is not a directory
make: *** [Makefile:227: px4_fmu-v3_default] Error 1

Dell@Harsh ~/PX4-Autopilot
$

How did you solve it ?

You are replying to a 4 year old post you won’t receive any help, and I doubt the issue is similar. Please follow our documentation and if that doesn’t work create an issue or a new post with exact details of what went wrong for you.