cd Firmware
make posix_rpi_cross upload # for cross-compiler build
然后,通过ssh连接并运行它(以root权限):
sudo ./px4 px4.config
二、自己的添加和总结
make posix_rpi_cross后出现的问题:
-- CMAKE_MODULE_PATH: /home/myfly2/src/myFirmware/Firmware/cmake
-- Build Type: RelWithDebInfo
-- PX4 VERSION: v1.6.5-114-g4ccbeb4
-- CONFIG: posix-rpi-cross
-- CMAKE_INSTALL_PREFIX: /usr
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: arm-linux-gnueabihf-gcc
CMake Error at CMakeLists.txt:275 (project):
The CMAKE_CXX_COMPILER:
arm-linux-gnueabihf-g++
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:275 (project):
The CMAKE_C_COMPILER:
arm-linux-gnueabihf-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:275 (project):
The CMAKE_ASM_COMPILER:
arm-linux-gnueabihf-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!
See also "/home/myfly2/src/myFirmware/Firmware/build_posix_rpi_cross/CMakeFiles/CMakeOutput.log".
See also "/home/myfly2/src/myFirmware/Firmware/build_posix_rpi_cross/CMakeFiles/CMakeError.log".
/bin/sh: 1: cd: can't cd to /home/myfly2/src/myFirmware/Firmware/build_posix_rpi_cross
Makefile:158: recipe for target 'posix_rpi_cross' failed
make: *** [posix_rpi_cross] Error 2
解决办法:
修改~/.profile,增加环境:
-- CMAKE_MODULE_PATH: /home/myfly2/src/myFirmware/Firmware/cmake
-- Build Type: RelWithDebInfo
-- PX4 VERSION: v1.6.5-114-g4ccbeb4
-- CONFIG: posix-rpi-cross
-- CMAKE_INSTALL_PREFIX: /usr
-- The CXX compiler identification is GNU 4.8.3
-- The C compiler identification is GNU 4.8.3
-- The ASM compiler identification is GNU
-- Found assembler: /opt/rpi_toolchain/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
-- Check for working CXX compiler: /opt/rpi_toolchain/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /opt/rpi_toolchain/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /opt/rpi_toolchain/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /opt/rpi_toolchain/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
couldn't find python module jinja2:
for debian systems try:
sudo apt-get install python-jinja2
or for all other OSs/debian:
sudo -H pip install jinja2
(missing: PY_JINJA2)
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
cmake/common/px4_base.cmake:621 (find_package_handle_standard_args)
CMakeLists.txt:295 (px4_find_python_module)
-- Configuring incomplete, errors occurred!
See also "/home/myfly2/src/myFirmware/Firmware/build_posix_rpi_cross/CMakeFiles/CMakeOutput.log".
/bin/sh: 1: cd: can't cd to /home/myfly2/src/myFirmware/Firmware/build_posix_rpi_cross
Makefile:158: recipe for target 'posix_rpi_cross' failed
make: *** [posix_rpi_cross] Error 2
这个问题少了jinja2: