2024-06-06 06:16 AM
Should ICACHE be invalidated when a double ECC error occurs?
Solved! Go to Solution.
2024-06-20 01:56 AM
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.
2024-06-07 08:55 AM
Hello @PieterG,
Please check: How to avoid a hard fault when ICACHE is enabled on the STM32H5 series
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.
2024-06-07 10:54 AM
Maybe I've overlooked it, but I have read the article several times and it does not mention how ECC errors are to be handled?
I am quite sure that I read about invalidating ICACHE after a double ECC error, but I cannot find it anymore in the official documentation, nor any of the examples.
Does it make any sense to invalidate ICACHE when a double ECC error occurs in FLASH? Or is there no need for that?
2024-06-20 01:41 AM
Can you please point me to where this knowledge base item explains whether ICACHE should be invalidated on double ECC errors?
Or alternatively a simple yes or no answer would also be very helpful.
2024-06-20 01:56 AM
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.
2024-06-20 02:43 AM
Thank you @Sarra.S for your answer.
I guess invalidating the ICACHE is only necessary when ICACHE is enabled for the flash sector in which the error occurred? (in other words, I do not have to invalidate ICACHE for double ECC errors in OTP / EDATA for which I disabled caching in the MPU)
2024-06-20 03:39 AM
Yes!
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.