2021-11-18 12:14 AM
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.
Solved! Go to Solution.
2021-11-18 12:44 AM
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
2021-11-18 12:44 AM
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
2021-11-18 01:23 AM
I'm using STM32F072, with 8mhz HSE, in room temperature (23°C), so I don't understand why it doesn't work.
2021-11-18 01:37 AM
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
2021-11-18 01:43 AM
F07x can run DFU without HSE right? I remove HSE crystal and problem is still there, user code with USB and HSI working fine.
2021-11-18 01:44 AM
And I have 2 chip with same problem
2021-11-18 01:48 AM
No, DFU Boot mode requires HSE, as you can read in my statement above.
Depending on the configuration, the user code can work without HSE - namely if the STM32 works as a USB device and is synchronized by the host.
Regards
/Peter
2021-11-18 01:50 AM
without HSE, my chip still can go to USB DFU in sometime.
2021-11-18 01:51 AM
But you think the error comes from frequency of the HSE crystal?
2021-11-18 01:57 AM
The problem is mainly caused by a frequency deviation of the MSI/HSI, possibly exacerbated by a frequency deviation of the HSE.
Regards
/Peter