Page 1 of 1

Fix for STM32F401 USB DFU bootloader failing to enumerate

Posted: Wed Dec 21, 2022 5:52 am
by pia32
Problem description: I've ordered several STM32F401 black pill boards. Some of the boards never successfully enter USB DFU bootloader mode, and some only intermittently enter DFU bootloader mode. I get "Device Descriptor Request Failed" messages, because the STM32 fails to enumerate over USB. I'm confident this is not a hardware issue, since test programs I upload successfully talk over USB serial.

Solution: Tying A10 to GND successfully makes it enter DFU bootloader mode 100% of the time (though just not leaving PA10 floating is probably sufficient).

Hypothesized Explanation: In the last paragraph of Sec 4.3 of AN2606 (the STM bootloader manual), it states:
It is recommended to keep the RX pins of unused bootloader interfaces (USART_RX, SPI_MOSI, CAN_RX and USB D+/D- lines if present) at a known (low or high) level at the startup of the bootloader (detection phase). Leaving these pins floating during the detection phase might lead to activating unused interfaces.
PA10 is the RX pin for USART_1. I believe that since PA10 is floating, the bootloader senses traffic on USART_1, and believes that's the interface it should use, and thus turns off USB. By tying PA10 to GND, the bootloader doesn't sense UART traffic and correctly enables USB.

I've started a new thread for this issue, since it seems important enough to warrant its own discussion. I believe my problems may be exacerbated by being in a climate with low humidity, since it seems like 99% of people don't have this issue.

Re: Fix for STM32F401 USB DFU bootloader failing to enumerate

Posted: Wed Dec 21, 2022 12:41 pm
by GonzoG