2026-05-19 9:40 AM - last edited on 2026-05-19 10:07 AM by mƎALLEm
The STM32G0B1 has a very ugly bug in the bootloader.
When I have a write protection on a flash memory area:
WRP1A_STRT = 0x0 --> 0x08000000
WRP1A_END = 0x1 --> 0x08000800
and then I upload a new firmware to this area the firmware will not be written, because this area is write protected.
This is correct.
But it is a horrible bug that I send a USB control request with
Request.Function=URB_FUNCTION_CLASS_INTERFACE;
Request.Direction=VENDOR_DIRECTION_IN;
Request.Request=DFU_GETSTATUS;
Request.Value=0;
Request.Index=0;
Request.Length=6;
Result = STDevice_ControlPipeRequest(hDevice, &Request, (BYTE*)pkDfuStatus);
and the buggy bootloader returns STATUS_OK (value 0) instead of STATUS_ErrorWRITE (value 3)
The user thinks that the firmware was uploaded correctly but the processor is dead because the flash memory is corrupt.