Skip to main content
Explorer
April 30, 2024
Question

USB DFU & FLASH_PROGRAM_TIME

  • April 30, 2024
  • 1 reply
  • 726 views

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.

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    April 30, 2024

    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.