Hello,
I am using a TMS570LS3137 processor. I have enabled flash ECC protection doing the following:
- Enable Flash ECC error detection (FEDACCTRL1.EDACEN = 0xA)
- Enable core event bus export (calling coreEnableEventBusExport assembly function)
- Enable flash ECC checking (calling coreEnableFlashEcc assembly function).
In my bootloader which resides at the beginning of the flash, I need to read a location in flash where my application is written to determine if an application is programmed or not. If not application software is programmed, when I read a flash location that was not written, an ECC group3 error occurs but the nError pin is not wired on my board so the DSP doesn't reset and a data abort exception (0x10) is generated. I put an interrupt function on the data abort exception and I want to clear the error and continue execution.
The first time I read the unprogrammed flash address a data abort is generated and the error is also detected as an ECC error. Register ESMSR3 is 0x80 because a FMC - uncorrectable error occurred and Register FEDACSTATUS is 0x100 because a bus1 uncorrectable error occurred. This is good.
Then I clear the error by doing the following:
- Clear all flash error reported by writing FEDACSTATUS = 0x00FFFFFF
- Clear all group3 ESM error by writing ESMSR3 = 0xFFFFFFFF
- Deactivate the error pin by writing ESMEKR bits EKEY = 5
Then I return from the abort exception and the code resumes execution correctly.
My problem is when I read again an unprogrammed flash address a data abort exception is generated but this time it seems the error is not detected by the ECC mechanism because ESMSR3 is 0 and FEDACSTATUS is also 0.
Is there something else I need to clear/reset to allow the ECC mecanism to detect another error?
Thanks,
Martin