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.

Compiler/TMS470MF06607: Linker ECC Compiler Bug

Part Number: TMS470MF06607
Other Parts Discussed in Thread: NOWECC

Tool/software: TI C/C++ Compiler

Hello,

I've been attempting to compile a TMS470 based project with ECC protection but each time I enable detection and correction through the Flash Error Detection and Correction Control Register 1 (FEDACCTRL1 - 0xFFF87008) the processor falls into an NMI ISR routine and reboots. 

When the program enables EDAC the processor falls into that interrupt and reports the error is at the address of the function call, the one which enable protection and then after falling into NMI the error address changes to that of the NMI function

We have been compiling the program using CCS 8.3.0.00009. We have subsequently tried compiling and programming with an older version of CCS 6.1.0.00104 and the program generated doesn't have the same issue and runs happily with EDAC protection enabled.

As the source code used in both instances have been the same and we have not enabled anything special in the project settings we have determined this must be a compiler issue but what exactly we are unsure of, miss-alignment or incorrectly generated ECC bytes or something else

Thanks,

Jonathan

  • Are you using linker generated ECC or a post processing tool like ECC470? What version of compiler/linker were you using with CCS6 and what version are you now using with CCS8?
  • We are using linker generated ECC

    For both installations of CCS we use the compiler which comes with it

    CCS6 Compiler Version: 5.2.2

    CCS8 Compiler Version: 18.1.4.LTS

    The linker file used

    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /* 
    * Copyright (C) 2009-2016 Texas Instruments Incorporated - www.ti.com  
    * 
    * 
    *  Redistribution and use in source and binary forms, with or without 
    *  modification, are permitted provided that the following conditions 
    *  are met:
    *
    *    Redistributions of source code must retain the above copyright 
    *    notice, this list of conditions and the following disclaimer.
    *
    *    Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in the 
    *    documentation and/or other materials provided with the   
    *    distribution.
    *
    *    Neither the name of Texas Instruments Incorporated nor the names of
    *    its contributors may be used to endorse or promote products derived
    *    from this software without specific prior written permission.
    *
    *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    /*                                                                            */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */
    
    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */
    
    -l rtsv7M3_T_be_eabi.lib
    
    --retain="*(.intvecs)"
    
    /* USER CODE BEGIN (1) */
    ECC {
        algoFMCF035 : address_mask = 0x003ffff8 /* Address Bits 21:3 */
                      hamming_mask = FMC        /* Use Flash Wrapper Mask */
                      parity_mask  = 0xfc       /* Set which ECC bits are Even and Odd parity */
                      mirroring    = F035       /* TMS470M is build in F035 */
    }
    #define FLASH_ECC_ORIGIN  (0x00400000)
    /* USER CODE END */
    
    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */
    
    MEMORY
    {
    /* embedded Flash */
      /* Bank 0 */
        VECTORS  (RX) : origin=0x00000000         length=0x00000100                         fill=0xffffffff
        FLASH0   (RX) : origin=(end(VECTORS))     length=(0x00010000 - size(VECTORS))       vfill=0xffffffff
      /* Bank 1 */
     	/*FLASH1   (RX) : origin=0x00080000         length=0x00000000                        vfill=0xffffffff*/
      /* Bank 0 ECC */
    	ECC_VEC  (R)  : origin=(FLASH_ECC_ORIGIN + (start(VECTORS) >> 1)) length=(size(VECTORS) >> 1) ECC={algorithm=algoFMCF035, input_range=VECTORS}
    	ECC_FLA0 (R)  : origin=(FLASH_ECC_ORIGIN + (start(FLASH0)  >> 1)) length=(size(FLASH0)  >> 1) ECC={algorithm=algoFMCF035, input_range=FLASH0 }
      /* Bank 1 ECC */
    	/*ECC_FLA1 (R)  : origin=(FLASH_ECC_ORIGIN + (start(FLASH1)  >> 1)) length=(size(FLASH1)  >> 1) ECC={algorithm=algoFMCF035, input_range=FLASH1 }*/
    /* embedded SRAM */
        STACKS   	(RW) : origin=0x08000000         length=0x00000800
        RAM      	(RW) : origin=0x08000800         length=0x00004800				/*	Ends at 0x08005000	*/
    }
    
    /* USER CODE BEGIN (3) */
    /* USER CODE END */
    
    /*----------------------------------------------------------------------------*/
    /* Section Configuration                                                      */
    
    SECTIONS
    {
        .intvecs : {} palign=8 > VECTORS
        .vim_table : {} VIM_TABLE
        .text    : {} palign=8 > FLASH0
        .const   : {} palign=8 > FLASH0
        .cinit   : {} palign=8 > FLASH0
        .pinit   : {} palign=8 > FLASH0
        .bss     : {} > RAM 
        .data    : {} > RAM 
    
       .stack   :                            /* SOFTWARE SYSTEM STACK                 */
       {                                                   /* initial stack pointer values          */
        . += 0x00000400;  _Stack_Table_Pointer  = .;
        . += 0x00000400;  _Stack_Handler_Pointer  = .;
       } > STACKS
    
    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }
    

  • When you build with version 18.1.4, do you get this warning?

    "../source/sys_link.cmd", line 8: warning #10437-D: Specifying ECC Hamming mask "FMC" is deprecated; remove hamming mask specification
    

  • I can duplicate your issue. It looks like the ECC generated is incorrect for TMS470MF06607 when they obsoleted the Hamming mask "FMC" feature. There are two options to workaround for now.

    You can add compiler version 5.2.2 to the compiler version search path in CCS8. Choose "Window" -> "Preferences" from the menu. Then add the path to compiler version 5.2.2. as shown (the location will likely be different on your machine)

    The second option is to use nowECC to generate the ECC as a post build operation.

  • Hi,

    I've already added in the older compiler into my install of CCS8 and as you say, that works fine and compiles correctly. This is the setup I shall use for the time being

    I looked into using NowECC but the tool kept crashing after reaching the end of the file and never gave me an output file

    Moving forward, will this compiler issue be resolved? Or should we keep it as part of our installation procedure to install this older version of the compiler and add it into CCS? Would you be able to tell me which was the last compiler that was able to generate the ECC bytes correctly?

    Thanks,

    Jonathan

  • Hi Jonathan,

    I am working with the tools team for a replacement of the 'FMC" option in the link command file to fix the problem. I hope to have more information soon.

  • Hi Bob,

    Has a solution been developed for this issue? Should I expect it to be included in the next compiler release?

    Thanks,
    Jonathan
  • I was told they do want to fix this for a future release, but I have not yet received a timeline for such a fix. In the meantime, there is a workaround that works for both the older and newer linkers (and likely will continue to work with newer versions). Replace the ECC algorithm definition in the linker command file with the following definition:

    ECC {
        algoFMCF035 : address_mask = 0x003ffff8 /* Address Bits 21:3 */
          hamming_mask =
            0x00AAA750, 0x0005D688, 0x00154DA8, 0x00343C68, 0x000CFC18, 0x0003FC00, 0x000FFC00, 0x000003F8,
            0x4B2E4B2E, 0x15571557, 0xA699A699, 0x38E338E3, 0xC0FCC0FC, 0xFF00FF00, 0xFF0000FF, 0xFF0000FF,
            0xB4D1B4D1, 0x15571557, 0xA699A699, 0x38E338E3, 0xC0FCC0FC, 0xFF00FF00, 0xFF0000FF, 0x00FFFF00
          parity_mask  = 0xFC       /* Set which ECC bits are Odd parity */
          mirroring    = F035       /* TMS470M is build in F035 */
    }