2025-10-03 12:48 AM
Updating the flash software of a STM32F070CB microcontroller did not work:
The STM32 is in BOOTLOADER mode and accessed from a Linux/Ubuntu PC using USB.
STM32_Programmer_CLI (V2.20.0) does not work if the STM32 is connected directly to the USB port of the Linux-PC, but it does work if a simple USB2-hub is inserted between the PC's USB port and the STM32 USB port.
In the non-working case the STM32_Programmer_CLI outputs this:
-------------------------------------------------------------------
STM32CubeProgrammer v2.20.0
-------------------------------------------------------------------
USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32 BOOTLOADER
SN : FFFFFFFEFFFF
DFU protocol: 1.1
Board : --
Device ID : unknown
Warning: Device is under Read Out Protection or Target is held under reset
Error: a read Operation failed, please check if any memory protection mechanism is active.
This is not a udev problem, the problem persists even if STM32_Programmer_CLI is executed with root rights.
Using STM32_Programmer_CLI always works under Windows, even if the STM32 is directly connected to a USB port of the Windows PC.
Is there a way to get the STM32_Programmer_CLI to work under Linux/Ubuntu without the USB-hub?
2025-10-03 4:12 AM
Hello @TonyThi,
This is a known limitation where some high-speed USB controllers cause timing mismatches with the USB bootloader.
For more details about the root cause and workarounds, you can refer to the AN2606 (Table 31).
Thanks,
Amine.
2025-10-03 4:45 AM
2025-10-03 8:44 AM
Hi @TonyThi
This is meant to develop your own custom bootloader.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-10-03 9:31 AM
Is such a custom bootloader available from STM?
Or has anyone else written one?
Is there documentation available on how I could write a custom bootloader?
Thanks,
Tony