StmDfuUsb is android application for uploading firmware on Stm32 CPU from mobile gadget via USB-OTG cable.
Realization of the application is based on next documents from company STMicroelectronics.
1. AN2606 STM32 microcontroller system memory boot mode
2. AN3156 USB DFU protocol used in the STM32 bootloader
1. Make sure that you stm32 microcontroller support usb dfu bootloader. You can find it from AN2606 or from table here.
2. Connect Stm32 board with your mobile device by USB-OTG cable
PA11 - USB DM line
PA12 - USB DP line
3. Activate bootloader mode for Stm32. How to do this read in AN2606. In general you should set pins BOOT0 and BOOT1 in correct combination according to model of your CPU.
1. Select file with firmware you want to write. It should be in Intel hex or Raw binary format.
2. Set writing options you need. You can select next options
- Erase only necessary pages
- Unset readout protection if need
- Go CPU after programming
3. Press button "Load file to flash" and wait for finish of operation.