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.

TMS570LC4357 - ESM Group error in Power on/off test - problem fix solution verification

Other Parts Discussed in Thread: TMS570LC4357

Tool/software: Code Composer Studio

I used TMS570LC4357 chip. I make firmware based on Ti Safety Library.

I receive guidance by our co-worker question (the link : https://e2e.ti.com/support/microcontrollers/hercules/f/312/p/851508/3149793?tisearch=e2e-sitesearch&keymatch=tms570lc4357%252520esm#3149793)

I think the question checked [resoloved] the other answer is not come. So I request same question again to know accurately. The problem and question as follows.

I show the problem ESM Group 3 error (double bit ecc) in Power on/off test(plug on/off) sometimes. Then, the firmware is stopped in the code as follows.

        if ((esmREG->SR1[2]) != 0U) {

           while(1);
        }

I find the ESM Group 3 error not occurred when I change the initialization sequence.

The original sequence as follows,

void _c_int00(void)

{

 SL_Init_R5Registers();

 SL_Init_StackPointers();

_SL_Init_EnableEventExport();

SL_Init_Memory(RAMTYPE_RAM);

resetReason = SL_Init_ResetReason();

....

....

}

I change the init sequence like this : (SL_Init_Memory(RAMTYPE_RAM) first and _SL_Init_EnableEventExport() later)

void _c_int00(void)

{

 SL_Init_R5Registers();

 SL_Init_StackPointers();

SL_Init_Memory(RAMTYPE_RAM);

_SL_Init_EnableEventExport();

resetReason = SL_Init_ResetReason();

....

....

}

So, I want to know about these.

1. Is The sequence change no problem?

2. why If _SL_Init_EnableEventExport(); is first set,  SL_Init_Memory(RAMTYPE_RAM); make double ecc error sometimes.

Regards,

Minwoo

  • Hi Minwoo,

    This is a duplicate thread to one that was answered before. To summarize, the double-bit ECC error can happen if you read from RAM without first initializing it. When you call a function, it tries to save any CPU registers it is changing onto the stack and then restores them when the function exits.

    On the Cortex R4/5, the RAM interface is 64-bit wide. Any write access smaller than 64 bits is performed as a read-modify-write operation by default. The "read" part is what causes the double-bit error since the RAM on power-up is random and does not have correct ECC values programmed.

    SL_Init_R5Registers() and SL_Init_StackPointers() functions are implemented as pure assembly routines and do not use any stack, so these functions are okay to call before initializing the RAM.

    Regards, Sunil

  • Hello Sunil,

    I understand why ESM 3 error in startup code. Then, Hercules Ti Safety Library "HL_sys_startup.c" code. The version "2.4.0"  is generated as follows,

    void _c_int00(void)

    {

     SL_Init_R5Registers();

     SL_Init_StackPointers();

    _SL_Init_EnableEventExport();

        resetReason = SL_Init_ResetReason();
        switch(resetReason)
        {
            case RESET_TYPE_POWERON:
            case RESET_TYPE_DEBUG:
            case RESET_TYPE_EXTRST:
            case RESET_TYPE_EXTRST_NERROR:

    SL_Init_Memory(RAMTYPE_RAM);

            ....

       }

    ....

    }

    The Green lines code access the RAM before init. So, this make the double-bit ECC. Would you check the Ti Safety Library 2.4.0 basecode? 

    Regards,

    Minwoo

  • Hi Minwoo,

    The start-up sequence in the Safety Library demo app does need to be changed.

    In fact the first function that will cause the double-bit ECC error is the one that enables the event-bus export from the CPU. The first instruction in this function is a store to the stack, which will cause the double-bit ECC error. However since the event-bus export is not enabled at this point, there is no response or indication for this ECC error.

    The second function call is to identify the cause of the reset. This is a C function,which also uses the stack to save and restore CPU registers. The double-bit ECC error caused by this stack write is now exported to the ESM. This is the cause of the ESM group 3 error that you see on power-up.

    Please call the memory initialization function before the call to enable event export. This memory initialization function in the demo app is not using stack operations as the return value is defined as a "register", so it uses a CPU register to hold this variable.

    Regards, Sunil