Other Parts Discussed in Thread: HALCOGEN
Tool/software: Code Composer Studio
Hi,
Can anyone please help me with information on configuration of ECC for on-chip RAM and FLASH for TMS570LC570 and error signaling with exception handling. After reading the datasheets, reference manual and going through some forums I could understand that not just the RAMCTRL L2RAMW Module Control Register be updated for ECC DETECT EN field with a value of 0xA, but also the "ATCM, B1TCM and B0TCM ECC check" in the CP15 Auxilary Control Register and the "Event enable" bit of the CP15 PMNC register be set. I tried with the code snippet shown below but still cant induce an ECC error. I get to understand that the on-chip RAM and FLASH is accessed on AXI-M L2 Bus interface(unlike its predecessor LC3137 which is based on the ARM Cortex R4 architecture which uses TCM interface to access RAM & Flash and not on AXI-M L2 Bus). So if I am doing something wrong here please help me correct it.
;------------Enable ECC on RAM & FLASH --------------------------
.def CoreEnableRamFlashEcc
.asmfunc
CoreEnableRamFlashEcc
MRC p15,#0,r1,c9,c12,#0 ; Reading secondary Aux secondary Reg.
ORR r1, r1, #0x00000010
DMB
MCR p15,#0,r1,c9,c12,#0 ; Enable export of the events in PMNC
ISB ; To ensure the write before proceeding
MRC p15, #0, r1, c1, c0, #1
ORR r1, r1, #0x1 <<25 ; ATCM ECC Check Enable
ORR r1, r1, #0x1 <<26 ; B0TCM ECC Check Enable
ORR r1, r1, #0x1 <<27 ; B1TCM ECC Check Enable
DMB
MCR p15, #0, r1, c1, c0, #1
ISB ; To ensure the write before proceeding
MOV PC, lr
.endasmfunc
;------------Disable ECC on RAM & FLASH--------------------------
.def CoreDisableRamFlashEcc
.asmfunc
CoreDisableRamFlashEcc
MRC p15, #0, r1, c1, c0, #1
MVN R0,#0x1 <<25 ; ATCM ECC check disable
AND R1 ,R1, R0
MVN R0,#0x1 <<26 ; B0TCM ECC check disable
AND R1 ,R1, R0
MVN R0,#0x1 <<27 ; B1TCM ECC check disable
AND R1 ,R1, R0
DMB
MCR p15, #0, r1, c1, c0, #1
ISB ; To ensure the write before proceeding
MRC p15,#0,r1,c9,c12,#1
MVN R0,#0x00000010 ; Disable export of the events in PMNC
AND R1 ,R1, R0
DMB
MCR p15,#0,r1,c9,c12,#0
ISB ; To ensure the write before proceeding
MOV PC, lr
.endasmfunc
Appreciate your quick response!
Thanks & best,
Sripad Kulkarni