Updating Firmware of STM32 CPU via USB Cable Using USB DFU Protocol
Application for Updating Firmware of STM32 CPU via USB Cable Using USB DFU Protocol
The realization of the application is based on the following documents from STMicroelectronics:
- AN2606 STM32 Microcontroller System Memory Boot Mode
- AN3156 USB DFU Protocol Used in the STM32 Bootloader
How to Use the Application
PREREQUISITE
Your mobile device must support USB-OTG.
PREPARATION
- Connect the STM32 board to your mobile device using a USB-OTG cable.
- Activate bootloader mode for the STM32. Refer to AN2606 for detailed instructions. Generally, you need to set pins BOOT0 and BOOT1 in the correct combination according to your CPU model.
PROGRAMMING
Select the firmware file you wish to upload. The firmware file should be in one of the following formats:
- Intel hex
- Motorola S-Record
- DfuSe (STMicroelectronics DFU format)
- Raw binary
Set the writing options according to your needs. You can choose from the following options:
- Erase only necessary pages
- Unset readout protection if necessary
- Run CPU after programming
Press the "Load file to flash" button and wait for the operation to complete.
Additional Operations Available in the Application
- Erasing
- Checking flash for blank
- Comparing flash with file
You can access these operations via the appropriate menu points.
Tested Models of Microcontrollers
The application has been successfully tested on the following STM32 microcontroller models:
- STM32F072
- STM32F205
- STM32F302
- STM32F401
- STM32F746
- STM32G474
- STM32L432
RESTRICTIONS ON USING
You can perform up to 25 firmware uploads completely free of charge. After reaching this limit, you can purchase one of the following services:
- An additional 100 uploads
- Unlimited use of the application