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.

How to debug with CCS, when ECC enable.

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137, NOWECC

Hi, I'm new to Hercules and Embedded Development. I'd like to debug with CCS when ECC is burned and ECC function is enabled Using HALCoGen.

I'm not good at English, Please forgive the poor English of the question.

I'm using

・TMS570LS3137 HDK

・CCS v5.5

・nowECC v2.17

・nowFlash v3.42

Step 1

I made a program that is ECC function enabled and built the program(a.out).

Step2

I tried to debug with CCS(XDS100v2), but cannot debug.

TMS570LS3137 HDK' D1 RED LED(ERROR Signal) is lighted and did not come main()  in CCS.

I thought this problem was caused by not buring ECC, still enabling ECC function.

Step3

I used nowECC and nowFlash, generated ECC(a_ECC.out) and burned ECC to HDK.

It seems to be worked fine. But I want to debug this with CCS.

Note : I used this nowECC' command [nowecc -i a.out -f021 16M_ADD -r4]

How to debug with CCS, when ECC enable.

Can someone help me?

  • please upgrade to CCS 6.
    the download capability includes an auto-ecc generation so it will program ECC for you automatically whenever you download your code.
    the compiler also offers you a alternative method - you can generate ECC directly during linking.

    So the extra step outside the build flow where you use nowECC is no longer necessary.
    We only provide nowECC in case you are not using CCS or the TI ARM compiler.
  • Thank you for reply !

    I'll try to use CCS 6. But  our project decided to use CCS v5.5.

    Is there a way to debug with CCS v5.5 when ECC enbale?

    If answer is no, should we debug with CCS v5.5 on condition that (Flash) ECC function is disabled?

  • I solved the problem by myself.
    I found Auto ECC Gen Setting in CCS v5.5.
    Project Properties → Debug → Flash Settings → chaeck [Auto ECC Generation]

    I have a new Question.

    Where can I find Auto gen ECC file(binary)?
    just can read from Memory Browser in debug mode?
  • Super.

    There is no ecc file when you use auto-generated ECC. The ECC is computed on the device on the fly during programming and is programmed into the ECC array at the same time the data array is programmed.

    If you want ECC in a file, you need to use the linker to generate ECC.
  • Thank you for the quick response.

    I understand Auto ECC Generator in CCS don't generate ECC file.

    Sorry to ask many question,

    Q1.
     >If you want ECC in a file, you need to use the linker to generate ECC.

    I found a Wiki page.

    <processors.wiki.ti.com/.../Linker_Generated_ECC ECC&tisearch=Search-JP-Everything>

     ・Linker Generated ECC

    Is this wiki page what you had to say?

    If this page is not, please can you show me a reference.

    Q2.

    If I use the linker to generate ECC, should I uncheck  [Auto ECC Generation] in CCS v5.5?

    ([Auto ECC Generation] : Project Properties → Debug → Flash Settings)

    I think that, Auto ECC generation function in CCS will overwrite ECC generated by linker.

  • Yes you cannot use both the auto-generate ECC and the Linker ECC together.
    It's one or the other. The linker takes more time to setup but is more reliable.

    There are more settings in the flash programming that you need to change.
    We put together some tips about this for the LAUNCHXL2-TMS570LC43
    processors.wiki.ti.com/.../LAUNCHXL2-570LC43-RM57L:_TIPS

    System Reset on Connect checked, auto-ecc unchecked, verify = none...
  • Thank a lot !
    I could burn ECC generated by linker and debug !
    My next task is emulation faults in ECC function.

    Thank you!
  • There's a dedicated piece of memory in your controller with a deliberate error, to test the ECC.

    Here's a piece of test code (lifted from the Hercules Safety Demos):

    void ATCM_Correctable_Error(void) {
    	unsigned int Single_Bit_Err_Loc;
    
        /** - 0xF00803F4 is TI OTP location which has corrupted data "0x9ABCDEF1" */
    	unsigned int * Single_Bit_Err_Loc_ptr = (unsigned int *)(0xF00803F4);
    	
        /** - Setup Flash ECC  
        *     - Error Detection / Correction Enable
        *     - Errors from OTP memory regions unblocked
        *     - Correctable Interrupt Enabled
        */
    	flashWREG->FEDACCTRL1 = 0x20D;
    
        /** Enable Flash ECC in Cortex R4*/
    	_coreEnableFlashEcc_();
    
        /** - Read data from the Single Bit Error location 
    	 *	  - ESM error will be triggered after this read
    	 *	  - Data will be corrected and stored in the variable Single_Bit_Err_Loc
    	 */
    	Single_Bit_Err_Loc = * Single_Bit_Err_Loc_ptr;
    
        /** - Verify that corrected data is stored in the variable
         *  - Transmit back 0x0000000 to PC incase of failure
         */
    	if(Single_Bit_Err_Loc != 0x9ABCDEF0) 	{
    //    sciSend_32bitdata(scilinREG, FAIL); // todo make this relevant to educational boosterpack
    	}
    
        /** - Clear the Flash Single Bit error Flag */
    	flashWREG->FEDACSTATUS = 2;
    
        /** - Disable Flash Error Detection / Correction */
    	flashWREG->FEDACCTRL1 = 0x005;
    
        /** Disable Flash ECC in Cortex R4*/
    	_coreDisableFlashEcc_();
    
    }