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.

TMS570LS0432: TMS570 ECC detection check

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN

Hello TI team,

 

I know that there are a lot of topics on forum connected to ECC, but unfortunately I was not able to find answer on some my question and hope for your help.

Within out application we want to check periodically if SECDED triggered or not for both RAM and Flash in case of single bit error.

Without interrupts, without address retrieving (currently), just check, was single bit upset or not since previous check.

Here I want to provide my ideas how to do it, based on TRM, application notes and code from HalCoGen etc.

First of all if I want to check if ECC 1 bit error triggered I perform the following TCRAM1/2 configuration:

ECC_DETECT_EN = 0xA

RAMOCCUR = 0

RAMTHRESHOLD = 1

RAMINTCTRL.SERR_EN = 1

Question 1: Is defined above configuration complete and correct to monitor SECDED triggering (1 bit) for for BTCM?

Monitoring itself I done in the following way (register names a bit different but recognizable, I think; code is for TCRAM1 only, for TCRAM2 anther register is used and anther ESM channel):

/* Check if SECDED triggered within TCRAM1 (B0TCM) during the last frame */
if ((TcRam1Regs_g.RAMERRSTATUS.Bit.lSERR EQU (uint32_t)1U) OR
    ((uint32_t)((EsmRegs_g.lESMSR1 >> (uint32_t)SHIFT_26_BITS_C) & (uint32_t)1U) EQU (uint32_t)1U))
{

    /* SECDED triggered during the last frame for B0TCM */
    ...

    /* Clear RAMOCUUR in order to count subsequent single-bit error corrections */
    TcRam1Regs_g.RAMOCCUR.Bit.lSEO = (uint32_t)0U;

    /* Clear SERR flag */
    TcRam1Regs_g.RAMERRSTATUS.Bit.lSERR = (uint32_t)1U;

    /* Clear ESM Group 1 Channel 26 flag */
    EsmRegs_g.lESMSR1 |= (uint32_t)((uint32_t)1U << (uint32_t)SHIFT_26_BITS_C);
}

Question 2: Please confirm that ECC (1 bit error event) is catchable with the code above and handling is correct.

Question 3: Also am I right that during next call of the code above we able to catch new a 1bit error occurrence (if appear for sure :))?

Question 4: Do I need to read error address to catch the next error event or do some other handling?

Now let's continue with Flash check. Here is more complicated since I have a feeling that there is some typos in the TRM.

First of all to monitor 1 bit error I have configure wrapper as follows:

FEDACCTRL1.EDACEN = 0xA

FEDACCTRL1.EOFEN = 1

FEDACCTRL1.EZFEN = 1

FEDACCTRL1.EDACMODE = 0xA

Question 5: Please confirm that defined above configuration is complete and correct for 1bit error monitoring (check if event occurred or not, one or million times, doesn't matter)?

Now here is event occurrence check code itself:

if ((FlashRegs_g.FEDACSTATUS.Bit.lERR_ZERO_FLG EQU (uint32_t)1U) OR
    (FlashRegs_g.FEDACSTATUS.Bit.lERR_ONE_FLG EQU (uint32_t)1U) OR
    (FlashRegs_g.FEDACSTATUS.Bit.lB2_COR_ERR EQU (uint32_t)1U) OR
    ((uint32_t)((EsmRegs_g.lESMSR1 >> (uint32_t)SHIFT_6_BITS_C) & (uint32_t)1U) EQU (uint32_t)1U))
{
    /* SECDED triggered during the last frame for ATCM */
    ...

    /* Clear single-bit error flag(s) */
    FlashRegs_g.FEDACSTATUS.Bit.lERR_ZERO_FLG = (uint32_t)1U;
    FlashRegs_g.FEDACSTATUS.Bit.lERR_ONE_FLG  = (uint32_t)1U;
    FlashRegs_g.FEDACSTATUS.Bit.lB2_COR_ERR   = (uint32_t)1U;

    /* Clear ESM Group 1 Channel 6 flag */
    EsmRegs_g.lESMSR1 = (uint32_t)1U << SHIFT_6_BITS_C;
}

Question 6: Please confirm that code above is sufficient to check if 1 bit error event occurred or not?

Question 7: Also am I right that during next call of the code above we able to catch new a 1bit error occurrence?

Question 8: Do I need to read error address to catch the next error event or do some other handling?

Question 9: By TRM for me it is not completely clear why description of ERR_ONE_FLG is applicable for Bus2 only.

I thought that for Bus1 events like "wherea 1 readas a 0" are also applicable, isn't it?

ERR_ZERO_FLG is applicable for both Bus1 and Bus2 in accordance with TRM. What is the truth regarding these two regs?

Question 10: Do I need to check B2_COR_ERR or is it excess? What is other indicator (except ESM) that ECC error occurred on Bus2?

Question 11: If ERR_ONE_FLG and/or ERR_ZERO_FLG are set due to error on Bus1 data, will B2_COR_ERR be triggered?

I know there are a lot of question, but I think this information will be useful not only for me, cause I see that there are a lot of questions regarding ECC.

Thanks a lot in advance!

  • Hello Dmitry,

    First, you need to enable the CPU event export. This mechanism is disabled by default. You can call the HALCoGen generated function ( _coreEnableEventBusExport_()) to enable it, or you can set the bit 4 of PMNC PMU register to enabled.

    secondly, the RAM ECC should be enabled. This can be done by setting bit 27 and bit 26 of ARM auxiliary control register, or by calling HALCoGen generated function _coreEnableRamEcc_().

  • Question 1: Setting ECC_DETECT_EN bit will enable the ECC detection and will generate ECC error flag if any occurs. You are right, you can set the threshold for ECC error interrupt.

    Question 2: Your function is able to check the status: bit 0 of RAMERRSTATUS, and bit 28 and bit 26 of ESM group1

    Question 3: For monitoring purpose, the interrupt is triggered if the error happens. For diagnostic purpose, you will not get the error during the 2nd call. If you want to get the same error, please change the address of the error.

    Question 4: to generate error twice, you need to use different address. You are right. To get the ECC error, you need to read the data from the SRAM.
  • Question 5: you need to enable the flash ECC by calling _coreEnableFlashEcc_() or setting the bit 25 of ARM auxiliary control register.
    FEDACCTRL1.EDACEN = 0xA
    FEDACCTRL1.EOFEN = 1
    FEDACCTRL1.EZFEN = 1
    FEDACCTRL1.EDACMODE = 0xA

    Those settings are enough to enable the ECC logic inside the flash wrapper.

    Question 6: Your core is to check error flags for Bus 2 Correctable Error (bit 16), ERR_ZERO_ FLG (bit 1), and ERR_ZERO_ FLG(bit 2), and check FMC correctable error (bus1 and bus2 interfaces) at ESM group 1. The code is good to poll the ECC error.

    Question 7: Please use interrupt to capture the ECC error.
  • Hi QJ,

    thanks a lot for your answer.

    If you don't mind, I would like to clarify couple of questions:

    Questions 3,4: I'm not going to change address of the error :) This monitoring code is being created to monitor real errors, not a synthetic one.

    At the same time by our architecture we mustn't have any other interrupts except main one for framing which is based on RTI.

    Therefore we just have to monitor if error(s) occurred or not since last check. And I understand that I'm not able to detect error at the same address as previous one due to HEC.

    My question was: Is it necessary to read RAMSERRADDR after error occurrence to be able to detect new error at the different address? Or is this step not required.

  • Hello QJ,

    And here is some additional clarification questions regarding Flash:
    Question 6: Are these bits ERR_ZERO_ FLG (bit 1), and ERR_ZERO_ FLG(bit 2) applicable for bus1, bus2 or both? In TRM there are some mix, I wan not able to understand it.
    Question 7: As I mention above other interrupts except framing one are forbidden within our application. ECC 1 bit fault has to be checked by periodic polling only.
    Question 8: And the same question as for RAM, do I need to read FCOR_ERR_ADD/FCOR_ERR_POS as soon as code detected ECC 1 bit error?
    Address itself for me is not important, question if I need to read it just for correct detection of the next possible 1 bit error by the mentioned above in code flags? Just for clarification, if any new error occurs, I again don't need to know its address, just fact of error.

    Thanks in advance!
  • Hello TI Support team,

    do you have any information regarding my questions above?

    Thanks

  • Hello,

    The flash wrapper has two buses, the bus1 and bus2. The bus1 is used by the CPU to access the flash's normal sectors for which the program and data are stored. The CPU will use the bus2 to access the OTP sectors, EEprom emulation flash bank. When CPU accesses via bus1 for the program and data, the CPU's built-in SECDED logic will perform the ECC checking. Note this ECC logic is inside the CPU, not inside the flash wrapper. When CPU accesses via bus2 for the EEprom bank or the OTP sectors the ECC checking is done inside the flash wrapper. The reason is that the CPU's level 2 interface (AXI-M bus) which is connected to the flash memory system's bus2 does not have ECC checking capability. Therefore, the flash wrapper has its own ECC logic just for bus2 accesses.

    The ERR_ZERO_ FLG (bit 1), and ERR_ZERO_ FLG(bit 2) are applicable for both bus 1 and bus2.
  • Hello QJ,

    sorry for delayed answer and thank you for so described answer.

    Now everything is clear for me and formally topic could be closed.

    Only one additional favor from my side, maybe it is possible to inform somebody at TI that it would be nice to update description for ERR_ZERO_ FLG and ERR_ZERO_ FLG fields within spnu517.

    Currently based on the description it is possible to think that one or even both of these flags are applicable for bus2 only,