How to Backup Flight Controller Using STM32CubeProgrammer (Saving Firmware and Config)

by Oscar
Cubeprogrommer Read All Flight Controller

A massive thank you to @John_Gardi for showing me how to back up and restore flight controllers using STM32CubeProgrammer. This tool reads the processor’s memory, making a complete backup of the firmware and configurations in a single file, which you can later restore.

Some of the links on this page are affiliate links. I receive a commission (at no extra cost to you) if you make a purchase after clicking on one of these affiliate links. This helps support the free content for the community on this website. Please read our Affiliate Link Policy for more information.

Disclaimer

I’ve only briefly tested this method. While it seems to work well, I advise caution. I am not responsible for any damage or configuration loss to your FC caused by following these instructions. Always back up your flight controller using conventional methods before trying this one.

For a safe backup/restore method, see this guide: https://oscarliang.com/backup-restore-betaflight-config/

Why It Matters?

This method creates a backup of the firmware and configurations in a single file. This makes backing up and restoring straightforward.

In my limited testing, I successfully switched between two different Betaflight versions, retaining all customized settings. I also tried switching between Betaflight and iNav in just a few clicks. The process took only about 30 seconds, making it an effective and efficient way to backup and restore.

This method should work with any Betaflight/iNav flight controller using STM32 processors, but I’ve only tested F405 so far.

Download

Get STM32CubeProg here: https://www.st.com/en/development-tools/stm32cubeprog.html

Enter DFU Mode

Betaflight Configurator Ports Dfu Mode

Follow this guide to put your flight controller in DFU mode: https://oscarliang.com/dfu-mode/

Close Betaflight Configurator, but leave the FC connected to your computer (still in DFU mode).

Connecting STM32CubeProg

Cubeprogrommer Connect Usb Flight Controller

Run STM32CubeProgrammer.

In the dropdown list next to ‘connect’, select “USB”, then click ‘Connect’.

Reading Flight Controller

Cubeprogrommer Read All Flight Controller

After connecting, choose ‘Read all’. This reads the entire processor memory which can then be saved.

Backing Up Data

Stm32cubeprogrommer Flight Controller Save As

To save the data, select “Save As”.

This will save both the firmware and all the settings in a single file. The size of the saved file should match the processor memory – either 512KB or 1MB depending on the type of FC processor. Learn more about FC processor here: https://oscarliang.com/f1-f3-f4-flight-controller/

Restoring Data

Stm32cubeprogrommer Flight Controller Open File

To restore a flight controller, click “Open file” to open the saved file.

Then click “Download” option (in the top right blue box) to write the data to the flight controller. The process takes about 30 seconds.

Leave a Comment

By using this form, you agree with the storage and handling of your data by this website. Note that all comments are held for moderation before appearing.

1 comment

falcongsr 13th July 2024 - 2:35 pm

This is really cool! Note it doesn’t work with non STM FC’s like Flywoo GN405

Reply