Flash sector erase is taking too long
Hi all i'm developing a bootloader on a stm32f407. I want to erase all the flash sectors except of the first 3 which i have the bootloader code. The problem is that to erase a sector it takes 1 second and i have an external watchdog on the board that has to be toggled at least every 600 msec. What i have relized is that while a sector is erased the mcu does not execute any line of code :\ I used these 2 functions to erase the flash
HAL_FLASHEx_Erase_IT(&FLASH_EraseInitStruct)
HAL_FLASHEx_Erase(&FLASH_EraseInitStruct, &SectorError)But both functions use this function
FLASH_Erase_Sector(pEraseInit->Sector, pEraseInit->VoltageRange)which takes 1 second long to execute. I measure the time of a function by toggling a pin before and after execution and measuring the pin with a scope.
Any help will be very useful , thanks in advance
