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.

RM42L432: How to test "Primary SRAM Hard Error Cache and Livelock " mechanism?

Part Number: RM42L432
Other Parts Discussed in Thread: HALCOGEN

Hi,

    I want to test "Primary SRAM Hard Error Cache and Livelock " mechanism.

Following is my understanding about this mechanism:

   (1) If there is ECC livelock fault, ESM Group2 channel16 will be set.

(2) As long as ESM 2.16 was set, the processor will go into "FIQ  void esmHighInterrupt(void)".      "FIQ   void esmHighInterrupt(void)" is generate by HALCoGen v 04.06.01.

Q1: Does my understanding right?

I found some example code in in Safe TI Diagnostic Library v 2.3.1.

case SRAM_LIVELOCK_DIAGNOSTICS:
(void)SL_FLAG_SET(testType);

tp = (volatile uint64 *)0x08000004u; /*start address of unaligned access*/
eccB1 = (volatile uint64 *)0x08000000u; /*bank1 base word*/
/*SAFETYMCUSW 567 S MR:17.1,17.4 <APPROVED> "Pointer increment needed" */
eccB1 = eccB1 + (0x00400000u/sizeof(uint64)); /*pointer to ecc for bank1 base word*/
eccB2 = (volatile uint64 *)0x08000008u; /*bank2 base word*/
/*SAFETYMCUSW 567 S MR:17.1,17.4 <APPROVED> "Pointer increment needed" */
eccB2 = eccB2 + (0x00400000u/sizeof(uint64)); /*pointer to ecc for bank2 base word*/

/* Enable Writes to ECC RAM */
/*SAFETYMCUSW 9 S MR: 12.2 <APPROVED> Comment_10*/
/*SAFETYMCUSW 134 S MR: 12.2 <APPROVED> Comment_5*/
BIT_SET(tcram1REG->RAMCTRL, TCRAM_RAMCTRL_ECCWREN);
/*SAFETYMCUSW 9 S MR: 12.2 <APPROVED> Comment_10*/
/*SAFETYMCUSW 134 S MR: 12.2 <APPROVED> Comment_5*/
BIT_SET(tcram2REG->RAMCTRL, TCRAM_RAMCTRL_ECCWREN);

regBkupRamTh1 = tcram1REG->RAMTHRESHOLD;
regBkupRamTh2 = tcram2REG->RAMTHRESHOLD;

/* set threshold to 1 */
tcram1REG->RAMTHRESHOLD = 0x1u;
tcram2REG->RAMTHRESHOLD = 0x1u;

_SL_Barrier_Data_Access();

/* cause a 1-bit ECC error */
*eccB1 ^= TCRAM_SYN_1BIT_DATA_ECC;

*eccB2 ^= TCRAM_SYN_1BIT_DATA_ECC;

/* read from location with to be generate error */
_SL_Barrier_Data_Access();

ramread64 = (*tp); /*unaligned read*/

_SL_Barrier_Data_Access();

SL_FLAG_CLEAR(testType);

break;

However ,  when I test the above code in debug mode step by step, I can only see there generate 1-bit ECC Error  but ESM 2.16 is not set.

Q2: Does anything wrong?

  Refer tohttp://e2e.ti.com/support/microcontrollers/hercules/f/312/t/334077?tisearch=e2e-sitesearch&keymatch=TCM-ECC%20live%20lock%20detect ,

Charles Tsai
CT>> The CPU will retry to read from the TCM memory if it detects a 1-bit error. Normally, this hard error can only happen if the memory has permanent fault. So this is hard to test. I think you can try to create an undefine instruction at the undefined exception vector. 
Q3: How to implementation?
Thanks very much.

   

  • Hello,

    Q1: you are right, this test only generates 1-bit ECC error.

    Q2,Q3: As CT stated, you can try to create an undefined instruction at the undefined exception vector.

    Livelock is a state in which the processor pipeline is advancing and executing instructions, but the processor is repeatedly executes the same instruction so that it makes no progress through the program. When you have an underfined instruction at the undefined exception vector at 0x04 the processor can never advance the program flow and hence raises the livelock event. When ESM receives the livelock event, it is able to create an asynchronous exception (e.g. a NMI interrupt) to the processor in a normal way.

    Regards,

    QJ

  • Hi,
    Thanks for your answer.
    Could you offer me some example code about"create an undefined instruction at the undefined exception vector"? Thank you very much.