blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Post here first, or if you can't find a relevant section!
Post Reply
bm16ton2
Posts: 3
Joined: Mon Aug 29, 2022 6:34 pm

blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Post 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.
bm16ton2
Posts: 3
Joined: Mon Aug 29, 2022 6:34 pm

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Post 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
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Post by fpiSTM »

Thanks for sharing your feedback.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Post 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.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Post 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.
mlh5599
Posts: 1
Joined: Fri Oct 28, 2022 1:00 am

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Post 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.
pia32
Posts: 2
Joined: Wed Dec 21, 2022 5:25 am

Re: blackpill/greenpill stm32411 stm32f401 dfu bootloader fix

Post 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.
Post Reply

Return to “General discussion”