Main Content

Disabling Modules in PX4board Build Target File

With the PX4 firmware v1.14 upgrade, the PX4 source size has increased. If you enable all PX4 modules for the build, the build might fail due to flash overflow. This guide shows you how to disable certain modules based on your use case.

Remove the modules that you don not need for your specific requirement. For example, if you are designing a multicopter, remove the Fixed-wing controller modules, and vice versa. Perform these steps to disable modules in the px4board build target file.

Step1: Open px4board build target file

For each PX4 autopilot there is a corresponding px4board build target file. For example, if you are using PX4 Cube Black, the build target is px4_fmu-v3_default. Navigate to the corresponding px4board build target file location.

If a default original file exists, open that; otherwise, open the default file.

Step2: Disable control modules from build

All the modules that will be added to the build are listed in the px4board file.

By defining '=y', a module will be enabled for the build. To disable a specific module, define it as '=n'. The following recommendations indicate which modules to disable based on the airframe you want to design.

Multicopter

'CONFIG_MODULES_FW_ATT_CONTROL',

'CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL',

'CONFIG_MODULES_FW_POS_CONTROL',

'CONFIG_MODULES_FW_RATE_CONTROL',

'CONFIG_MODULES_VTOL_ATT_CONTROL',

'CONFIG_MODULES_AIRSPEED_SELECTOR'

Fixed-wing

'CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR',

'CONFIG_MODULES_MC_RATE_CONTROL',

'CONFIG_MODULES_VTOL_ATT_CONTROL',

'CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL'

VTOL

'CONFIG_MODULES_FW_ATT_CONTROL',

'CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL',

'CONFIG_MODULES_FW_POS_CONTROL',

'CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR',

'CONFIG_MODULES_MC_RATE_CONTROL',

'CONFIG_MODULES_VTOL_ATT_CONTROL',

'CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL'

Step3: Save build target file

Once the necessary changes are made, save the build target file. Consider saving the file with a new name, such as multicopter.px4board.

In the setup screen, choose the newly saved px4board build target file using the custom px4board file option.

Click Browse and navigate to your px4board file location.