cancel
Showing results for 
Search instead for 
Did you mean: 

USB DFU & FLASH_PROGRAM_TIME

MK..1
Associate III

Hi

I successfully got USB DFU bootloader running based on this video.

But one question: why is FLASH_PROGRAM_TIME 50 ms?

How is this value dervied? What is the minimum possible value?

Thx.

1 REPLY 1
STOne-32
ST Employee

Dear @MK..1 ,

Flash programming time is silicon hardware dependent on each of our MCUs series and contains two parts : Writing or Programming and then Erase . The granularity of each unit is different. Here is an example for STM32F42x Datasheet  :

 

IMG_7638.jpeg

So let’s imagine in your case yo will program at a time a Stream buffer of maximum data is 1024 bytes ( just a example ) thru USB DFU , so if you pack these buffer in 256 32-bit word and we program in 32 parrallism mode you need 256 * 100us ( max value ) ~ 25,6ms timeout is required  as minimum and with margin and good software optimization in the loop I would hardcode it as 30 ms . This timeout is required to tell the HOST to wait and the device is busy during that period .

Hope it helps you to understand the logic .

STOne-32.