Skip to main content
Visitor II
November 18, 2021
Solved

DFU mode with USB works weirdly (set address failed), while USB does

  • November 18, 2021
  • 1 reply
  • 2133 views

My USB user application works fine, but DFU mode using USB works weirdly, sometime it work, but regular it is not recognized by host PC.

0693W00000GXzJEQA1.png

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    Welcome, @HDang.3​, to the community!

    If you are talking about DFU Boot Mode, it could be caused by an aged crystal or one that differs due to temperature changes. Details can be found in AN2606, Section 4.1:

    For STM32 devices embedding bootloader using the DFU/CAN interface in which the external clock source (HSE) is required for DFU/CAN operations, the detection of the HSE value is done dynamically by the bootloader firmware and is based on the internal oscillator clock (HSI, MSI). When (because of temperature variations or other conditions) the internal oscillator precision is altered above the tolerance band (1% around the theoretical value), the bootloader might calculate a wrong HSE frequency value. In this case, the bootloader DFU/CAN interfaces might malfunction or not work at all.

    Good luck!

    If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

    /Peter

    1 reply

    Technical Moderator
    November 18, 2021

    Welcome, @HDang.3​, to the community!

    If you are talking about DFU Boot Mode, it could be caused by an aged crystal or one that differs due to temperature changes. Details can be found in AN2606, Section 4.1:

    For STM32 devices embedding bootloader using the DFU/CAN interface in which the external clock source (HSE) is required for DFU/CAN operations, the detection of the HSE value is done dynamically by the bootloader firmware and is based on the internal oscillator clock (HSI, MSI). When (because of temperature variations or other conditions) the internal oscillator precision is altered above the tolerance band (1% around the theoretical value), the bootloader might calculate a wrong HSE frequency value. In this case, the bootloader DFU/CAN interfaces might malfunction or not work at all.

    Good luck!

    If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

    /Peter

    HDang.3Author
    Visitor II
    November 18, 2021

    I'm using STM32F072, with 8mhz HSE, in room temperature (23°C), so I don't understand why it doesn't work.

    Technical Moderator
    November 18, 2021

    I have just quoted the reason from the AN2606. 8MHz is written on the crystal, but what frequency does it currently have, what frequency do the free-running HSI or MSI have?

    Did you measure the frequency of the crystal?

    Did you measure the frequency of HSI/MSI?

    Regards

    /Peter