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.

TMS320F28379S: FCL example code for tms320F28379S

Part Number: TMS320F28379S
Other Parts Discussed in Thread: C2000WARE, TMS320F28379D, TMDXIDDK379D,

Hi ti experts,

i am using CCS10.4 and C2000Ware_3_04_00_00, C2000Ware_MotorControl_SDK_3_02_00_00 and want to use FCL to increase current control bandwidth.

as you know, ti provide FCL example code based on tms320f28379D under the folder "C:\ti\c2000\C2000Ware_MotorControl_SDK_3_02_00_00\solutions\tmdxiddk379d\f2837x".

i load the example into ccs and it can compile successfully.

However, my customer board is based on tms320f28379S. so there should be some modification based on the example code of x28379D. i find the .cmd file should be different. 

so can you pls send me an special .cmd file for x28379S with FCL functionality? or can you send me an workable example code with FCL for x28379S? thanks a lot.

Looking forward to your reply.

Feng

  • I don't think FCL requires dramatic changes to the cmd file. You can probably just take one of the F2837xS flash cmd files from C2000Ware and compare it to the iddk_servo_2837x_flash_lnk_cpu1.cmd file to see what new sections may need to be added. Linker errors/warnings should help guide you on what sections you may be missing or which sections may need to be provided with more memory than what the default cmd file allocates.

    There's a nice document here on editing linker command files if you're unfamiliar with the process.

    Whitney

  • Dear Whitney,

    actually i compared iddk_servo_2837x_flash_Ink_cpu1.cmd with 2837xS_Generic_FLASH_lnk. and found there are some difference wit CLA related, right?

    i attached two files for your reference.

    MEMORY
    {
    PAGE 0 :  /* Program Memory */
              /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */
              /* BEGIN is used for the "boot to Flash" bootloader mode   */
    
       BEGIN           	: origin = 0x080000, length = 0x000002
       RAMM0           	: origin = 0x000123, length = 0x0002DD
       RAMD0           	: origin = 0x00B000, length = 0x000800
       RAMLS0          	: origin = 0x008000, length = 0x000800
       RAMLS1          	: origin = 0x008800, length = 0x000800
       RAMLS2      		: origin = 0x009000, length = 0x000800
       RAMLS3      		: origin = 0x009800, length = 0x000800
       RAMLS4      		: origin = 0x00A000, length = 0x000800
       RESET           	: origin = 0x3FFFC0, length = 0x000002
    
       /* Flash sectors */
       FLASHA           : origin = 0x080002, length = 0x001FFE	/* on-chip Flash */
       FLASHB           : origin = 0x082000, length = 0x002000	/* on-chip Flash */
       FLASHC           : origin = 0x084000, length = 0x002000	/* on-chip Flash */
       FLASHD           : origin = 0x086000, length = 0x002000	/* on-chip Flash */
       FLASHE           : origin = 0x088000, length = 0x008000	/* on-chip Flash */
       FLASHF           : origin = 0x090000, length = 0x008000	/* on-chip Flash */
       FLASHG           : origin = 0x098000, length = 0x008000	/* on-chip Flash */
       FLASHH           : origin = 0x0A0000, length = 0x008000	/* on-chip Flash */
       FLASHI           : origin = 0x0A8000, length = 0x008000	/* on-chip Flash */
       FLASHJ           : origin = 0x0B0000, length = 0x008000	/* on-chip Flash */
       FLASHK           : origin = 0x0B8000, length = 0x002000	/* on-chip Flash */
       FLASHL           : origin = 0x0BA000, length = 0x002000	/* on-chip Flash */
       FLASHM           : origin = 0x0BC000, length = 0x002000	/* on-chip Flash */
       FLASHN           : origin = 0x0BE000, length = 0x001FF0	/* on-chip Flash */
    
    //   FLASHN_RSVD     : origin = 0x0BFFF0, length = 0x000010    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
    PAGE 1 : /* Data Memory */
             /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */
    
       BOOT_RSVD       : origin = 0x000002, length = 0x000121     /* Part of M0, BOOT rom will use this for stack */
       RAMM1           : origin = 0x000400, length = 0x0003F8     /* on-chip RAM block M1 */
    //   RAMM1_RSVD      : origin = 0x0007F8, length = 0x000008     /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
       RAMD1           : origin = 0x00B800, length = 0x000800
    
       RAMLS5      : origin = 0x00A800, length = 0x000800
    
       RAMGS0      : origin = 0x00C000, length = 0x001000
       RAMGS1      : origin = 0x00D000, length = 0x001000
       RAMGS2      : origin = 0x00E000, length = 0x001000
       RAMGS3      : origin = 0x00F000, length = 0x001000
       RAMGS4      : origin = 0x010000, length = 0x001000
       RAMGS5      : origin = 0x011000, length = 0x001000
       RAMGS6      : origin = 0x012000, length = 0x001000
       RAMGS7      : origin = 0x013000, length = 0x001000
       RAMGS8      : origin = 0x014000, length = 0x001000
       RAMGS9      : origin = 0x015000, length = 0x001000
       RAMGS10     : origin = 0x016000, length = 0x001000
       RAMGS11     : origin = 0x017000, length = 0x000FF8
    //   RAMGS11_RSVD : origin = 0x017FF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    }
    
    SECTIONS
    {
       /* Allocate program areas: */
       .cinit              : > FLASHB      PAGE = 0, ALIGN(8)
       .pinit              : > FLASHB,     PAGE = 0, ALIGN(8)
       .text               : >> FLASHB | FLASHC | FLASHD | FLASHE      PAGE = 0, ALIGN(8)
       codestart           : > BEGIN       PAGE = 0, ALIGN(8)
    
       /* Allocate uninitalized data sections: */
       .stack              : > RAMM1        PAGE = 1
    #if defined(__TI_EABI__)
       .init_array         : > FLASHB,       PAGE = 0,       ALIGN(8)
       .bss                : > RAMLS5,       PAGE = 1
       .bss:output         : > RAMLS3,       PAGE = 0
       .bss:cio            : > RAMLS5,       PAGE = 1
       .data               : > RAMLS5,       PAGE = 1
       .sysmem             : > RAMLS5,       PAGE = 1
       /* Initalized sections go in Flash */
       .const              : > FLASHF,       PAGE = 0,       ALIGN(8)
    #else
       .pinit              : > FLASHB,       PAGE = 0,       ALIGN(8)
       .ebss               : >> RAMLS5 | RAMGS0 | RAMGS1,    PAGE = 1
       .esysmem            : > RAMLS5,       PAGE = 1
       .cio                : > RAMLS5,       PAGE = 1
       /* Initalized sections go in Flash */
       .econst             : >> FLASHF      PAGE = 0, ALIGN(8)
    #endif
    
       /* Initalized sections go in Flash */
       .switch             : > FLASHB      PAGE = 0, ALIGN(8)
    
       .reset              : > RESET,     PAGE = 0, TYPE = DSECT /* not used, */
    
    #ifdef __TI_COMPILER_VERSION__
        #if __TI_COMPILER_VERSION__ >= 15009000
            #if defined(__TI_EABI__)
                .TI.ramfunc : {} LOAD = FLASHD,
                                     RUN = RAMLS0,
                                     LOAD_START(RamfuncsLoadStart),
                                     LOAD_SIZE(RamfuncsLoadSize),
                                     LOAD_END(RamfuncsLoadEnd),
                                     RUN_START(RamfuncsRunStart),
                                     RUN_SIZE(RamfuncsRunSize),
                                     RUN_END(RamfuncsRunEnd),
                                     PAGE = 0, ALIGN(8)
            #else
                .TI.ramfunc : {} LOAD = FLASHD,
                                 RUN = RAMLS0,
                                 LOAD_START(_RamfuncsLoadStart),
                                 LOAD_SIZE(_RamfuncsLoadSize),
                                 LOAD_END(_RamfuncsLoadEnd),
                                 RUN_START(_RamfuncsRunStart),
                                 RUN_SIZE(_RamfuncsRunSize),
                                 RUN_END(_RamfuncsRunEnd),
                                 PAGE = 0, ALIGN(8)
            #endif
        #else
       ramfuncs            : LOAD = FLASHD,
                             RUN = RAMLS0,
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_SIZE(_RamfuncsLoadSize),
                             LOAD_END(_RamfuncsLoadEnd),
                             RUN_START(_RamfuncsRunStart),
                             RUN_SIZE(_RamfuncsRunSize),
                             RUN_END(_RamfuncsRunEnd),
                             PAGE = 0, ALIGN(8)
       #endif
    #endif
    
       ramgs0           : > RAMGS0,    PAGE = 1
       ramgs1           : > RAMGS1,    PAGE = 1
    
       /* The following section definitions are for SDFM examples */
       Filter1_RegsFile : > RAMGS1,	PAGE = 1, fill=0x1111
       Filter2_RegsFile : > RAMGS2,	PAGE = 1, fill=0x2222
       Filter3_RegsFile : > RAMGS3,	PAGE = 1, fill=0x3333
       Filter4_RegsFile : > RAMGS4,	PAGE = 1, fill=0x4444
       Difference_RegsFile : >RAMGS5, 	PAGE = 1, fill=0x3333
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

    //#############################################################################
    //
    // FILE:    iddk_servo_2837x_flash_lnk_cpu1.cmd
    //
    //#############################################################################
    // $TI Release: MotorControl SDK v3.02.00.00 $
    // $Release Date: Sat May 22 19:33:20 CDT 2021 $
    // $Copyright:
    // Copyright (C) 2017-2021 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.
    // $
    //#############################################################################
    // 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.
    //
    // For BIOS applications add:      F28004x_Headers_BIOS.cmd
    // For nonBIOS applications add:   F28004x_Headers_nonBIOS.cmd
    //
    // The user must define CLA_C in the project linker settings if using the
    // CLA C compiler
    // Project Properties -> C2000 Linker -> Advanced Options -> Command File
    // Preprocessing -> --define
    #ifdef CLA_C
    // Define a size for the CLA scratchpad area that will be used
    // by the CLA compiler for local symbols and temps
    // Also force references to the special symbols that mark the
    // scratchpad are.
    CLA_SCRATCHPAD_SIZE = 0x100;
    --undef_sym=__cla_scratchpad_end
    --undef_sym=__cla_scratchpad_start
    #endif //CLA_C
    
    
    MEMORY
    {
       /* BEGIN is used for the "boot to SARAM" bootloader mode   */
       /* BEGIN is used for the "boot to Flash" bootloader mode   */
       BEGIN            : origin = 0x080000, length = 0x000002
       BOOT_RSVD        : origin = 0x000002, length = 0x0001AE     /* Part of M0, BOOT rom will use this for stack */
       RAMM0            : origin = 0x0001B0, length = 0x000250
       RAMM1            : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
    /* RAMD0            : origin = 0x00C000, length = 0x000800 */
    /* RAMD1            : origin = 0x00C800, length = 0x000800 */
       RAMD0_1          : origin = 0x00C000, length = 0x001000
    /* RAMLS0           : origin = 0x008000, length = 0x000800 */
    /* RAMLS1           : origin = 0x008800, length = 0x000800 */
       RAMLS0_1         : origin = 0x008000, length = 0x001000
       RAMLS2           : origin = 0x009000, length = 0x000800
       RAMLS3           : origin = 0x009800, length = 0x000800
       RAMLS4           : origin = 0x00A000, length = 0x000800
       RAMLS5           : origin = 0x00A800, length = 0x000800
       RAMLS6           : origin = 0x00B000, length = 0x000800
       RAMLS7           : origin = 0x00B800, length = 0x000800
    
       RAMGS0           : origin = 0x00D000, length = 0x001000
       RAMGS1           : origin = 0x00E000, length = 0x001000
       RAMGS2           : origin = 0x00F000, length = 0x001000
       RAMGS3           : origin = 0x010000, length = 0x001000
       RAMGS4           : origin = 0x011000, length = 0x001000
       RAMGS5           : origin = 0x012000, length = 0x001000
       RAMGS6           : origin = 0x013000, length = 0x001000
       RAMGS7           : origin = 0x014000, length = 0x001000
       RAMGS8           : origin = 0x015000, length = 0x001000
       RAMGS9           : origin = 0x016000, length = 0x001000
       RAMGS10          : origin = 0x017000, length = 0x001000
       RAMGS11          : origin = 0x018000, length = 0x001000
       RAMGS12          : origin = 0x019000, length = 0x001000
       RAMGS13          : origin = 0x01A000, length = 0x001000
       RAMGS14          : origin = 0x01B000, length = 0x001000
       RAMGS15          : origin = 0x01C000, length = 0x001000
    
       /* Flash sectors */
       FLASHA           : origin = 0x080002,   length = 0x001FFE	/* on-chip Flash */
       FLASHB           : origin = 0x082000,   length = 0x002000	/* on-chip Flash */
       FLASHC           : origin = 0x084000,   length = 0x002000	/* on-chip Flash */
       FLASHD           : origin = 0x086000,   length = 0x002000	/* on-chip Flash */
       FLASHE           : origin = 0x088000,   length = 0x008000	/* on-chip Flash */
       FLASHF           : origin = 0x090000,   length = 0x008000	/* on-chip Flash */
       FLASHG           : origin = 0x098000,   length = 0x008000	/* on-chip Flash */
       FLASHH           : origin = 0x0A0000,   length = 0x008000	/* on-chip Flash */
       FLASHI           : origin = 0x0A8000,   length = 0x008000	/* on-chip Flash */
       FLASHJ           : origin = 0x0B0000,   length = 0x008000	/* on-chip Flash */
       FLASHK           : origin = 0x0B8000,   length = 0x002000	/* on-chip Flash */
       FLASHL           : origin = 0x0BA000,   length = 0x002000	/* on-chip Flash */
       FLASHM           : origin = 0x0BC000,   length = 0x002000	/* on-chip Flash */
       FLASHN           : origin = 0x0BE000,   length = 0x002000	/* on-chip Flash */
    
       CPU1TOCPU2RAM   : origin = 0x03A000, length = 0x000800
       CPU2TOCPU1RAM   : origin = 0x03B000, length = 0x000800
    
       CANA_MSG_RAM     : origin = 0x049000, length = 0x000800
       CANB_MSG_RAM     : origin = 0x04B000, length = 0x000800
    
       RESET            : origin = 0x3FFFC0, length = 0x000002
    
       CLA1_MSGRAMLOW   : origin = 0x001480,   length = 0x000080
       CLA1_MSGRAMHIGH  : origin = 0x001500,   length = 0x000080
    }
    
    
    SECTIONS
    {
       codestart           : > BEGIN, ALIGN(4)
       .text               : >> FLASHA | FLASHB | FLASHC | FLASHD, ALIGN(4)
       .cinit              : > FLASHG, ALIGN(4)
       .switch             : > FLASHG, ALIGN(4)
       .reset              : > RESET, TYPE = DSECT /* not used, */
       .stack              : > RAMM1
    
    #if defined(__TI_EABI__)
       .init_array      : > FLASHG, ALIGN(8)
       .bss             : > RAMLS6 | RAMLS7
       .bss:output      : > RAMLS6 | RAMLS7
       .bss:cio         : > RAMLS6 | RAMLS7
       .data            : > RAMLS6 | RAMLS7
       .sysmem          : > RAMLS6 | RAMLS7
       /* Initalized sections go in Flash */
       .const           : > FLASHG, ALIGN(8)
    #else
       .pinit           : > FLASHG, ALIGN(8)
       .ebss            : > RAMLS6 | RAMLS7
       .esysmem         : > RAMLS6 | RAMLS7
       .cio             : > RAMLS6 | RAMLS7
       /* Initalized sections go in Flash */
       .econst          : > FLASHG, ALIGN(8)
    #endif
    
       MSGRAM_CPU1_TO_CPU2 : > CPU1TOCPU2RAM, type=NOINIT
       MSGRAM_CPU2_TO_CPU1 : > CPU2TOCPU1RAM, type=NOINIT
    
        /* CLA specific sections */
    #if defined(__TI_EABI__)
       Cla1Prog         :   LOAD = FLASHF,
                            RUN = RAMLS4 | RAMLS5,
                            LOAD_START(Cla1funcsLoadStart),
                            LOAD_END(Cla1funcsLoadEnd),
                            RUN_START(Cla1funcsRunStart),
                            LOAD_SIZE(Cla1funcsLoadSize),
                            ALIGN(8)
    #else
       Cla1Prog         :   LOAD = FLASHF,
                            RUN = RAMLS4 | RAMLS5,
                            LOAD_START(_Cla1funcsLoadStart),
                            LOAD_END(_Cla1funcsLoadEnd),
                            RUN_START(_Cla1funcsRunStart),
                            LOAD_SIZE(_Cla1funcsLoadSize),
                            ALIGN(8)
    #endif
    
       ClaData			: > RAMLS3
    
       Cla1ToCpuMsgRAM  : > CLA1_MSGRAMLOW, type=NOINIT
       CpuToCla1MsgRAM  : > CLA1_MSGRAMHIGH, type=NOINIT
    
       /* SFRA specific sections */
       SFRA_F32_Data	: > RAMGS5, ALIGN = 64
       sfra_data    	: > RAMGS5
    
    #ifdef CLA_C
       /* CLA C compiler sections */
       //
       // Must be allocated to memory the CLA has write access to
       //
       CLAscratch       :
                         { *.obj(CLAscratch)
                         . += CLA_SCRATCHPAD_SIZE;
                         *.obj(CLAscratch_end) } >  RAMLS2
    
       .scratchpad      : > RAMLS2
       .bss_cla         : > RAMLS2
    
    #if defined(__TI_EABI__)
       .const_cla       :   LOAD = FLASHF,
                            RUN = RAMLS4,
                            RUN_START(Cla1ConstRunStart),
                            LOAD_START(Cla1ConstLoadStart),
                            LOAD_SIZE(Cla1ConstLoadSize),
                            ALIGN(8)
    #else
       .const_cla       :   LOAD = FLASHF,
                            RUN = RAMLS4,
                            RUN_START(Cla1ConstRunStart),
                            LOAD_START(Cla1ConstLoadStart),
                            LOAD_SIZE(Cla1ConstLoadSize),
                            ALIGN(8)
    #endif
    #endif //CLA_C
    
    #if defined(__TI_EABI__)
       .TI.ramfunc : {
                        --library = PM_tformat_lib_f2837x.lib (.text)
                      } LOAD = FLASHE,
                        RUN = RAMD0_1 | RAMLS0_1,
                        LOAD_START(RamfuncsLoadStart),
                        LOAD_SIZE(RamfuncsLoadSize),
                        LOAD_END(RamfuncsLoadEnd),
                        RUN_START(RamfuncsRunStart),
                        RUN_SIZE(RamfuncsRunSize),
                        RUN_END(RamfuncsRunEnd),
                        ALIGN(4)
    #else
       .TI.ramfunc : {
                        --library = PM_tformat_lib_f2837x.lib (.text)
                        } LOAD = FLASHE,
                        RUN = RAMD0_1 | RAMLS0_1,
                        LOAD_START(_RamfuncsLoadStart),
                        LOAD_SIZE(_RamfuncsLoadSize),
                        LOAD_END(_RamfuncsLoadEnd),
                        RUN_START(_RamfuncsRunStart),
                        RUN_SIZE(_RamfuncsRunSize),
                        RUN_END(_RamfuncsRunEnd),
                        ALIGN(4)
    #endif
    
    }
    
    //===========================================================================
    // End of file.
    //===========================================================================
    

    Feng

  • there are too much difference between two cmd files. i have no ideal how to modify for 28379S based on iddk_servo_2837x_flash_Ink_cpu1.cmd

  • If you think it's easier to just keep iddk_servo_2837x_flash_Ink_cpu1.cmd and edit it to match the F2837xS memory map, that's fine too. If you pull up the F2837xS and F2837xD memory maps in the data sheets and compare, it looks like the only differences are an extra flash bank and no CPU1<->CPU2 message RAMs.

    Whitney