Flight Controller Porting Guide
This topic is for developers who want to port PX4 to work with new flight controller hardware.
Architecture
PX4 consists of two main layers: The board support and middleware layer on top of the host OS (NuttX, Linux or any other POSIX platform like Mac OS). And the applications (Flight Stack in src/modules).
This guide is focused only on the middleware as the applications will run on any board target.
NuttX Boards
The location of the main files for a NuttX board are:
- Board startup and PX4 board configuration: src/drivers/boards. It contains bus and GPIO mappings and the board initialization code.
- FMUv5 example: src/drivers/boards/px4fmu-v5.
- NuttX board config: nuttx-configs. The OS gets loaded as part of the application build.
- FMUv5 example: nuttx-configs/px4fmu-v5/include/board.h.
- NuttX OS config (created with menuconfig): nuttx-configs/px4fmu-v5/nsh/defconfig.
- Linker scripts and other required settings: nuttx-configs.
- FMUv5 example: nuttx-configs/px4fmu-v5.
- Boot file system (startup script): ROMFS/px4fmu_common
- Board build configuration: cmake/configs/nuttx_px4fmu-v5_default.cmake.
- Drivers: src/drivers.
- Reference config: Running
make px4fmu-v4_default
builds the FMUv4 config, which is the current NuttX reference configuration.
NuttX Menuconfig
If you need to modify the NuttX menuconfig you can do this using the PX4 shortcuts:
make px4fmu-v2_default menuconfig
make px4fmu-v2_default qconfig
QuRT / Hexagon
- The start script is located in posix-configs/.
- The OS configuration is part of the default Linux image (TODO: Provide location of LINUX IMAGE and flash instructions).
- The PX4 middleware configuration is located in src/drivers/boards. TODO: ADD BUS CONFIG
- Drivers: DriverFramework.
- Reference config: Running
make qurt_eagle_release
builds the Snapdragon Flight reference config.
Linux Boards
Linux boards do not include the OS and kernel configuration. These are already provided by the Linux image available for the board (which needs to support the inertial sensors out of the box).
- cmake/configs/posix_rpi_cross.cmake - RPI cross-compilation.
Related Information
- Device Drivers - How to support new peripheral hardware (device drivers)
- Building the Code - How to build source and upload firmware
- Supported Flight Controllers:
- Autopilot Hardware (PX4 User Guide)
- Supported boards list (Github)
- Supported Peripherals (PX4 User Guide)