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.

TMS570LS3137: Enabling ECC in Flash wrapper vs in the CPU

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello,

In the SPNU499c ref. manual, a note for the EDACEN bits of the FEDACCTRL1 register (Table 5-14) suggests that:

Note: It is recommended to enable ECC in the Flash wrapper by writing 1010 to these bits
before enabling ECC in the CPU. If ECC is enabled in the CPU, but not in the wrapper, the
CPU will still check and correct single-bit ECC errors, and generate aborts on uncorrectable
errors for the main Flash. However, the generation of ESM events, the capture of failing
addresses and the detections and correction of errors in the OTP will be prevented

In the application, we enable Auxiliary Control Register bit #25 as per spnu499c TRM para. 2.2.3.2, to enable ACTM ECC for the main flash array.

Does the above quoted text saying that the FEDACCTRL1->ECDACEN bits should be enabled by writing 0xA to it before enabling bit #25 of the Auxiliary Control Register?

Thank you for your helps.

  • Hi, our expert is out of the office. Please expect a delayed response.

  • Hi Chuck,

    The main program memory is protected by the SECDED circuit implemented inside the Cortex-R4 CPU. All OTP and the FEE memory (bank 7) is protected by dedicated SECDED logic inside the Flash wrapper. Both the SECDED logic implementations use Error Correction Codes (ECC) for correcting single-bit errors and for detecting double-bit errors in the values read from the flash arrays.

    The ECC protection for accesses to the EEPROM emulation flash bank and OTP flash banks can be enabled by writing 0xA to the EDACEN field of the flash module’s Error Correction Control Register 1 (FEDACCTRL1).

  • Hi QJ,

    I understand what you're saying above, but no I cannot decode from it the answer to my following question:

    Does the above quoted text saying that the FEDACCTRL1->ECDACEN bits should be enabled by writing 0xA to it before enabling bit #25 of the Auxiliary Control Register?

    Thanks.

  • Hi Chuck,

    No, the ECC protection logic for EEPROM and OTP is implemented in flash wrapper only. Setting bit 25 of ARM ACTLR register (Auxiliary Control Register) is to enable the SECDED logic in CPU which is used for main program flash (bank0, and bank1).

  • Hi QJ,

    I'm very sorry, I've mixed up between the EEPROM/OTP (starting at 0xF0000000) and the main program flash (starting at 0x0 for 3MB).

    What I'm trying to do is to generate an ECC double-bit error by simulating a bad main program flash, having 2 bits flipped at a given address.

    Could you please provide more insight? I'm not using Halcogen so need a procedure of doing so.

    Thank you very much.

  • Hi Chuck,

    The Diagnostic mode 7 is used:

    Please the section of "ECC Data Correction Diagnostic Test Mode: DIAG_MODE = 7" in F021 Flash Module Controller (FMC) chapter.

  • Hi QJ,

    I was following procedure found in spnu499c para. 5.6.2.6 ECC Data Correction Diagnostic Test Mode: DIAG_MODE = 7, using FPAR_OVR_bit.DAT_INV_PAR = 0x03 that was undefined in para. 5.3.3 Syndrome Table, therefore to simulate multi-bit uncorrectable Flash ECC error.

    The result is that I'm getting an Abort exception rather than an uncorrected ESM error that should activate the nERROR signal pin.

    What should be the ESM error generated in this case?

    Since this is an uncorrected ECC error, which is a severe ESM Group2 or Group3 unmaskable error, why the nERROR signal pin was not asserted?

    Thanks.

  • QJ,

    After reading mirrored Flash location at address 0x20000000, a CPU abort exception was generated and the following data fault registers were captured, which seem to be correct:

    • DFAR=0x20000000
    • DFSR=0x1008

    The only issue is that no ESM error was generated for this double-bit simulated error. All ESMSR1, 2, 3 and 4 registers are 0x00000000 following the abort exception.

    In the ACTLR ARM CPU register, the following have been configured to pass on errors to CPU:

    • Bit25=1 is ATCM ECC check enable (main flash array)
    • Bit0=1 is ATCM external error into CPU enable

    This critical error could not be masked, so what could be the reason?

  • Data abort is expected for 2-bit ECC error. Please follow the following steps to perform 2-bit ECC error self-test.

    0.  /* Flash Module ECC Response enabled */
    FEDACCTRL1 = 0x000A060AU;

    1. /* Enable diagnostic mode and select diag mode 7 */
    FDIAGCTRL = 0x00050007U;

    [19:16]=0x5: Diagnostic mode is enabled

    [2:0]: ECC Data Correction Diagnostic test mode 7

    2. /* Select ECC diagnostic mode, two bits of ECC to be corrupted */
    FPAROVR = 0x00005A03U;

    [15:12]=0x5: Address bus parity is enabled

    [7:0]=0x3: data parity

    3. /* Set the trigger for the diagnostic mode */
    FDIAGCTRL |= 0x01000000U;

    4. /* read from flash location from mirrored memory map this will cause a data abort */
    read = (*(volatile uint32 *)(0x20000000U));

    5. /* disable diagnostic mode */
    FDIAGCTRL = 0x000A0007U;

    The ESM 3.7 will be set, nERROR is pulled down, and data abort is generated.

  • Thanks for the great help QJ,

    Only one thing was missing: the procedure found in spnu499c para. 5.6.2.6 didn't mention that the Flash Error Detection and Correction Control Register 1 (FEDACCTRL1) has to be configured, so that the CPU ECC Flash errors event signals will be unblocked.

    Adding this unblocking instruction solves the problem.

    Best regards!

  • QJ,

    One more question: Should this line be part of the application even when not performing Flash ECC checking test?

    FEDACCTRL1 = 0x000A060AU;

    If I leave this line without performing Flash ECC checking test, the application crashes.

    If I don't leave it with the application, are Flash ECC errors will still be reported to the CPU if happens?

    Thanks.

  • Should this line be part of the application even when not performing Flash ECC checking test?

    FEDACCTRL1 = 0x000A060AU;

    Yes. Otherwise, the ECC error will not be reported to ESM, and the Flash status register

    If I don't leave it with the application, are Flash ECC errors will still be reported to the CPU if happens?

    If ECC is enabled in the CPU, but not in the wrapper, the CPU will still check and correct single-bit ECC errors, and generate aborts on uncorrectable errors for the main Flash.