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.

CCS/TMS320F28032: TMS320F28032 Processor breaks with If-Else loop Depending on version of compiler (Code Composer)

Part Number: TMS320F28032
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Greetings,

I have been doing the majority of the design for a TMS320F28032 Chip on Code Composer version 7. Then One day I added a few more stages to an If-Else statement and the chip completely broke and did not work. When I removed the extra "If Else" Statements it started working again. 

I checked the optimization, turned it off and recompiled it with the If-Else statement in and out. Same results, The chip also has some sort of XDAIS component that I unchecked and thought that might be the culprit but the same thing happened again.

Tried it in code composer 6.2 It worked for a while and then I was working on another different If -Else  statement and now in version 6.2  the same thing is happening. It breaks with an If-else statement.....

This is very unnerving that this could happen and I have no idea besides some wildly odd optimization issue being present what could cause this (Optimization is now off) 

Has anyone had this issue before or should I be shopping around for a different processor?

Thanks 

Bill

  • Hi Bill,

    Can you give me more details? What specific compiler version works? Which one doesn't? (You can find the compiler version in your project properties).

    Are you saying the if-else still fails even when optimization is turned off?

    Thanks,
    Whitney
  • Whitney,

    I think I may have found the culprit for this one. As I was digging around trying to think about what could possible cause this I looked that the memory allocation and it appears that we have a very large timer 0 interrup that is about 1500 lines long (too long) and is suycking up an enormous amount of memory.

    RAML0 here is 99% full and if I add even a few lines of code Boom. We are toast. 

    My question now is: "How do I control" which section of RAM I am using? Can I break this interrupt up and use some of RAML1? Or can I make RAML0 twice as big?

    Thank you!!!

  • We have a wiki page on linking that should help you edit your .cmd file. It explains how to combine memory regions or how to split a section (like .text) across multiple memory regions.

    C28x Compiler - Understanding Linking

    Let me know if you have trouble with it.

    Whitney

  • Whitney,

    Could you point me to a good example? The document has some examples with flash but I would like to combine RAML0 and RAML1
    Thanks

    Bill
  • Bill,

    It works pretty much the same way for RAM. I just imported one of the F2803x examples from C2000Ware (epwm_dcevent_trip_comp) and found that it has a cmd file with L0 and L1 combined.

    /*
    // TI File $Revision: /main/2 $
    // Checkin $Date: February 20, 2009   15:34:01 $
    //###########################################################################
    //
    // FILE:    28035_RAM_lnk.cmd
    //
    // TITLE:   Linker Command File For 28035 examples that run out of RAM
    //
    //          This ONLY includes all SARAM blocks on the 28035 device.
    //          This does not include flash or OTP.
    //
    //          Keep in mind that L0,L1,L2, and L3 are protected by the code
    //          security module.
    //
    //          What this means is in most cases you will want to move to
    //          another memory map file which has more memory defined.
    //
    //###########################################################################
    // $TI Release: F2803x Support Library v2.01.00.00 $
    // $Release Date: Mon May 22 15:41:40 CDT 2017 $
    // $Copyright:
    // Copyright (C) 2009-2017 Texas Instruments Incorporated - http://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.
    // $
    //###########################################################################
    */
    
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    // add the header linker command file directly to the project.
    // The header linker command file is required to link the
    // peripheral structures to the proper locations within
    // the memory map.
    //
    // The header linker files are found in <base>\DSP2803x_headers\cmd
    //
    // For BIOS applications add:      DSP2803x_Headers_BIOS.cmd
    // For nonBIOS applications add:   DSP2803x_Headers_nonBIOS.cmd
    ========================================================= */
    
    /* ======================================================
    // For Code Composer Studio prior to V2.2
    // --------------------------------------
    // 1) Use one of the following -l statements to include the
    // header linker command file in the project. The header linker
    // file is required to link the peripheral structures to the proper
    // locations within the memory map                                    */
    
    /* Uncomment this line to include file only for non-BIOS applications */
    /* -l DSP2803x_Headers_nonBIOS.cmd */
    
    /* Uncomment this line to include file only for BIOS applications */
    /* -l DSP2803x_Headers_BIOS.cmd */
    
    /* 2) In your project add the path to <base>\DSP2803x_headers\cmd to the
       library search path under project->build options, linker tab,
       library search path (-i).
    /*========================================================= */
    
    /* Define the memory block start/length for the DSP2803x
       PAGE 0 will be used to organize program sections
       PAGE 1 will be used to organize data sections
    
       Notes:
             Memory blocks on F28035 are uniform (ie same
             physical memory) in both PAGE 0 and PAGE 1.
             That is the same memory region should not be
             defined for both PAGE 0 and PAGE 1.
             Doing so will result in corruption of program
             and/or data.
    
             L0 block is mirrored - that is it
             can be accessed in high memory or low memory.
             For simplicity only one instance is used in this
             linker file.
    
             Contiguous SARAM memory blocks can be combined
             if required to create a larger memory block.
    */
    
    MEMORY
    {
    PAGE 0 :
       /* BEGIN is used for the "boot to SARAM" bootloader mode   */
    
       BEGIN      : origin = 0x000000, length = 0x000002
       RAMM0      : origin = 0x000050, length = 0x0003B0
       RAML0L1    : origin = 0x008000, length = 0x000D00
       RESET      : origin = 0x3FFFC0, length = 0x000002
       IQTABLES   : origin = 0x3FE000, length = 0x000B50     /* IQ Math Tables in Boot ROM */
       IQTABLES2  : origin = 0x3FEB50, length = 0x00008C     /* IQ Math Tables in Boot ROM */
       IQTABLES3  : origin = 0x3FEBDC, length = 0x0000AA	 /* IQ Math Tables in Boot ROM */
    
       BOOTROM    : origin = 0x3FF27C, length = 0x000D44
    
    
    PAGE 1 :
    
       BOOT_RSVD   : origin = 0x000002, length = 0x00004E     /* Part of M0, BOOT rom will use this for stack */
       RAMM1       : origin = 0x000480, length = 0x000380     /* on-chip RAM block M1 */
       RAML2       : origin = 0x008D00, length = 0x000300
       RAML3       : origin = 0x009000, length = 0x001000
    }
    
    
    SECTIONS
    {
       /* Setup for "boot to SARAM" mode:
          The codestart section (found in DSP28_CodeStartBranch.asm)
          re-directs execution to the start of user code.  */
       codestart        : > BEGIN,     PAGE = 0
       ramfuncs         : > RAMM0      PAGE = 0
       .text            : > RAML0L1,   PAGE = 0
       .cinit           : > RAMM0,     PAGE = 0
       .pinit           : > RAMM0,     PAGE = 0
       .switch          : > RAMM0,     PAGE = 0
       .reset           : > RESET,     PAGE = 0, TYPE = DSECT /* not used, */
    
       .stack           : > RAMM1,     PAGE = 1
       .ebss            : > RAML2,     PAGE = 1
       .econst          : > RAML2,     PAGE = 1
       .esysmem         : > RAML2,     PAGE = 1
    
       IQmath           : > RAML0L1,   PAGE = 0
       IQmathTables     : > IQTABLES,  PAGE = 0, TYPE = NOLOAD
    
      /* Uncomment the section below if calling the IQNexp() or IQexp()
          functions from the IQMath.lib library in order to utilize the
          relevant IQ Math table in Boot ROM (This saves space and Boot ROM
          is 1 wait-state). If this section is not uncommented, IQmathTables2
          will be loaded into other memory (SARAM, Flash, etc.) and will take
          up space, but 0 wait-state is possible.
       */
       /*
       IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
       {
    
                  IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)
    
       }
       */
       /* Uncomment the section below if calling the IQNasin() or IQasin()
          functions from the IQMath.lib library in order to utilize the
          relevant IQ Math table in Boot ROM (This saves space and Boot ROM
          is 1 wait-state). If this section is not uncommented, IQmathTables2
          will be loaded into other memory (SARAM, Flash, etc.) and will take
          up space, but 0 wait-state is possible.
       */
       /*
       IQmathTables3    : > IQTABLES3, PAGE = 0, TYPE = NOLOAD
       {
    
                  IQmath.lib<IQNasinTable.obj> (IQmathTablesRam)
    
       }
       */
    
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

    See the RAML0L1 memory region that replaced RAML0 and RAML1 and that .text is being placed in the combined section.

    Whitney