Other Parts Discussed in Thread: CONTROLSUITE
I'm working with internal flash on the F28377D based controlCARD starting with the flash_programming_cpu01 project. I would like to provoke single and double bit ECC errors to confirm that my code detects these events through the associated interrupt.
I found a very helpful post at
and am trying to incorporate that into the project. It's not related to the project itself but at least I know that the code in the project does work with the flash API so that makes a good starting point.
I have the following code
EALLOW; // This is needed to write to EALLOW protected registers
if(type == 1) {
Flash0EccRegs.ERR_INTCLR.all = 3; // clear SINGLE_ERR_INTCLR and UNC_ERR_INTCLR
Flash0EccRegs.ERR_INTCLR.bit.SINGLE_ERR_INTCLR = 1;
PieVectTable.FLASH_CORRECTABLE_ERROR_INT = &test_Single_ECC_isr;
PieCtrlRegs.PIEIER12.bit.INTx11 = 1; //C28FLSINGERR
IER = 0x800; // Enable CPU INT
ERTM;
EINT;
EDIS;
readVal = *(uint16*)0x701F8; // provoke both single and double bit ECC error
readVal = *(uint16*)0x701F8; // provoke both single and double bit ECC error
readVal = *(uint16*)0x701F8; // provoke both single and double bit ECC error
readVal = *(uint16*)0x701F8; // provoke both single and double bit ECC error
return;
}
The Flash0EccRegs configure according to the code and the first read from 0x701F8 sets both error flags in the ERR_INTFLAG register. IER.INT12 is set. IFR.INT12 is also set. PIEIER12.INTx11 (Int 12.11) is set.
I suppose the problem is that the interrupt seems not to be propagating from the ECC module to the interrupt controller. STM.INTM is 0 as is STM.DBGM.
What have I overlooked that is causing the ISR to not be called? (Both the code above and the ISR reside in RAM.)