Other Parts Discussed in Thread: NOWECC
Hello:
I am trying to simulate ECC error in the flash memory of a TMS570LS20216 board. Without debug modle, it works well, it can detection and correct 1 bit flash data error. Here is my code:
const unsigned int Multiple_Bit_Err_Test = 0x01010101;
unsigned int Multiple_Bit_Err_Loc;
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
unsigned int i;
gioSetDirection(hetPORT, 0x0000003f);
esmInit();
rtiInit();
flashWREG->FEDACCTRL1 = 0x010A023A;
rtiEnableNotification(rtiNOTIFICATION_COMPARE3);
_coreEnableEventBusExport_();
_coreEnableFlashEcc_();
_enable_interrupts();
rtiStartCounter(rtiCOUNTER_BLOCK1);
while(1)
{
gioSetBit(hetPORT, 1, 1);
for(i=0; i<DELAYTIME; i++)
;
Multiple_Bit_Err_Loc = Multiple_Bit_Err_Test;
if(Multiple_Bit_Err_Loc == 0x01010101)
{
gioSetBit(hetPORT, 2, 1);
}
else
{
gioSetBit(hetPORT, 2, 0);
}
gioSetBit(hetPORT, 1, 0);
for(i=0; i<DELAYTIME; i++)
;
}
/* USER CODE END */
}
But when i debuging the program, when program runs to _coreEnableFlashEcc_(); The ECC address(0x00400000) value are all 0xBAD0BAD0( before it, it's all 0xFFFFFFFF). Then, onthe next step, the program jump to
prefetchEntry b prefetchEntry
and the ERROR pin active low.
It's that means that my ecc code it's not burn into the flash?
I program the file into the flash like this :
Build my code to creat a .out file and use ecc tool to generate an ecc file, then use nowFlash tool program this two files. It works well because there is no error in it.
Then use CCS debug the program, in "Erase Options" i choose "Selected Sectors Only" and check Bank0's "Sector 0".
It's that correct?
Regards,
Node.