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.

Flash ECC Enable Error

Other Parts Discussed in Thread: NOWECC

When I'm trying to enable Flash ECC, using "_coreEnableFlashEcc_()" function from "Demo_Software_Ver1_1", my application crashes and "ERROR" pin drives low.

The function looks like:

    .global  _coreEnableFlashEcc_
    .asmfunc

_coreEnableFlashEcc_:

        mrc   p15, #0x00, r0,         c1, c0,  #0x01
        orr   r0,  r0,    #0x02000000
        mcr   p15, #0x00, r0,         c1, c0,  #0x01
        bx    lr

    .endasmfunc

I have already generated ECC data for the binary file (.out) using "nowECC" tool, and have programmed it to the appropriate location (0x00400000).

What's the problem can it be?

Thanks, Evgenyy.

  • Hi Evgenyy

    Couple of Suggestions

    1) Can you find what type of ESM error you got by reding the ESM status register.
    2) Since R4 does some speculative accesses it is advised to fill the entire Flash location with know value while using ECC. This can be done by filling the empty locations in binary file with patterns. Then generate the ECC data using nowECC.

    To fill the binary file, use keyword "fill" like below

    Best Regards
    Prathap

     

    MEMORY
    {
    VECTORS (X) : origin=0x00000000 length=0x00000020
    FLASH0 (RX) : origin=0x00000020 length=0x001FFFE0 fill = 0x12345678
    -------------------------
    -------------------------

    }

  • I can't exactly find what the type of ESM is, because of my application stops executing after _coreEnableFlashEcc_() function call. I've tried to comment this function, recompiled the project and read ESMSR1, ESMSR2 and ESMSR3 registers, but then their values are all zeros. I also filled the empty FLASH locations as you adviced, but still got the same problem.

    Though I didn't mention, that before calling _coreEnableFlashEcc_(), I also call _Enable_ECC() function from the example in the post:

    How to enable RAM ECC (http://e2e.ti.com/support/microcontrollers/tms570/f/312/t/69328.aspx)

    _Enable_ECC

     ; reading/writing seconday Aux secondary Reg
        MRC p15,#0,r1,c9,c12,#0
        ORR r1, r1, #0x00000010 
        MCR p15,#0,r1,c9,c12,#0     


        MRC p15, #0, r1, c1, c0, #1  ;Enable Parity Check enable D0TCM
        ORR r1, r1, #0x1 <<26
        DMB
        MCR p15, #0, r1, c1, c0, #1
        ISB

        MRC p15, #0, r1, c1, c0, #1  ;Enable Parity Check enable D1TCM
        ORR r1, r1, #0x1 <<27
        DMB
        MCR p15, #0, r1, c1, c0, #1
        ISB

        MOV PC, lr   

    Is it necessary to call it first before calling _coreEnableFlashEcc_() or not? If I do not so "ERROR" pin still drives high after _coreEnableFlashEcc_(), but my application still crashes.

    The listed _Enable_ECC function differs from another one _ACTM_Enable_ECC (see TRM, spnu489a, page 297, section "9.5.3.3 Enabling / Disabling ECC inside CPU").

    What is the right way for enabling ECC for FLASH (and RAM)? I get really complicated...

     



  • Hi Evgenyy,

    Unless you want to use RAM ecc do not use _Enable_ECC function.

    1) Try calling _coreEnableEventBusExport_() function before calling _coreEnableFlashEcc_();
    2) Let us know the options you used for ECC calculation (nowECC options/parameters). 

    Best Regards
    Prathap

     

  • I call nowECC tool with parameters:

    nowECC tms570.out -r4

    to generate tms570_ECC.out, I also tried to call nowECC without '-r4' parameter, and the result is the same.

    Calling _coreEnableEventBusExport_() have no affect in my case, can you please explain what does this function do?


  • Evgenyy

    You missed an options to be used with nowECC

    try using options -r4 and -f035 together.

    Calling _coreEnableEventBusExport_() will Enable Export bit "X" in Performance Monitor Control register. this helps in letting the other modules( like Flash wrapper or ESM or system module) know incase of any events like ECC error occured since ECC check is done by R4(CPU).

    Best Regards
    Prathap

     

  • Thank you, Prathap.

    Adding '-f035' parameter to nowECC resolved the question.