Hello Oliver Schmid:
Just like Mark suggested, you can use the fault to detect a corrupted flash. There is also the option of using the Program Check command to compare your expected data vs actual stored data.
To avoid flash corruption, it is actually recommended to disable interrupts. You could also copy interrupt vectors to RAM and relocate the interrupt handler codes to a different flash block (not the one being written/erased) or to RAM memory, for all of those interrupts that are likely to trigger while the flash operation is performed.
I hope this helps!
Best regards,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------