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.

Compiler/TMS570LS3137: Double bit error for B1TCM is not generated.

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Tool/software: TI C/C++ Compiler

Hello Forum,

I am relatively new to ARM processors and trying to implement checking for RAM ECC on the fly for inserted errors. I read a lot of threads on this, but didn't find a solution for my case.

I ran upon this post: e2e.ti.com/.../774180

Having the same problem. Using code from HalcoGen doesn't work for me. But using the one from SPNA126 did bring me to some point. I am able to generate error on ESMSR3 on channel 3 but not on channel 5. I also followed the instructions from QJ Wang. I stumbled upon following, not sure if it is a problem: When i try to change 2 Bits via XOR, I noticed that somehow 16Bits get changed. (I am using IAR Workbench). See figures bellow. On first figure, before executing line 96 on, it is shown in Memory1 view, that at location 0x08400010 is 2e2e_2e2e written.

After hitting F11 (Step in) once, the value at given location changes into 2d2d_2d2d. I wanted to provoke a double bit error, not to change 16 bits.

Here is the code for the first function, the second one for B1TCM is called afterwards.

void checkRamEccB0TCM(void)
{
    volatile uint64 ramread = 0U;
    volatile uint32 regread = 0U;

    uint64 tcramA2_bk = tcramA2bit;
    uint64 tcramB2_bk = tcramB2bit;

    /* Enable writes to ECC RAM, enable ECC error response */
    tcram1REG->RAMCTRL = 0x0005010AU;
    tcram2REG->RAMCTRL = 0x0005010AU;      
   
    // coreDisableRamEcc
    asm("MRC p15,#0, r1, c1, c0, #1");
    asm("MVN R0,#0x1<<26");     //; B0TCM ECC check disable
    asm("AND R1 ,R1, R0");
    asm("MVN R0,#0x1<<27");     //; B1TCM ECC check disable
    asm("AND R1 ,R1,R0");
    asm("DMB");
    asm("MCR p15,#0, r1, c1, c0, #1");
    asm("ISB");                 // ; To ensure the write before proceeding
      
    asm("MRC p15, #0, r1, c9, c12, #0");
    asm("MVN R0,#0x00000010");  //; Disable export of the events in PMNC
    asm("AND R1 ,R1,R0");
    
    asm("DMB");
    asm("MCR p15, #0, r1, c9, c12, #0");
    asm("ISB");  //; To ensure the write before proceeding
        
    /* Force a double bit error in both the banks */
    //tcramA2bitError ^= (uint64_t)0x00000003U;
    tcramA2bitError ^= 3U; //#define tcramA2bitError (*(volatile uint32 *)(0x08400010U))   

    // coreEnableRamEcc
    asm("MRC p15,#0,r1,c9,c12,#0");     // Reading secondary Aux secondary Reg.
    asm("ORR r1, r1, #0x00000010");
    asm("DMB");
    asm("MCR p15,#0,r1,c9,c12,#0");     //; Enable export of the events in PMNC
    asm("ISB"); //; To ensure the write before proceeding
    asm("MRC p15, #0, r1, c1, c0, #1");
    asm("ORR r1, r1, #0x1 <<26");       //; B0TCM ECC Check Enable
    // asm("ORR r1, r1, #0x1 <<27");     //; B1TCM ECC Check Enable
    asm("DMB");
    asm("MCR p15, #0, r1, c1, c0, #1");
    asm("ISB");
    
    /* Read the corrupted data to generate double bit error */
    ramread = tcramA2bit;
        
    regread = tcram1REG->RAMUERRADDR;

    /* disable writes to ECC RAM */
    tcram1REG->RAMCTRL = 0x0005000AU;
    tcram2REG->RAMCTRL = 0x0005000AU;

    /* Compute correct ECC */
    tcramA2bit = tcramA2_bk;
    tcramB2bit = tcramB2_bk;
}

Q1: Is it normal that 16Bits are changed, I wanted to change just 2.

Q2: Could this be the cause why I'm not getting the error on channel 5.

Additional note:

For B0TCM, data flow jumps into data abort handler of the bootloader and then changes to a data abort into the application where I do the handling of the error (reseting esmsr3).

For B1TCM, data flow again comes to data abort handler of the application, but when check for error is performed, there is none signaled in esmsr3. Value of esmsr3 is 0x00. should be 0x20. Also in addition, regarding change of bits. For this case, there are alse 16Bits changed, not just 2. I am using different locations in RAM ECC (0x08400010 and  0x08400018).

If the given Information is not sufficient, I can update it in example with more print screens with register values at different points at debbug time.

Regards,

Mensur

  • Hi,
    I edited the post. Did not saw that at first try my screen shots didn't attach.

    Regars,
    Mensur
  • Hello Mensur,

    I need to do test on my LS3137 board. I will come back soon.

  • Hello Mensur,,

    Just did a test on LS3137 HDK. When reading data from 0x08000018,  I got ESM3.5 error: RAM odd bank (B1TCM) - ECC uncorrectable error.

    I use the function in sys_selftest.c generated by HALCoGen.

  • Hello Mensur,

    Q1: Is it normal that 16Bits are changed, I wanted to change just 2.

    It is expected. In RAM ECC area, 64-bit locations are used for 8-bit data ECC, so the ECC is duplicated. At 0x084000000 contains 8-bit ECC for 64-bit data at 0x08000000, byte0/1/2/3/4/5/6/7 are the same.
  • Hello QJ Wang,

    thanks for your reply. Now I got the _coreEnableRamEcc_ and other functions from HALCOGEN running, but still can not see the error for B1TCM. I get into data abort though but without signaling channel 5 error in ESMSR3 register. I also used your code snippet. Probably it must have to do something with reseting or setting some bits in some registers.

    Is it possible for you to share the working project of yours (especialy the data abort handler, and the initialization part) ?

    Regards,

    Mensur Kujovic

  • Hello again,

    I got it working. I added clearing of the ADDR_DEC_FAIL flag in the RAMERRSTATUS register.

    /* enable writes to ECC RAM, enable ECC error response */
        tcram1REG->RAMCTRL = 0x0005010AU;
        tcram2REG->RAMCTRL = 0x0005010AU;
    
        _coreEnableEventBusExport_();
        
        /* cause a 2-bit ECC error */
        _coreDisableRamEcc_();
        tcramA2bitError ^= 0x3U;
        tcramB2bitError ^= 0x3U;
        _coreEnableRamEcc_();
    
        /* read from location with 2-bit ECC error this will cause a data abort to be generated */
        ramread = tcramA2bit;
        tcram1REG->RAMERRSTATUS |= 0x4U; // Clear ADDR_DEC_FAIL flag
        tcram2REG->RAMERRSTATUS |= 0x4U; // Clear ADDR_DEC_FAIL flag
        ramread = tcramB2bit;
        tcram1REG->RAMERRSTATUS |= 0x4U; // Clear ADDR_DEC_FAIL flag
        tcram2REG->RAMERRSTATUS |= 0x4U; // Clear ADDR_DEC_FAIL flag
    

    I would mark this as "solved" as it is. But my only question is, or better said, I would like to know why had I to add this in my code, whereas in your code snippet it was not necessary?

    Am I missing something?

    Regards,

    Mensur K

  • Hello Mensur,

    Why ADDR_DEC_FAIL flag is set? Is ADDR_COMP_LOGIC_FAIL flag set? Did you do address decode test too? The abort.asm function clears the DERR bit of RAMERRSTATUS register.
  • Hello  Wang,

    we found a Register error  in Bootloader dabort.asm.  Group 3 ESMSR3 error for B1TCM was not resetet in Bootloader, so at run time a new error could not be captured.

    After fixing this, the 2Bit error test is now repeatable.

    Thanks for your help.

    Issue solved.

    Regards,

    Mensur K