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