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.

TMDSCNCD28388D: TMDSCNCD28388D programme will not fit into memory linker error

Part Number: TMDSCNCD28388D


Tool/software:

Hello All,

             My development code size is increased and getting the following error.I tried to optimize code its helped some time .

I checked data sheet of TMDSCNCD28388D it seems i cant alter the linker file for additional memory allocation to fit code.

Is there any way i can use FLASH area instead of RAM area for flash.

Also currently iam using the inbuilt debugger XDS-10.

Thanks in advance

Narasimhaj

  • Hi Narasimhaj,

    Can you show what the current memory allocation looks like for your program?

    Have you used max available flash memory for this device?

    Thanks and regards,

    Charles

  • Hello Charles,

                         Thanks for the reply.

    I am here by attaching the device_cmd.cmd file where the memory allocation for RAM and FLASH are available, i tried to modify these lengths, but during the building it reverts back to original values of length and addresses.

     

    #ifdef generic_ram_lnk
    
    MEMORY
    {
    
        RAMM0_BEGIN               : origin = 0x000000, length = 0x000002
        RAMM0                     : origin = 0x0001B1, length = 0x00024F
        RAMM1                     : origin = 0x000400, length = 0x0003F8
        CLATOCPU_MSGRAM           : origin = 0x001480, length = 0x000080
        CPUTOCLA_MSGRAM           : origin = 0x001500, length = 0x000080
        CLATODMA_MSGRAM           : origin = 0x001680, length = 0x000080
        DMATOCLA_MSGRAM           : origin = 0x001700, length = 0x000080
        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
        RAMLS5                    : origin = 0x00A800, length = 0x000800
        RAMLS6                    : origin = 0x00B000, length = 0x000800
        RAMLS7                    : origin = 0x00B800, length = 0x000800
        RAMD0                     : origin = 0x00C000, length = 0x000800
        RAMD1                     : origin = 0x00C800, 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 = 0x000FF8
        CMTOCPURAM                : origin = 0x038000, length = 0x000800
        CPUTOCMRAM                : origin = 0x039000, length = 0x000800
        CPU1TOCPU2RAM             : origin = 0x03A000, length = 0x000800
        CPU2TOCPU1RAM             : origin = 0x03B000, length = 0x000800
        FLASH0                    : origin = 0x080000, length = 0x002000
        FLASH1                    : origin = 0x082000, length = 0x002000
        FLASH2                    : origin = 0x084000, length = 0x002000
        FLASH3                    : origin = 0x086000, length = 0x002000
        FLASH4                    : origin = 0x088000, length = 0x008000
        FLASH5                    : origin = 0x090000, length = 0x008000
        FLASH6                    : origin = 0x098000, length = 0x008000
        FLASH7                    : origin = 0x0A0000, length = 0x008000
        FLASH8                    : origin = 0x0A8000, length = 0x008000
        FLASH9                    : origin = 0x0B0000, length = 0x008000
        FLASH10                   : origin = 0x0B8000, length = 0x002000
        FLASH11                   : origin = 0x0BA000, length = 0x002000
        FLASH12                   : origin = 0x0BC000, length = 0x002000
        FLASH13                   : origin = 0x0BE000, length = 0x002000
        RESET                     : origin = 0x3FFFC0, length = 0x000002
    }
    
    
    SECTIONS
    {
        //
        // C28x Sections
        //
        .reset               : >  RESET, TYPE = DSECT /* not used, */
        codestart            : >  0x000000
        .text                : >> RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4
        .TI.ramfunc          : >  RAMM0
        .cinit               : >  RAMM0
        .stack               : >  RAMM1
        .init_array          : >  RAMM0
        .bss                 : >  RAMLS5
        .const               : >  RAMLS5
        .data                : >> RAMGS0 | RAMGS1
        .switch              : >  RAMM0
        .sysmem              : >  RAMLS5
        MSGRAM_CPU1_TO_CPU2 : > CPU1TOCPU2RAM, type=NOINIT
        MSGRAM_CPU2_TO_CPU1 : > CPU2TOCPU1RAM, type=NOINIT
        MSGRAM_CPU_TO_CM    : > CPUTOCMRAM, type=NOINIT
        MSGRAM_CM_TO_CPU    : > CMTOCPURAM, type=NOINIT
    
    }
    
    #endif
    #ifdef generic_flash_lnk
    
    MEMORY
    {
    
        RAMM0                     : origin = 0x0001B1, length = 0x00024F
        RAMM1                     : origin = 0x000400, length = 0x0003F8
        CLATOCPU_MSGRAM           : origin = 0x001480, length = 0x000080
        CPUTOCLA_MSGRAM           : origin = 0x001500, length = 0x000080
        CLATODMA_MSGRAM           : origin = 0x001680, length = 0x000080
        DMATOCLA_MSGRAM           : origin = 0x001700, length = 0x000080
        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
        RAMLS5                    : origin = 0x00A800, length = 0x000800
        RAMLS6                    : origin = 0x00B000, length = 0x000800
        RAMLS7                    : origin = 0x00B800, length = 0x000800
        RAMD0                     : origin = 0x00C000, length = 0x000800
        RAMD1                     : origin = 0x00C800, 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 = 0x000FF8
        CMTOCPURAM                : origin = 0x038000, length = 0x000800
        CPUTOCMRAM                : origin = 0x039000, length = 0x000800
        CPU1TOCPU2RAM             : origin = 0x03A000, length = 0x000800
        CPU2TOCPU1RAM             : origin = 0x03B000, length = 0x000800
        FLASH0                    : origin = 0x080000, length = 0x002000
        FLASH1                    : origin = 0x082000, length = 0x002000
        FLASH2                    : origin = 0x084000, length = 0x002000
        FLASH3                    : origin = 0x086000, length = 0x002000
        FLASH4                    : origin = 0x088000, length = 0x008000
        FLASH5                    : origin = 0x090000, length = 0x008000
        FLASH6                    : origin = 0x098000, length = 0x008000
        FLASH7                    : origin = 0x0A0000, length = 0x008000
        FLASH8                    : origin = 0x0A8000, length = 0x008000
        FLASH9                    : origin = 0x0B0000, length = 0x008000
        FLASH10                   : origin = 0x0B8000, length = 0x002000
        FLASH11                   : origin = 0x0BA000, length = 0x002000
        FLASH12                   : origin = 0x0BC000, length = 0x002000
        FLASH13                   : origin = 0x0BE000, length = 0x002000
        RESET                     : origin = 0x3FFFC0, length = 0x000002
    }
    
    
    SECTIONS
    {
        //
        // C28x Sections
        //
        .reset               : >  RESET, TYPE = DSECT /* not used, */
        codestart            : >  0x080000
        .text                : >> FLASH1 | FLASH2 | FLASH3 | FLASH4,
                                  ALIGN(8)
        .TI.ramfunc          :    LOAD >  FLASH3,
                                  RUN  >  RAMLS0,
                                  TABLE(copyTable_ramfunc),
                                  ALIGN(8)
        .binit               : >  FLASH4,
                                  ALIGN(8)
        .ovly                : >  FLASH6,
                                  ALIGN(8)
        .cinit               : >  FLASH4,
                                  ALIGN(8)
        .stack               : >  RAMM1
        .init_array          : >  FLASH1,
                                  ALIGN(8)
        .bss                 : >  RAMLS5
        .const               : >  FLASH5,
                                  ALIGN(8)
        .data                : >> RAMLS6 | RAMLS7
        .switch              : >  FLASH1,
                                  ALIGN(8)
        .sysmem              : >  RAMLS5
        MSGRAM_CPU1_TO_CPU2 : > CPU1TOCPU2RAM, type=NOINIT
        MSGRAM_CPU2_TO_CPU1 : > CPU2TOCPU1RAM, type=NOINIT
        MSGRAM_CPU_TO_CM    : > CPUTOCMRAM, type=NOINIT
        MSGRAM_CM_TO_CPU    : > CMTOCPURAM, type=NOINIT
    
    }
    
    #endif
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

    During software build i used blinky example to start the work , i have also attached the led_ex1_blinky.syscfg file.

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --board "/boards/TMDSCNCD28388D" --device "F2838x" --package "337bga" --part "F2838x_337bga" --context "CPU1" --product "C2000WARE@5.02.00.00"
     * @versions {"tool":"1.0.0+dev"}
     */
    /**
     * Import the modules used in this configuration.
     */
    const led            = scripting.addModule("/driverlib/board_components/led", {}, false);
    const led1           = led.addInstance();
    const device_support = scripting.addModule("/driverlib/device_support.js");
    const sysctl         = scripting.addModule("/driverlib/sysctl.js");
    const CMD            = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
    const CMD1           = CMD.addInstance();
    const CMD2           = CMD.addInstance();
    /**
     * Write custom configuration values to the imported modules.
     */
    CMD1.$name                    = "generic_ram_lnk";
    CMD2.$name                    = "generic_flash_lnk";
    
    CMD1.sectionMemory_text       = ["RAMLS0","RAMLS1","RAMLS2","RAMLS3","RAMLS4"];
    CMD1.sectionMemory_ramfunc    = ["RAMM0"];
    CMD1.sectionMemory_cinit      = ["RAMM0"];
    CMD1.sectionMemory_stack      = ["RAMM1"];
    CMD1.sectionMemory_init_array = ["RAMM0"];
    CMD1.sectionMemory_bss        = ["RAMLS5"];
    CMD1.sectionMemory_const      = ["RAMLS5"];
    CMD1.sectionMemory_data       = ["RAMGS0", "RAMGS1"];
    CMD1.sectionMemory_switch     = ["RAMM0"];
    CMD1.sectionMemory_sysmem     = ["RAMLS5"];
    
    CMD2.sectionAlignEnable_ramfunc    = true;
    CMD2.sectionAlignEnable_text       = true;
    CMD2.sectionAlignEnable_binit      = true;
    CMD2.sectionAlignEnable_cinit      = true;
    CMD2.sectionAlignEnable_switch     = true;
    CMD2.sectionAlignEnable_init_array = true;
    CMD2.sectionAlignEnable_const      = true;
    CMD2.sectionAlignEnable_ovly       = true;
    CMD2.sectionMemory_codestart       = "0x080000";
    CMD2.sectionMemory_stack           = ["RAMM1"];
    CMD2.sectionMemory_bss             = ["RAMLS5"];
    CMD2.sectionMemory_data            = ["RAMLS6", "RAMLS7"];
    CMD2.sectionMemory_sysmem          = ["RAMLS5"];
    CMD2.sectionMemory_ramfunc         = ["FLASH3"];
    CMD2.sectionMemory_text            = ["FLASH1","FLASH2","FLASH3","FLASH4"];
    CMD2.sectionMemory_binit           = ["FLASH4"];
    CMD2.sectionMemory_cinit           = ["FLASH4"];
    CMD2.sectionMemory_switch          = ["FLASH1"];
    CMD2.sectionMemory_init_array      = ["FLASH1"];
    CMD2.sectionMemory_const           = ["FLASH5"];
    CMD2.sectionMemory_ovly            = ["FLASH6"];
    CMD2.sectionRunFromDifferentAddr_ramfunc = true;
    CMD2.sectionRun_ramfunc                  = ["RAMLS0"];
    CMD2.sectionBinit_ramfunc                = false;
    
    led1.$name                = "myBoardLED0";
    led1.$hardware            = system.deviceData.board.components.D1;
    led1.gpio.gpioPin.$assign = "hsecDigital.82";

    Have you used max available flash memory for this device?

    Could you suggest me where i can change these configurations to adapt more  flash area to accommodate higher code size.

    Thanks and Regards

    Narasimhaj

  • Hi Narasimhaj,

    The generated .map file would do better to show the memory allocation for this device. There, we could see how much Flash memory is being taken and if some sectors can be used for further allocation.

    To add more flash sectors for programming, you can modify this line:

    CMD2.sectionMemory_text            = ["FLASH1","FLASH2","FLASH3","FLASH4"];

    to include FLASH5, FLASH6, ... for more flash memory space.

    I will note that the origin error indicates that the sections stored in RAM are larger than available RAM space, therefore unused seen as 0x0. Can you use GS RAM instead for those allocations?

    Also, when you are generating the project the error shows up in the RAM config only correct?

    Thanks and regards,

    Charles

  • Hello Charles,

                        Sorry for late reply,

    Thanks it worked.

    Thanks and Regards

    Narasimhaj