This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Flash ECC Enable Testing.

Other Parts Discussed in Thread: HALCOGEN, NOWECC, TMS570LS20216

Hi,

I am using TMS570 USB  stick and CCV4 for the avionics code development. I am using the code generated from the HALcogen for the initial driver code. Everything works as i expected with out ECC check enabled.

I have read the TMS570 user guide and found the below code for ECC check.

_ACTM_Enable_ECC
MRC p15,#0,r1,c9,c12,#0; Read PMNC register in privileged mode
ORR r1, r1, #0x00000010; Bit4 enable export of the events to the event bus (send
ECC error to the flash wrapper)
MCR p15,#0,r1,c9,c12,#0; Write PMNC register in privileged mode
MRC p15, #0,r1,c1,c0,#1; Read Auxiliary control register
ORR r1, r1, #0x02000000; Bit25 is ATCM ECC check enable
MCR p15, #0, r1, c1, c0, #1; Write Auxiliary control register
MRC p15, #0,r1,c1,c0,#1; Read Auxiliary control register
ORR r1, r1, #0x00000001; Bit0 is ATCM external error into CPU enable
MCR p15, #0, r1, c1, c0, #1; Write Auxiliary control register
MOV PC, lr


After i build the code with the ECC check enabled, i used the nowECC to generate the ECC hex file.
The generated hex file i downloaded to the target through the now Flash. Then i launched the CCS debugger
and Connetced to the target. I am able to see the ECC memory with the expected values of ECC.

After this i loaded the actual program to test the ECC functinality. I found that control is stopped in
prefech ISR. This might be because of mismatch between ECC stored and ECC calcuated. In memory view, i found that
ECC memory is filled with all F's. The memory is overwritten by default value after the loading the program.

1) How to test ECC functinality using CCS ? How to avoid the overwritten of Flash ECC memory in CCS ?

Two more questions apart from the above issue.

 

2) Is there anything else i should add in my code for proper working of ECC ?

3) How to enable the ECC check for RAM ? And what is the thoery behind working of ECC for RAM ?

 

 

  • On 1) what is the exact TMS570LS device you are using and what were the command line options used with nowECC?

    On the actual using of ECC I will have to defer to someone else to provide the answers.

  • I am using TMS570LS20216 processor and the option used in the ECC is nowECC -i input.hex -o ecc.hex. Please let me know how to test ECC using CCS.

  • Hello Bindu,

    Are you attempting to validate the ECC function or to provide a test (diagnostic) of the ECC function?  If you wish to test the ECC for correct operation, the LBIST diagnostic is the best option.  The LBIST will test the entire CPU, including the CPU's embedded ECC logic.

     

    Regards,

    Karl

  • The command line parameters you should be using with nowECC are: -i input.hex -F035 -r4 -o ecc.hex

    This will generate the correct ECC for the data going into Flash.

  • Hello,

    The CCS debugger cannot change the contents of the flash memory.  It is possible that you have encountered a problem which is not allowing the debugger to read the contents of the memory, so it is showing the default value of 0xFFFFFFFF.  What would be helpful here is to debug further the prefetch abort that you are seeing - check the control registers to find the flag indicating the abort cause and address where the abort was encountered.

    In general, to validate proper function of the ECC you will want to check both the pass behavior and the fail behavior.  To check for a fail, you will need to insert a bad ECC value into your code.  In some devices TI will program one of the OTP flash addresses with bad ECC for validation purposes, but I fear I do not know the address.  It is best to check both single bit and double bit error cases.  Ensure that you see the fail noted in both the CPU (via prefetch or data abort) and on the ESM.

    For SRAM, the enable logic is effectively the same (same ECC logic is replicated for ATCM, B0TCM, B1TCM).  Theory of operation and the implementation is the same.  The fault injection for validation is a bit easier as the SRAM ECC memory can be corrupted via software when ECC is disabled.  

     

    Regards,

    Karl

  • thanks karl. I am able to implement and test flash ECC and working on RAM ECC. I followed the aplication note on ECC that i found on some other post.

    I will post the steps that i followed during ECC testing using CCS where i found that data is written by the debugger.