STM32F411CEU6 (WeAct Black Pill V3.0): USB DFU connects and erases flash but fails during programming; USART1 bootloader also fails to connect
Hardware and software
-
MCU: STM32F411CEU6
-
Board: WeAct Black Pill V3.0
-
IDE: STM32CubeIDE 2.2.0
-
Programming tool: STM32CubeProgrammer 2.21.0
-
Host OS: Windows 11
-
Application: Existing application built as an ELF and BIN file (approximately 69.11 KB)
-
Current programming method: JTAG/SWD, which works correctly
Board reference: https://stm32-base.org/boards/STM32F401CEU6-WeAct-Black-Pill-V3.0.html#Reset-button
The reference page describes the F401 version of the board; my board uses the STM32F411CEU6.
Objective
I want to program a fixed application binary (.bin) directly using STM32CubeProgrammer over USB DFU or UART, using the STM32's factory-programmed system-memory bootloader.
I am not developing a custom bootloader or implementing field firmware updates. The same application currently programs and runs correctly through JTAG/SWD.
1. USB DFU behaviour
I enter system-memory boot mode by holding BOOT0, pressing and releasing NRST, and then releasing BOOT0.
Windows detects the device through USB, and STM32CubeProgrammer identifies it using:
-
VID:
0x0483 -
PID:
0xDF11
CubeProgrammer connects successfully and identifies the target as an STM32F411xC/E with 512 KB of flash and a Cortex-M4 core.
I can also read flash successfully. For example, reading 1024 bytes from 0x08000000 succeeds.
However, programming the application fails.
The relevant log is:
Opening and parsing file: CSL2401.bin
Memory Programming ...
File : CSL2401.bin
Size : 69.11 KB
Address : 0x08000000
Erasing memory corresponding to segment 0
Erasing internal memory sectors [0 4]
Download in Progress:
Error: Write failed at address: 0x08008000
Error: failed to download Sector[0]
Error: failed to download the File
Disconnected from device.The same failure occurs when attempting to program the ELF file.
The failure is consistently reported at 0x08008000, which is the beginning of Sector 2 on the STM32F411.
2. Flash protection and hardware checks
I checked the option bytes in STM32CubeProgrammer:
-
RDP is
0xAA(Level 0). -
WRP0–WRP7 are off.
-
SPRMOD is unchecked, so PCROP mode is disabled.
Flash reads and sector erase operations appear to work through USB DFU, but programming fails.
I also programmed the same application through JTAG/SWD. Programming and execution work correctly using that method.
This suggests that the application binary and normal flash programming path work through SWD, although I have not independently verified the cause of the USB DFU failure.
3. USART1 ROM bootloader behaviour
I also attempted to use the factory ROM bootloader through USART1.
The wiring is:
USB-to-TTL adapter STM32F411CEU6
TX PA10 (USART1_RX)
RX PA9 (USART1_TX)
GND GNDThe USB-to-TTL adapter is connected to COM10. The target is powered separately, and the adapter's VCC is not connected.
I tried the following STM32CubeProgrammer UART configuration:
Port COM10
Baud rate 115200, then 9600
Parity Even
Data bits 8
Stop bits 1
Flow control NoneI used the same BOOT0/NRST sequence to enter system-memory boot mode, but CubeProgrammer reports:
Error: Activating device: KO.
Please verify the boot mode configuration
and check the serial port configuration.
Reset your device then try again.The COM port opens successfully, but the initial bootloader connection fails. I have not yet independently verified the UART synchronization-byte exchange or identified the USB-to-TTL adapter's exact chipset.
4. Summary of results
| Test | Result |
|---|---|
| Program application through JTAG/SWD | Works |
| Enter USB DFU mode | Works |
| Windows USB DFU enumeration | Works |
| CubeProgrammer USB connection and target identification | Works |
| Read internal flash through USB DFU | Works |
| Erase flash sectors through USB DFU | Appears to work |
| Program ELF through USB DFU | Fails at 0x08008000 |
| Program BIN through USB DFU | Fails at 0x08008000 |
| Connect to USART1 ROM bootloader | Fails with Activating device: KO |
| RDP / WRP / PCROP checks | No protection identified |
Questions
-
Are there any known STM32F411CEU6 ROM bootloader limitations or issues that could explain successful USB DFU connection, flash read and erase, but failure during programming?
-
Is there a recommended diagnostic procedure to identify why the DFU write operation fails at
0x08008000, given that the same application programs correctly through SWD? -
Could the board's 25 MHz HSE or another hardware/clock consideration affect the ROM USB DFU programming operation?
-
For the USART1 bootloader, are there additional boot-mode, pin-configuration or electrical checks I should perform beyond the standard BOOT0/NRST sequence and PA9/PA10 wiring?
-
Is there a way to obtain more detailed error information from the ROM bootloader or STM32CubeProgrammer to distinguish a flash programming error from a transport/protocol issue?
I would appreciate any suggestions for further tests or documentation relevant to this specific MCU and board.
Thank you.
