Updating Firmware of STM32 CPU via USB Cable Using USB DFU Protocol
Application Overview
This application facilitates firmware updates for STM32 CPUs via USB cable using the USB DFU protocol. Its implementation is based on documentation from STMicroelectronics:
- AN2606: STM32 Microcontroller System Memory Boot Mode
- AN3156: USB DFU Protocol Used in the STM32 Bootloader
Usage
Prerequisites:
- USB-OTG support on your mobile device
Preparation:
- Connect the STM32 board to your mobile device using a USB-OTG cable.
- Activate bootloader mode for the STM32 (refer to AN2606 for instructions).
Programming:
Select the firmware file to write. Supported formats include:
- Intel Hex
- Motorola S-Record
- DfuSe (STMicroelectronics DFU format)
- Raw binary
Configure writing options:
- Erase only necessary pages
- Unset readout protection (if required)
- Go to CPU after programming
- Click "Load File to Flash" and wait for the operation to complete.
Additional Operations:
- Erasing
- Checking flash for blank
- Comparing flash with file
Select these operations from the menu.
Tested Microcontrollers:
- STM32F072
- STM32F205
- STM32F302
- STM32F401
- STM32F746
- STM32G474
- STM32L432
Usage Restrictions:
Free usage is limited to 25 firmware uploads. After reaching this limit, you can purchase:
- 100 additional uploads
- Unlimited usage