Skip to main content

Documentation 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.

PX4 uses 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:
make <vendor>_<board>_<config>
  • vendor — the manufacturer or platform, e.g. px4, holybro, cuav
  • board — the specific hardware, e.g. fmu-v6x, sitl
  • config — the firmware configuration, usually default; omitting it is equivalent to default
For simulation targets, an optional simulator argument follows the make target:
make px4_sitl <simulator>_<vehicle>

Quick reference

make px4_sitl                   # SITL simulation (no simulator window)
make px4_sitl gz_x500           # SITL with Gazebo x500 quadrotor
make px4_fmu-v6x_default        # Pixhawk 6X firmware
make px4_fmu-v6x_default upload # Flash firmware to connected Pixhawk 6X
make clean                      # Remove build artifacts

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.
1

Navigate to the source directory

cd PX4-Autopilot
2

Build and launch SITL with Gazebo

The following command compiles PX4 and opens Gazebo with an x500 quadrotor model:
make px4_sitl gz_x500
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.
3

Arm and fly

From the pxh> prompt, take off with:
commander takeoff
Land with commander land, and stop the simulation with Ctrl+C or shutdown.
Connect QGroundControl before issuing flight commands. By default, PX4 requires an active ground control station connection before it permits takeoff.

Available SITL simulator targets

TargetDescription
make px4_sitl gz_x500Gazebo — x500 quadrotor
make px4_sitl gz_standard_vtolGazebo — standard VTOL
make px4_sitl gz_rc_cessnaGazebo — fixed-wing Cessna
make px4_sitl jmavsimjMAVSim — simple quadrotor
make px4_sitl noneSITL 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.
1

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.
2

Build the firmware

Replace px4_fmu-v6x_default with your board target:
make px4_fmu-v6x_default
A successful build ends with output like:
[954/954] Creating .../build/px4_fmu-v6x_default/px4_fmu-v6x_default.px4
The compiled firmware file is at build/<target>/<target>.px4.
3

Flash the firmware

Connect your flight controller via USB, then append upload to the same target:
make px4_fmu-v6x_default upload
PX4 detects the connected board, resets it into bootloader mode, and flashes the firmware automatically.
Disconnect any ESCs or motors from the flight controller before flashing. The board may briefly arm outputs during reset.

Common hardware targets

BoardMake target
Pixhawk 6Xmake px4_fmu-v6x_default
Pixhawk 6Cmake px4_fmu-v6c_default
Pixhawk 5Xmake px4_fmu-v5x_default
Pixhawk 4make px4_fmu-v5_default
Pixhawk 4 Minimake px4_fmu-v5_default
CUAV V5+make px4_fmu-v5_default
Holybro Kakute H7make holybro_kakuteh7_default
List all targetsmake list_config_targets

Docker builds

If you prefer not to install the toolchain locally, build inside the official PX4 Docker container:
./Tools/docker_run.sh 'make px4_fmu-v6x_default'
The container includes the full toolchain and produces identical output to a local build.

Cleaning build artifacts

Remove build files for a specific target without touching others:
make px4_fmu-v6x_default clean
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 your PATH. 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:
sudo usermod -aG dialout $USER
Then log out and back in. SITL build succeeds but Gazebo does not open Gazebo simulation tools may not have been installed. Re-run ubuntu.sh without the --no-sim-tools flag.

Build docs developers (and LLMs) love