Hello
I'm developing for RM48L952 using compiler 5.0.1.
My selftest function for the flash ECC runs fine without compiler optimizations (using CCS 5.3.0 for downloading and debugging). With compiler optimization -O3 the checks runs into flashClass2Error(). At this point FEDACSTATUS is 0.
Thanks for help
Aedu
Here is my check function (generated with Halcogen, recommended modifications added):
void checkFlashECC(void)
{
volatile uint32_t flashread = 0;
/* USER CODE BEGIN (63) */
/* clear correctable error bits */
flashWREG->FEDACSTATUS = 0x6U;
/* USER CODE END */
flashWREG->FEDACCTRL1 = 0x000A060A;
flashWREG->FDIAGCTRL = 0x00050007;
flashWREG->FPAROVR = 0x00005A01; // halcogen_mod: Halcogen Bug, 0x00005401 is wrong
flashWREG->FDIAGCTRL |= 0x01000000;
flashread = flashBadECC;
flashWREG->FDIAGCTRL = 0x000A0007;
/* this will have caused a single-bit error to be generated and corrected by CPU */
/* single-bit error not captured in flash module */
if (!(flashWREG->FEDACSTATUS & 0x2))
{
flashClass2Error();
}
else
{
flashWREG->FEDACSTATUS = 0x2;
esmREG->ESTATUS1[0] = 0x40;
flashWREG->FDIAGCTRL = 0x00050007;
flashWREG->FPAROVR = 0x00005A03;
flashWREG->FDIAGCTRL |= 0x01000000;
flashread = flashBadECC;
}
/* USER CODE BEGIN (64) */
/* USER CODE END */
}