cancel
Showing results for 
Search instead for 
Did you mean: 

ST USB DFU bootloader problem

DM.1
Associate

Hi!

I'm using CubeMX USB DFU bootloader on STM32F103C8T6 chip. For some reasone example takes itself 48 kB of flash, but don't use even half of it.

So i changed

USBD_DFU_APP_DEFAULT_ADD from 0x0800C000 to 0x08008000

and

changed FLASH_DESC_STR  to  "@Internal Flash /0x08000000/02*016Ka,02*016Kg"

After that i tried to upload my firmware to 0x08008000 with dfu-util. And saw FFs up to adress 0x0800C000 and after that end part of firmware.

Seems like ST's example for same reason locks flash up to 0x0800C000. But DfuSeDemo app can upload dfu-file to adress 0x08008000 without any problems.

Did't someone come by this problem? 

1 REPLY 1
DM.1
Associate

Answer myself.

So there's function in usbd_dfu_if.c named MEM_If_Erase_FS. It appears that this fuction called to remove not a page but whole sectors and several times, i.e. in my case from 0x08008000 to 0x0800C000 and next time from 0x0800C000 and up. So i rewrite function to erase everything from 0x08008000 to the end and next time it's called it simply returns OK doing nothing else.