Flight Controller Porting Guide

This topic is for developers who want to port PX4 to work with new flight controller hardware.

PX4 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). Please reference the PX4 Architectural Overview for more information.

This guide is focused only on the host OS and middleware as the applications/flight stack will run on any board target.

Flight Controller Configuration File Layout

In addition to the host operating system specific configuration files described below, there are several groups of configuration files for each board located throughout the code base:

Host Operating System Configuration

This section describes the purpose and location of the configuration files required for each supported host operating system to port them to new flight controller hardware.

NuttX

In order to port PX4 on NuttX to a new hardware target, that hardware target must be supported by NuttX. The NuttX project maintains an excellent porting guide for porting NuttX to a new computing platform.

For all NuttX based flight controllers (e.g. the Pixhawk series) the OS is loaded as part of the application build.

The configuration files for NuttX based boards, including linker scripts and other required settings are located under platforms/nuttx/nuttx-configs.

The following example uses FMUv5 as it is a recent reference configuration for NuttX based flight controllers:

The function of each of these files, and perhaps more, will need to be duplicated for a new flight controller board.

NuttX Menuconfig

If you need to modify the NuttX OS configuration, you can do this via menuconfig using the PX4 shortcuts:

make px4fmu-v5_default menuconfig
make px4fmu-v5_default qconfig

Linux

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

Middleware Components and Configuration

This section describes the various middleware components, and the configuration file updates needed to port them to new flight controller hardware.

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 eagle_default builds the Snapdragon Flight reference config.

results matching ""

    No results matching ""