Resolved! Aligment error (PGAERR) on FLASH write. Error UNDEFINSTR joins the party
I dont know why this error happens. It is aligned as 0x0800F800.Not only this, but i get a hardfault (UNDEFINSTR) error too, while printing the above error with the following:printf("Error writeFLASHDoubleWord FLASH->SR: %02X", READ_REG(FLASH->SR));