DFU bootloader has errors on new BlackPill F411

Post here first, or if you can't find a relevant section!
david.prentice
Posts: 19
Joined: Thu May 14, 2020 8:39 pm
Answers: 1

DFU bootloader has errors on new BlackPill F411

Post by david.prentice »

I have just received a F411 board. And was interested in booting from USB.

I can upload programs via Serial or SWD ok. But USB gives errors.
Surely the bootload operation is going to be the same. Just with a different transport.
Any Flash program or verification errors would appear regardless of transport.

When the board arrived I could not enter USB Boot mode via BOOT0 and RST buttons.
I connected via SWD and did a "Mass Erase" to clear any firmware that came with the board.

Sometimes I can get STM32 BOOTLOADER but mostly "USB device not recognised"
If I do manage to get the USB DFU uploads fail. Both with Arduino and with STM32CubeProgrammer

However I can upload and run large sketches via SWD. e.g. I am displaying a whole series of JPEG images stored in the F411 Flash.
The pictures look fine. So the F411 Flash memory must be ok.

I have ordered a second BlackPill. I will see whether DFU works on that board.
Did my "Mass Erase" cause a problem?
Has anyone else had unreliable USB DFU?

I tried USB DFU with the native USB socket on a F407 Discovery.
This all worked fine with STM32CubeProgrammer

David.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: DFU bootloader has errors on new BlackPill F411

Post by ag123 »

the finger dance is crucial.

1 press both reset & boot0
2 release reset and hold boot0
3 finally release boot0 after 2 secs
david.prentice
Posts: 19
Joined: Thu May 14, 2020 8:39 pm
Answers: 1

Re: DFU bootloader has errors on new BlackPill F411

Post by david.prentice »

Go on. Surely it is the same as any other device in the world.

Hold BOOT0 down. Press and release RST.

Release BOOT0 if you want. But you can just as easily use a jumper link.
At least that is how it works on the F407 Discovery.

Nucleo-64 boards have BOOT0, VDD and USB-, USB+ pins on the Morpho header. BOOT0, VDD can receive a jumper link.
I have a monster USB-B receptacle on a bit of protoboard somewhere. So I can try my Nucleo-F411 board later this morning.

I am convinced that the Factory Bootloader has an unstable area of Flash memory in the F411 chip. i.e. USB code.
BOOT0, RST buttons work ok e.g. for PA9, PA10 USART Bootloader.

I don't want to complain to the BlackPill shop until I get confirmation from other BlackPill owners.
Or my new board arrives from a different vendor and I can try for myself.

David.
User avatar
Bakisha
Posts: 139
Joined: Fri Dec 20, 2019 6:50 pm
Answers: 5
Contact:

Re: DFU bootloader has errors on new BlackPill F411

Post by Bakisha »

I had problems with those boards too. After some time i figure out that my problem was actually fingers touching nearby pins and it wouldn't enter in bootloader. Pressing those buttons with two pens solved my issue. I never measured resistor values for pull-up resistors on reset and boot pin. Maybe they are too high?
hobbya
Posts: 49
Joined: Thu Dec 19, 2019 3:27 pm
Answers: 1

Re: DFU bootloader has errors on new BlackPill F411

Post by hobbya »

I also found problems using DFU mode to upload code, see my post:
viewtopic.php?f=7&t=1196
david.prentice
Posts: 19
Joined: Thu May 14, 2020 8:39 pm
Answers: 1

Re: DFU bootloader has errors on new BlackPill F411

Post by david.prentice »

I guess that BOOT0 has an on-chip weak pulldown. The BOOT0 button simply makes with VDD possibly via a low-value resistor. Someone will have the schematic.
Since I can get UART-Boot mode reliably I assume that there is nothing wrong with the button signals. But they should be easy enough to test with a DMM.

The only thing that can go wrong with BOOT0 button is if the pulldown is about equal to any series resistor. In which case you never get a reliable active-high signal from BOOT0 button press. (But this would be the same for UART Boot too)

My experiments with BOOT0 on a NUCLEO board and STM32CubeProgrammer utility.
If USB is present it will connect via USB. UART will not work.
Remove the USB. It will connect via UART.
It will always connect via SWD.

David.

Edit. The WeAct v1.2 schematic has an external 10k pulldown on BOOT0. (R6)
There is no series resistor for the push-button making to 3.3V (SW2)
Last edited by david.prentice on Tue Aug 24, 2021 8:59 am, edited 1 time in total.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: DFU bootloader has errors on new BlackPill F411

Post by ag123 »

there is one other thing, pressing reset on stm32 isn't necessarily the same as a usb reset (single ended zero)
https://www.usbmadesimple.co.uk/ums_3.htm
a usbreset is necessary to get the host to re-enumerate. i've never monitored this and i'm not sure if this has timing sensitive or line voltage/current sensitive issues.

i think blue pills (stm32f103c8) has another issue to do with the pull up resistor being 'too high', i'm not sure if this matters but that it works for me despite the 'wrong' resistor.

i've about 2 stm32f401 'black pills' both are from different vendors one is from weact
https://stm32-base.org/boards/STM32F401 ... -Pill-V1.2
the other one has 3 buttons, reset, boot0 and an extra 'user' button
https://www.aliexpress.com/item/1005001701355958.html

both the we act board and the 3 button board has been working so far for me. But i'm using linux, i'm not sure if it is different in windows.
the 3 button board is sometimes rather sensitive, and like @Bakisha mentioned i try to avoid touching the pins surrounding it
david.prentice
Posts: 19
Joined: Thu May 14, 2020 8:39 pm
Answers: 1

Re: DFU bootloader has errors on new BlackPill F411

Post by david.prentice »

Simple request:

Please run STM32CubeProgrammer.

Hold BOOT0 down. Momentary press RST.
Select USB. Connect via USB.

If the Port field says NO DFU click the refresh box. If the BOOT0/RST is active this will detect USB1. Subsequent Connect should work.

If this works reliably for STM32CubeProgrammer you can select DFU upload in Arduino IDE. (disconnect from STM32CubeProgrammer)
Press BOOT0/RST before any sketch Upload.

It would be nice if you can try this on both your BlackPill boards.

In an ideal world I would like to use CDC Serial and install HID bootloader. Which should get seamless xxxPill operation. i.e. no buttons.
However it would be nice to know that I can always fall back on factory USB-DFU if something does wrong.

David.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: DFU bootloader has errors on new BlackPill F411

Post by ag123 »

well i tested this on my '3 button' stm32f401 blackpill, the following are dmesg messages from linux

Code: Select all

boot0 + reset
[ 7946.284333] usb 3-4: USB disconnect, device number 5
[ 7946.746165] usb 3-4: new full-speed USB device number 6 using xhci_hcd
[ 7946.894924] usb 3-4: New USB device found, idVendor=0483, idProduct=df11
[ 7946.894925] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7946.894926] usb 3-4: Product: STM32  BOOTLOADER
[ 7946.894927] usb 3-4: Manufacturer: STMicroelectronics
[ 7946.894927] usb 3-4: SerialNumber: 388236403135
[ 8028.705265] usb 3-4: USB disconnect, device number 6

reset, this comes from the sketch
[ 8029.182557] usb 3-4: new full-speed USB device number 7 using xhci_hcd
[ 8029.331886] usb 3-4: New USB device found, idVendor=0483, idProduct=5740
[ 8029.331888] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8029.331889] usb 3-4: Product: STM32 Virtual ComPort in FS Mode
[ 8029.331889] usb 3-4: Manufacturer: STMicroelectronics
[ 8029.331890] usb 3-4: SerialNumber: 00000000050C
[ 8029.332336] cdc_acm 3-4:1.0: ttyACM0: USB ACM device
[ 8053.623829] usb 3-4: USB disconnect, device number 7

boot0+reset
[ 8054.130675] usb 3-4: new full-speed USB device number 8 using xhci_hcd
[ 8054.279399] usb 3-4: New USB device found, idVendor=0483, idProduct=df11
[ 8054.279400] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8054.279401] usb 3-4: Product: STM32  BOOTLOADER
[ 8054.279402] usb 3-4: Manufacturer: STMicroelectronics
[ 8054.279402] usb 3-4: SerialNumber: 388236403135
then for the weact stm32f401ccu v1.2 blackpill

Code: Select all

reset
[ 8196.745549] usb 3-4: USB disconnect, device number 8
[ 8198.575278] usb 3-4: new full-speed USB device number 9 using xhci_hcd
[ 8198.724583] usb 3-4: New USB device found, idVendor=0483, idProduct=5740
[ 8198.724585] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8198.724586] usb 3-4: Product: STM32 Virtual ComPort in FS Mode
[ 8198.724586] usb 3-4: Manufacturer: STMicroelectronics
[ 8198.724587] usb 3-4: SerialNumber: 00000000050C
[ 8198.725051] cdc_acm 3-4:1.0: ttyACM0: USB ACM device
[ 8433.772121] usb 3-4: USB disconnect, device number 9

boot0+reset
[ 8434.192340] usb 3-4: new full-speed USB device number 10 using xhci_hcd
[ 8434.341167] usb 3-4: New USB device found, idVendor=0483, idProduct=df11
[ 8434.341168] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8434.341169] usb 3-4: Product: STM32  BOOTLOADER
[ 8434.341169] usb 3-4: Manufacturer: STMicroelectronics
[ 8434.341170] usb 3-4: SerialNumber: 378C354A3336
[ 8440.969423] usb 3-4: USB disconnect, device number 10

reset
[ 8441.348404] usb 3-4: new full-speed USB device number 11 using xhci_hcd
[ 8441.497595] usb 3-4: New USB device found, idVendor=0483, idProduct=5740
[ 8441.497597] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8441.497598] usb 3-4: Product: STM32 Virtual ComPort in FS Mode
[ 8441.497598] usb 3-4: Manufacturer: STMicroelectronics
[ 8441.497599] usb 3-4: SerialNumber: 00000000050C
[ 8441.497971] cdc_acm 3-4:1.0: ttyACM0: USB ACM device
so it works kind of.
so i'd guess the difference may be at the electrical signals or timings etc, some hardware (host side) are sensitive to those things and slight differences may not work. and i think windows may be more 'fussy' with usb, i'm not sure if that matters.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: DFU bootloader has errors on new BlackPill F411

Post by mrburnette »

Note for Windows 10 users:

Consider downloading USBview from Microsoft. Device manager simply is not adequate to easily provide the info you require.

https://docs.microsoft.com/en-us/window ... er/usbview

A good read for anyone needing a deeper understanding:

https://community.silabs.com/s/article/ ... uage=en_US


Ray
Post Reply

Return to “General discussion”