Bootloader Update
Last updated
Last updated
The PX4 Bootloader is used to load firmware for (PX4FMU, PX4IO).
Pixhawk controllers usually comes with an appropriate bootloader version pre-installed. However in some case it is not present, or an older version is present that needs to be updated.
This topic explains several methods for updating the Pixhawk bootloader.
:::note A case where you may need to update Pixhawk boards that install FMUv2 firmware: . :::
Boards starting with FMUv6X (STM32H7) use the in-tree PX4 bootloader.
This can be built from within the PX4-Autopilot folder using the make
command and the board-specific target with a _bootloader
suffix. For FMUv6X the command is:
This will build the bootloader binary as build/px4_fmu-v6x_bootloader/px4_fmu-v6x_bootloader.elf
, which can be flashed via SWD or DFU. If you are building the bootloader you should be familiar with one of these options already.
If you need a HEX file instead of an ELF file, use objcopy:
PX4 boards up to FMUv5X (before STM32H7) used a legacy repository.
Please refer to the instructions in the README to learn how to use it.
The steps are:
Insert an SD card (enables boot logging to debug any problems).
:::note The updated bootloader might be supplied in custom firmware (i.e. from the dev team), or it or may be included in the latest master. :::
Wait for the vehicle to reboot.
Reboot (disconnect/reconnect the board). The bootloader update will only take a few seconds.
An specific example of this process for updating the FMUv2 bootloader is given below.
If QGroundControl installs the FMUv2 target (see console during installation), and you have a newer board, you may need to update the bootloader in order to access all the memory on your flight controller.
To update the bootloader:
Insert an SD card (enables boot logging to debug any problems).
Wait for the vehicle to reboot.
Reboot (disconnect/reconnect the board). The bootloader update will only take a few seconds.
The following steps explain how you can "manually" update the bootloader using the dronecode probe:
Get a binary containing the bootloader (either from dev team or build it yourself).
Connect the Dronecode probe to your PC via USB.
Go into the directory containing the binary and run the following command in the terminal:
The gdb terminal appears and it should display the following output:
Find your <dronecode-probe-id>
by running an ls command in the /dev/serial/by-id directory.
Now connect to the Dronecode probe with the following command:
Power on the Pixhawk with another USB cable and connect the Dronecode probe to the FMU-DEBUG port.
:::note To be able to connect the Dronecode probe to the FMU-DEBUG port, you may need to remove the case (e.g. on Pixhawk 4 you would do this using a T6 Torx screwdriver). :::
Use the following command to scan for the Pixhawk’s swd and connect to it:
Load the binary into the Pixhawk:
The easiest approach is to first use QGroundControl to install firmware that contains the desired/latest bootloader. You can then initiate bootloader update on next restart by setting the parameter: .
:::note This approach can only be used if is present in firmware (currently just FMUv2 and some custom firmware). :::
with an image containing the new/desired bootloader.
the parameter .
Generally at this point you may then want to again using the correct/newly installed bootloader.
:::note Early FMUv2 flight controllers had a that restricted them to using 1MB of flash memory. The problem is fixed on newer boards, but you may need to update the factory-provided bootloader in order to install FMUv3 Firmware and access all 2MB available memory. :::
to PX4 master version (when updating the firmware, check Advanced settings and then select Developer Build (master) from the dropdown list). QGroundControl will automatically detect that the hardware supports FMUv2 and install the appropriate Firmware.
the parameter .
Then again. This time QGroundControl should autodetect the hardware as FMUv3 and update the Firmware appropriately.
:::note If the hardware has the it will still be detected as FMUv2 and you will see that FMUv2 was re-installed (in console). In this case you will not be able to install FMUv3 hardware. :::
After the bootloader has updated you can using QGroundControl.
Boards that are not part of the will have their own mechanisms for bootloader update.
For boards that are preflashed with Betaflight, see .