tags: hardware git linux cygwin
table of Contents
First, establish a flying control firmware compilation environment
1.1 Get Flight Control Source Code
1.2 Run the Automation Profile using PowerShell
1.3 Installing the Future Library, Python3
1.4 Download and install the GCC compiler
1.5 Configuring environment variables
1.6 Switch to the latest stable version of the firmware
Second, based on WAF compilation APM flying control firmware
2.1 Configuring Flight Control Types
2.2 Compiling Fly Control Firmware
2.3 Burn Flight Control Firmware
table of Contents
First, establish a flying control firmware compilation environment
1.1 Get Flight Control Source Code
1.2 Run the Automation Profile using PowerShell
1.3 Installing the Future Library, Python3
1.4 Download and install the GCC compiler
1.5 Switch to the latest stable version of the flying control firmware
Second, based on WAF compilation APM flying control firmware
2.1 Configuring Flight Control Types
2.2 Compiling Fly Control Firmware
2.3 Burn Flight Control Firmware
Source address:https://github.com/ArduPilot/ardupilot
It is recommended to install the GIT to facilitate download source and code management. link:https://git-scm.com/
After installing git, open Git Bash

Use the gitclone command Clone flight control code, not detail, please learn from your own method.
pay attention:
1. Do not place the Flight Control Source Code Ardupilot folder into the C drive, the Win10 operating system is very strict to the access rights of the C drive, which will result in the back compile time.
2. Flying source code paths cannot contain Chinese, otherwise it will also be reported when compiling.
Start button right click, or Ctrl + X, administrator runs PowerShell

After opening, pass the CD command, go to. \ ArduPilot \ Tools \ Environment_INSTALL directory

Enter. \ Then press the Tab key to switch to Install-prereqs-windows.ps1, run the carriage return.
The download process may sometimes need to hang the VPN, you can hang mostly, if there is a problem, try to run once or more, still can't, turn off the ladder, and then download it.
Run "setup x86_64.exe", install CYGWIN64 and other environments
If the software defaults to generate environment variables, it is only generated.
.. \ gnu Tools ARM Embedded \ 6 2017-Q2-Update \ BIN This path
COULD NOT FIND THE PROGRAM ['ARM-NONE-EABI-AR']] This error will appear when compiling
Arm-none-eabi-ar's path in, .. \ gnu Tools ARM Embedded \ 6 2017-q2-update \ ARM-NONE-EABI \ BIN
Therefore, the environment variable has to manually add one

After confirming the shutdown all the way, restart the computer to take effect (personal test), otherwise it will still report the error "Could Not Find The Program ['ARM-NONE-EABI-AR']".
git checkout -b MyCopter3.6.7 Copter-3.6.7
git checkout -b MyPlane4.0.5 ArduPlane-4.0.5
The branch name can be replaced by self-replacement, and the flying control firmware of any version of the stable version can be replaced on demand.
Note: Do not switch to the "Master" branch, this is an unstable version, and in most cases, the code of the Master branch is unable to compile
Just switch over the branch, remember to update the child module.
git submodule update --init --recursive
Switching the firmware version is "git bash", and the compiling firmware is "cygwin64", and the two looks almost, don't mix.
CD to the ArduPilot directory
View all supported types
./waf list_boards
Set the compilation target to FMUV3 version of the flight control
If your flight control is pixhawk2.4.x, the FMUV3 here will be changed to Fmuv2; if your flight control is Pixhawk4, it will change the FMUV3 here to Pixhawk4, and
./waf configure --board fmuv3
/ If it is compiled multifier firmware, run the following command
./waf copter
/ If it is compiled conventional fixed wing firmware or vertical start-off fixation (both the same firmware), run the following command
./waf plane
/ If you are compiling a helicopter firmware, run the following command
./waf heli
If it is compiled unmanned car firmware, run the following command
./waf rover
If it is compiled submarine firmware, run the following command
./waf sub
./waf AP_Periph
./waf distclean This command is equivalent to manually deleting "ArduPilot / folder
./waf -h
to sum up:
1. Install the latest version of the ground station MissionPlanner;
2. Compiled firmware in Ardupilot / Bulid / Fmuv3 / Bin / ArduCopter.apj, using the Mission Planner for firmware.
Source code framework pixhawk code framework: Basic analysis of pixhawk code framework: When reading the following content, please read the source code for easy understanding. The basic structure of A...
Since the project needs to do secondary development of PX4 based on Simulink, it is done under Windows, so you need to view the code of PX4 under Windows, so write this document to record the environm...
Look at the apm source code these few days, and see the pwm output, make a note, so that you can look back later. There is something wrong with the analysis, and I hope you all point out. The pwm outp...
Ubuntu20.04 Using Eclipse Build ARDUPILOT Source Code background Recently, due to the project needs to learn an open source ArduPilot code architecture, the huge code is very close. Regardless of the ...
ardupilot-4.0.7 version source framework_1# basic structure outermost file file name content AntennaTracker Antenna Tracker APP APMrover2 Smart car APP ArduCopter Multi-rotor APP ArduPlane Fixed-wing ...
From: http://blog.sina.com.cn/s/blog_6266a8840102xp0f.html Tower supports most of the functions of the usual UAV ground stations, and is used for android phones, which is convenient to carry. software...
How to Read pixhawk source code for secondary development? Original http://blog.sina.com.cn/s/blog_8fe4f2f40102wm29.html Are directed px4 native described below firmware. In addition, due to the firmw...
I first saw this course Seeing that there are control algorithms that talk about pixhawk, I began to want to learn this aspect, but I originally planned to buy this course and found it not cost-effect...
I have recently learned the SPI driver software, and it summarizes it here. The code used in this article is the source code of Pixhawk 1.5.5 version. Source download address The first step function e...
First, hbase architecture introduction HBase is an open source, distributed, data-multiple version, columnar storage nosql database. Hadoop's distributed file system, HDFS, is the underlying storage t...