Main Content

Troubleshooting Flash Overflow Issues with Pixhawk 1

Description

If you are trying to deploy the Simulink model configured for a Pixhawk 1 flight controller by clicking the Build, Deploy & Start icon () in the Hardware tab of Simulink toolstrip, you may see the following flash overflow error towards the end of the build process:

The reasons for this issue can be:

  • You have used the CMake file px4fmu-v2_default, which is the default for the Pixhawk 1 flight controller, but the 1MB flash memory limit is exceeded.

  • The Simulink model is large, and the generated code has exceeded the 1MB flash memory limit.

Action

To troubleshoot the issue, there are two options:

  • Select another CMake file for the firmware build and configuration. To do this, perform the following tasks:

    1. From the Simulink model, open the Configuration Parameters dialog box.

    2. Go to Target Hardware Resources > Build options pane, and click Change CMake configuration to open the Hardware Setup screen.

    3. In the Hardware Setup screens, go to the Select CMake Configuration screen, select Custom CMake file, and then click Browse.

    4. Select nuttx_px4fmu-v3_default.cmake, and click Open.

    5. Click Next and proceed with the remaining steps of Hardware Setup process.

    6. From the Simulink model, open the Configuration Parameters dialog box again, and select the option Allow flashing FMUv3 CMake configuration on Pixhawk 1.

      Note

      This option should be carefully used because enabling this option will result in the following:

      • There will not be any check either for the selected CMake compatibility on the connected Pixhawk controller or for any silicon errata on the Pixhawk board.

      • If the CMake is not compatible with the Pixhawk controller, the entire board can get into a faulty state.

      Hence, only use this option if you have connected Pixhawk 1 and you want to flash FMUv3 CMake on Pixhawk 1.

    7. Click Apply and then OK to close the dialog box.

    8. In the Hardware tab of the Simulink toolstrip, click Build, Deploy & Start () to start the process again.

  • If you do not want to change the CMake (px4fmu-v2_default) that is designed for the hardware, you can also troubleshoot the issue if you change the contents of the CMake file. To do this:

    1. Go to the location of the CMake files in the px4 directory (for example, C:\mypx4\Firmware\cmake\configs.

    2. Edit the nuttx_px4fmu-v2_default.cmake file and remove the modules that you do not want to build (you can comment-out those lines).

    3. Open the Simulink model and try the Deploy to Hardware process again.