I am trying to implement an ECC Error-handling. If an EEPROM ECC Error is detected, the software should try to handle it.
Each double Bit ECC Error causes a Machine Exception.
For debugging purpose, I generate a machine exception by writing a value to the P-Flash, like 01:
Memory Loc. | Commands
01 *((byte *)0xFE0000) = 0; <-Causes Memory Exception
02 next Command = 0; <- Next Command
After attending this line of code, a Machine Exception is triggered and the interrupt routine is executed correctly, but
When I return from the ISR, the PC is not set to the next command.
For me it seems that some random code ore some random ISRs will be executed. At the end the Program Counter is loaded with 0x000001.
Do i have to clear the Memory Exception Interrupt?
In the ISR i clear the MMCEC register by writing MMCEC = 0xFFFFFFFF to it.