Page 1 of 1

blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Posted: Mon Aug 29, 2022 7:05 pm
by bm16ton2
Altho ok in the start both my f411 anf f401 boards started to fail enumeration for usb dfu bootloader, not a switch problem because entering bootloadr via software only would have same results. In the end i fixed it 100 percent rock solid by adding a resistor from PA10 to ground. I used the first resistors i grabbed laying on desk i believe one is using 1.5k and the other 680. They are perfect now. Hope this helps someone i know its a common problem.

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Posted: Wed Oct 05, 2022 8:42 am
by bm16ton2
hrm never saw this before but on weeacts micropython page for the blackpill the "correct" method of entering dfu is
Flashing via DFU

This board can be flashed using DFU. To put the board in DFU mode, disconnect USB, connect A9 to A10 and reconnect USB. Press and hold BOOT0. Press and release RESET. Wait 0.5 seconds. Release BOOT0.

explains why my resistor method worked. ill be damned, when reading bout all the other people with same problem i ddo t recall this being mentioned

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Posted: Wed Oct 05, 2022 9:06 am
by fpiSTM
Thanks for sharing your feedback.

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Posted: Wed Oct 05, 2022 9:10 am
by ag123
connecting PA9 and PA10 is not needed.
all that is needed is set/press boot0 and toggle reset and the board/chip would drop in DFU mode.

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Posted: Wed Oct 05, 2022 12:45 pm
by GonzoG
ag123 wrote: Wed Oct 05, 2022 9:10 am connecting PA9 and PA10 is not needed.
all that is needed is set/press boot0 and toggle reset and the board/chip would drop in DFU mode.
But it doesn't always work. There's some issue with those boards design or buttons used.
I need to touch usb port or ground to enter DFU mode while resetting board with a finger, but my colleague needs to use a plastic element to reset board. If he touches any thing on board, it won't reset into DFU.
Also if I have any of Serial1 pins (PA9, PA10) connected to another board it won't reset into DFU.
bm16ton2 wrote: Wed Oct 05, 2022 8:42 am hrm never saw this before but on weeacts micropython page for the blackpill the "correct" method of entering dfu is
Flashing via DFU

This board can be flashed using DFU. To put the board in DFU mode, disconnect USB, connect A9 to A10 and reconnect USB. Press and hold BOOT0. Press and release RESET. Wait 0.5 seconds. Release BOOT0.

explains why my resistor method worked. ill be damned, when reading bout all the other people with same problem i ddo t recall this being mentioned
Method with resistor to PA10 works like a charm for me. Shorting PA9 and PA10 did not work.

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Posted: Fri Oct 28, 2022 1:03 am
by mlh5599
I can confirm, I was unable to enter bootloader mode (which had been working for me for several times). Jumping PA9 and PA10 to ground and performing the normal steps to enter bootloader mode did work for me. Don't know why but I tried time and time again without success before finding this post.

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Posted: Wed Dec 21, 2022 5:36 am
by pia32
Echoing the solutions above, I found tying A10 to ground was required to reliably enter DFU bootloader mode on all of STM32F401 boards I have lying around. I got "Device descriptor request failed" errors about 80% of the time, where the STM32 would fail to enumerate over USB.

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 traffic, and correctly enables USB.