cancel
Showing results for 
Search instead for 
Did you mean: 

USB DFU Erase and Program Time

MSute.1
Associate

Hello everyone,

We use a STM32F7 and we have built a bootloader which uses the USB-DFU library from ST (usbd_dfu_flash). We can successfully program the internal and external flash. We noticed that it takes quite long so we were looking for ways to increase the download speed. We found a pretty obvious bottle neck: FLASH_ERASE_TIME and FLASH_PROGRAM_TIME were set to 50ms, so the host always waits 50ms before requesting the status of the bootloader to check if it is done with erasing/flashing. If we set those values to 0, we could reduce the download time from about 6min to 40s. In this time we transfer around 6MB of data. We tested everything with an endurance test and looked into the communication with an usb analyzer and couldn't see negative effects.

Why is the default 50ms which makes the erase/download really slow? In which circumstances should someone use anything other than 0? Is this only for really slow microcontrollers, so that they wont be "overloaded" with interrupts?

Thank you for your attention.

Greetings Mario

EDIT: We use the USB-DFU Library generated by CubeMX

STM32CubeMX Version 5.3.0

STM32Cube MCU Package for STM32F7, Version 1.15.0

0 REPLIES 0