this ppa may be useless:sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded有问题 报错:udo add-apt-repository ppa:terry.guo/gcc-arm-embedded tag:launchpad.net:2008:redacte 没关系不用理会。
更新:
先下载从官网下载1.7.1版本
tar -xzf eProsima_FastRTPS-1.7.1-Linux.tar.gz eProsima_FastRTPS-1.7.1-Linux/
tar -xzf eProsima_FastRTPS-1.7.1-Linux.tar.gz requiredcomponents
tar -xzf requiredcomponents/eProsima_FastCDR-1.0.8-Linux.tar.gz
接着执行下面命令安装,先查看你的cpu线程数。我是make -j12
cd eProsima_FastCDR-1.0.8-Linux
./configure --libdir=/usr/lib
make -j12
sudo make install
cd ..
cd eProsima_FastRTPS-1.7.1-Linux
./configure --libdir=/usr/lib
make -j12
sudo make install
cd ..
rm -rf requiredcomponents eprosima_fastrtps-1-7-1-linux.tar.gz
pushd .cd ~
wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
tar -jxf gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
exportline="export PATH=$HOME/gcc-arm-none-eabi-7-2017-q4-major/bin:\$PATH"
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
popd
然后重启电脑
检查是否安装成功:
arm-none-eabi-gcc --version
如果输出了像下面这样的:
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204] Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
mkdir -p ~/src cd src git clone -b v1.9.2 https://github.com/PX4/PX4-Autopilot.git cd PX4-Autopilot git submodule update --init --recursive
3.2编译一版最常用的固件,用于刷Pixhawk 4飞控
在PX4-Autopilot文件夹下面: make px4_fmu-v5_default 过程中也会下载很多东西,等一会儿就OK
这一步必须得成功,最终没有报错,输出:
-- Build files have been written to: /home/youruser/src/Firmware/build/nuttx_px4fmu-v4_default [954/954] Creating /home/youruser/src/Firmware/build/nuttx_px4fmu-v4_default/px4fmu-v4_default.px4
就OK了!恭喜你配完了!
(过程中的报错基本全是网速的锅,一定要找个网速好的地方!或者fq!)
(可跳过)3.3关于build的固件版本(并未尝试,maybe there is "_" in name ,please use Tab to list what it is):
Pixhawk 4: make px4_fmu-v5_default
Pixracer: make px4fmu-v4_default
Pixhawk 3 Pro: make px4fmu-v4pro_default
Pixhawk Mini: make px4fmu-v3_default
Pixhawk 2: make px4fmu-v3_default
mRo Pixhawk: make px4fmu-v3_default (supports 2MB Flash)
HKPilot32: make px4fmu-v2_default
Pixfalcon: make px4fmu-v2_default
Dropix: make px4fmu-v2_default
MindPX/MindRacer: make mindpx-v2_default
mRo X-2.1: make auav-x21_default
Crazyflie 2.0: make crazyflie_default
Intel® Aero Ready to Fly Drone: make aerofc-v1_default
Pixhawk 1: make px4fmu-v2_default