2024-04-29 11:20 PM
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.
2024-04-30 12:05 AM
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 :
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.