Getting FLASH_FLAG_PGSERR when calling FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE)
I am trying to download Firmware into the Flash in the form of 4KB Chunks. However, on some pages, I am unable to update Flash because HAL_FLASHEx_Erase() returning an error as I am getting FLASH_FLAG_PGSERR for FLASH_WaitForLastOperation(). It is occurring randomly. Sometimes I am able to download the firmware completely on the flash and sometimes I run into this issue.
I am calling FLASH_update() to copy the chunks into the flash. I have attached flash_l4.c for reference
Any help is appreciated
