Hello @PieterG, sorry for the delayed answer,
When two ECC errors occur during a read, the flash interface sets the double error detection flag ECCD in the FLASH_ECCDETR register
and when this flag is raised, an NMI is generated, and the software must invalidate the instruction cache (CACHEINV = 1) in the NMI interrupt service routine when the ECCD flag is set.
I hope that answers your question!
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.