cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L072RB DFU system bootloader reports incorrect flash size

Matthijs Kooijman
Associate III

I'm working with an STM32L072RB, and it seems the system bootloader DFU descriptor reports an incorrect flash size. I couldn't find any documentation of this in the errata sheet for this part, so where would be the right place to report this?

The STM32L072RB that I'm using has 128K flash, but the DFU descriptor says 192K (1536 pages of 128 bytes each):

$ dfu-util -l
 
dfu-util 0.9
 
(... extra output removed ...)
 
Found DFU: [0483:df11] ver=2200, devnum=80, cfg=1, intf=0, path="1-1.1", alt=0, name="@Internal Flash /0x08000000/1536*128g", serial="0C4738420000"

I'm pretty sure that the DFU descriptor is wrong and the device actually has 128k flash, since I just spent half a day trying to figure out why I could not upload any data to the upper 64k of flash (so >128k) under the assumption that I had a 192k device, based on the DFU descriptor...

3 REPLIES 3
Uwe Bonnes
Principal III

Probably STM32L072RB and STM32L072RZ are the same chip. So you _may_ have 192 k.

Matthijs Kooijman
Associate III

Yeah, you'd think that, except:

  • DFU uploads to > 128k fail (erase request seems to kill the bootloader, it no longer responds)
  • SWD uploads using STM32Programmer refuse to upload because it autodetects 128k (probably by reading F_SIZE)
  • The F_SIZE register (in the factory option bytes) reads 128k

So it really seems like this is *just* a bug in the DFU bootloader, and that the bootloader hardcodes the flash size, rather than reading it from F_SIZE. So maybe the RZ bootloader was accidentally included in the RB chip?

Uwe Bonnes
Principal III

STLink clips at F_SIZE. Try another debugger. dfu-utils clings to the the dfu string, so I wonder why dfu-util does not work. Maybe the system bootloader also clips, but I thinks I could use dfu-util to flash an F101x8 above 64k with a faked dfu-string.