Going directly to the topic, I was numbed by this problem today. I can't find a similar error on the main website.
The problem is that the arm-none-eabi version you are using is wrong. Take the Ardusub I'm using as an example. As of writing my blog, I support arm-none-eabi 6.3.1, which is the version shown below
enter
arm-none-eabi-gcc --version
You can view the current version, the correct output should be
At the beginning, I installed PX 4 first, and then installed APM. When installing PX4, I couldn’t install arm-none-eabi directly from the .sh method due to the network speed problem. Later, I installed it myself for the sake of convenience. Download Is the latest version. You can use the above command to check your default version (if two are installed). The following is wrong
If two versions are installed, just delete the wrong version under /opt.
If only the wrong version is installed, follow the official steps yourself (see below). Or students with poor internet speed can download it by themselves. The link is here .
Therefore, it is best not to come according to the official installation, here is a brief talk (mainly I am afraid I will forget it later). The following content is only for Ubuntu systems
Installation error
You can refer to the steps on the official website yourself:
Setting up the Build Environment (Linux/Ubuntu)
Basic
The first is to download the source code and update the submodule
git clone https://github.com/your-github-userid/ardupilot
cd ardupilot
git submodule update --init --recursive
Execute the following statement to install the necessary packages (important!)
Tools/environment_install/install-prereqs-ubuntu.sh -y
Update path
. ~/.profile
Then run
gedit ~/.bashrc
Put the following two paragraphs at the end of the file and save
export PATH=$PATH:$HOME/ardupilot/Tools/autotest
export PATH=/usr/lib/ccache:$PATH
Then execute
~/.bashrc
At this point, the APM tool chain installation is complete.
Ardusub
Students who need to compile the firmware by themselves can take a look at this part. Take Ardusub as an example:
Before compiling ArduSub, first check out the ArduSub-stable tag to the new branch
git fetch --tags
git checkout ArduSub-stable -b new-branch
git submodule update --init --recursive
The following commands can view the commands that can be matched, such as the supported boards
./waf --help
For Ardusub users, the Pixhawk 2.4.8 board is generally used, then the corresponding
./waf configure --board Pixhawk1
Then you can compile
./waf sub
The firmware was created at:
ardupilot/build/Pixhawk1/bin/ardusub.apj
Upload as follows:
./waf --upload sub
Additional error resolution
After solving the version error of the cross-compiler before, the compilation can be carried out smoothly, but it still reports an error when it is almost successful. Now
execute
rm -rf build/
Clean up the files in the build path and recompile
./waf configure --board Pixhawk1
./waf sub
The results after success are as follows: