I tried to detect a blackout on an stm32F405VGT6, which should write a counter inside the virtual EEPROM (Flash). It seems, that the writing process was not fast enough. Now, i cannot initalize the Flash anymore, it always gives me back a HAL_ERROR (FLASH_FLAG_PGPERR and FLASH_FLAG_PGSERR) when I call the HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data) function.
I tried already to completely erease the STM32 with the STUtility tool, but also this did not work. Is it possible, that I broke my Flash? Are there any ways to protect the flash from a blackout while it is writing?
HAL_ERROR
. I believe I see some conditional code that will tell how this exception is raised. \$\endgroup\$