There are two options for flashing the bootloader: via Betaflight Configurator (easier), or building from source.
To install the PX4 bootloader using the Betaflight Configurator:
- You should have downloaded already the pre-built bootloader binary (this depends on the board you want to flash).
- Download the Betaflight Configurator for your platform. > Tip If using the Chrome web browser, a simple cross-platform alternative is to install the configurator as an extension from here.
- Connect the board to your PC and start the Configurator.
- Press the Load Firmware [Local] button
- Select the bootloader binary from the file system and then flash the board.
You should now be able to install PX4 firmware on the board.
Download and build the Bootloader via:
git clone --recursive https://github.com/PX4/Bootloader.git cd Bootloader make <target> # For example: omnibusf4sd_bl or kakutef7_bl
Don't be afraid to try flashing using any of the methods below.
The STM32 MCU cannot be bricked. DFU cannot be overwritten by flashing and will always allow you to install a new firmware, even if flashing fails.
Both methods require the board to be in DFU mode. To enter DFU mode, hold the boot button down while connecting the USB cable to your computer. The button can be released after the board is powered up.
dfu-util -a 0 --dfuse-address 0x08000000 -D build/<target>/<target>.bin
Reboot the flight controller and it let it boot without holding the boot button.
See the dfuse manual here: https://www.st.com/resource/en/user_manual/cd00155676.pdf
In order to switch back to Betaflight:
- Backup the PX4 parameters, e.g. by exporting them to an SD card
- Keep the bootloader button pressed while attaching the USB cable
- Then flash Betaflight as usual with the Betaflight-configurator