cancel
Showing results for 
Search instead for 
Did you mean: 

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

HDang.3
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

9 REPLIES 9
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

F07x can run DFU without HSE right? I remove HSE crystal and problem is still there, user code with USB and HSI working fine.

And I have 2 chip with same problem

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

without HSE, my chip still can go to USB DFU in sometime.

But you think the error comes from frequency of the HSE crystal?

The problem is mainly caused by a frequency deviation of the MSI/HSI, possibly exacerbated by a frequency deviation of the HSE.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.