cancel
Showing results for 
Search instead for 
Did you mean: 

''USB Device Not Recognized'' when STM32F072 enters bootloader mode

Arnaud Chalons
Associate
Posted on March 14, 2018 at 12:02

Context: I need to upgrade the firmware of my STM32F072 using DfuSe and USB FS.

Problem: As the title says, my problem is that when I enter the bootloader mode (from a software way), the STM32F072 is not always detected as ''STM32 in DFU Mode'' as it should be. The point is that sometimes my device is detected correctly and most of the time I get the message ''USB Device Not Recognized'' and then I have to reset my device using ST-Link to try again.

I can't figure out why sometimes it works and sometimes it does not as I do not change my code from one try to another. I suspect that this might be due to the fact that I have 1 I2C peripheral and 2 UART peripherals connected to my STM32F072 and thus my bootloader does not always reach the execution of DFU bootloader using USB interrupts according to the bootloader selection mechanism described in figure 12 of AN2606. 

Can anyone help me to identify from where this problem comes from and how I can solve it?

Many thanks

0690X00000604FQQAY.jpg

#usb-dfu #stm32f072
2 REPLIES 2
Posted on March 14, 2018 at 13:18

Does it have dependency on the HSE, clocking and at what speed, for the System Loader to support USB.

HSI/MSI might not be on frequency enough for USB.

Check that HSE clocks, and how rapidly it starts in your own code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 15, 2018 at 09:15

I am using the HAL drivers in my application and I did not change the default value for both HSE and HSI (HSE_VALUE is 8Mhz, HSE_STARTUP_TIMEOUT is 100ms, HSI_VALUE is 8MHz, HSE_STARTUP_TIMEOUT is 100ms) in the 'stm32f0xx_hal_conf.h' file. The clock related to the USB (HSI48) is set to 48MHz, which I believe is the correct value to use USB FS. I will try to modify those values to see if there is an impact on the bootloader.

However, I still don't get why sometimes my board is recognized correctly by my computer as an 'STM Device in DFU Mode' and why most of the time I get the message 'USB Device Not Recognized' while I am not changing anything in the code..