PX4 usesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/PX4/PX4-Autopilot/llms.txt
Use this file to discover all available pages before exploring further.
make as its primary build interface. A single command compiles the firmware for a specific board configuration, launches a simulator, or flashes firmware to connected hardware. You build the same codebase for both simulation and real targets — only the make target changes.
Before building, make sure you have completed the development environment setup. You need the ARM cross-compiler, CMake, and Python installed.
Make target format
Every PX4 make target follows the same pattern:vendor— the manufacturer or platform, e.g.px4,holybro,cuavboard— the specific hardware, e.g.fmu-v6x,sitlconfig— the firmware configuration, usuallydefault; omitting it is equivalent todefault
Quick reference
Building for simulation (SITL)
Software-in-the-loop (SITL) simulation compiles PX4 to run as a native process on your computer. Start here to validate your setup before working with hardware.Build and launch SITL with Gazebo
The following command compiles PX4 and opens Gazebo with an x500 quadrotor model:The first build takes several minutes as it compiles all modules. Subsequent builds are incremental and much faster.Once the build completes, Gazebo launches and the PX4 shell (
pxh>) appears in your terminal.Available SITL simulator targets
| Target | Description |
|---|---|
make px4_sitl gz_x500 | Gazebo — x500 quadrotor |
make px4_sitl gz_standard_vtol | Gazebo — standard VTOL |
make px4_sitl gz_rc_cessna | Gazebo — fixed-wing Cessna |
make px4_sitl jmavsim | jMAVSim — simple quadrotor |
make px4_sitl none | SITL with no simulator (MAVLink only) |
Building for hardware
Hardware builds cross-compile PX4 for a specific flight controller. The output is a.px4 firmware file that you flash to the board.
Identify your board target
Find the make target for your flight controller in the table below, or run
make list_config_targets to list all available targets.Build the firmware
Replace A successful build ends with output like:The compiled firmware file is at
px4_fmu-v6x_default with your board target:build/<target>/<target>.px4.Common hardware targets
| Board | Make target |
|---|---|
| Pixhawk 6X | make px4_fmu-v6x_default |
| Pixhawk 6C | make px4_fmu-v6c_default |
| Pixhawk 5X | make px4_fmu-v5x_default |
| Pixhawk 4 | make px4_fmu-v5_default |
| Pixhawk 4 Mini | make px4_fmu-v5_default |
| CUAV V5+ | make px4_fmu-v5_default |
| Holybro Kakute H7 | make holybro_kakuteh7_default |
| List all targets | make list_config_targets |
Docker builds
If you prefer not to install the toolchain locally, build inside the official PX4 Docker container:Cleaning build artifacts
- Clean one target
- Clean everything
Remove build files for a specific target without touching others:
A full
make clean followed by a rebuild is rarely necessary. Incremental builds correctly detect changed files. Clean only when you suspect a stale build cache is causing unexpected behaviour.Troubleshooting
Build fails immediately with “command not found: arm-none-eabi-gcc” The ARM cross-compiler is not installed or not on yourPATH. Re-run the environment setup and restart your terminal.
upload fails with “no device found”
Make sure the flight controller is connected via USB and that you have permission to access the serial port. On Linux, add your user to the dialout group:
ubuntu.sh without the --no-sim-tools flag.