STM32F407 DFU and STM32CubeProgrammer - Problem to load a new program - Not Erase memory
Hello!
I'm trying to use a firmware DFU with the STM32F407 and Emulated EEPROM to change into DFU / App or App / DFU. The DFU address is in 0x08000000, the Emulated EEPROM address is in 0x08008000 and the Application address, on 0x0800C000.
All this steps works fine, the DFU connect with USB to the STM32CubeProgrammer and I can load a first code. Then it jump right to the Application, run it good, and I can go back to the DFU without problems. The problems comes when a trying to load another program after the first load previously.
I could find in the code of DFU, the function MEM_If_Erase_HS is never called so, it can't load a new program. The other functions, some are called like MEM_If_Write_HS (because load the first time the program) and MEM_If_Read_HS (because the verification is right). So, I don't understand or I can't find why is not called the function to erase the memory and program another code.
On the STM32CubeProgrammer, I have the error menssage:
12:10:04 : Memory Programming ...
12:10:04 : Opening and parsing file: Main_QB_STM_DFUFreeRTOS.bin
12:10:04 : File : Main_QB_STM_DFUFreeRTOS.bin
12:10:04 : Size : 39.74 KB
12:10:04 : Address : 0x0800C000
12:10:04 : Erasing memory corresponding to segment 0:
12:10:04 : Error: failed to erase memory
Has anyone had this or a similar problem to help me?
