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.

Program will not fit into available memory

Hello,

I'm developing a project using a TMS28335 microcontroller, but I'm new in these topics so I've just copied some code from several examples.

I'm running a program from FLASH memory, and I was defining an array of size 2048 without having problems, but now I need to change its size to 4200 but I got this error:

program will not fit into available memory. run placement with alignment/blocking fails for section ".ebss" size 0x1048 page 1. Available memory ranges: F28335_FLASH_FlashingLeds.CMD /Prueba3 line 146 C/C++ Problem

My code is:

Uint16 Aux1;
Uint16 Datos[TAM]; // where TAM is 2048 and I need it to be 4200
Uint32 Suma;
Uint32 Promedio;
Uint16 DatoRec;

I suppose that section .ebss has not enough space to include all the variables, so my question is, how could I change the section where variables are assigned?

This could be a simple question, but I'm really confused with all this programming, that's why I have copied some example code sections.

Thanks for your help.

  • Hello, Christian.

    If you use "Datos" as read-write array, it must be placed only in the memory (.ebss, by the compiler). Otherwise, please use "const" modifier to put "Datos" to the FLASH.

    For the available memory mappings, please refer to the sprs439m.pdf, page 35. You have 32k (in words, 16 bit) memory for use by program and data.

    Please, show your linker script (F28335_FLASH_FlashingLeds.CMD). To fit your data, you need to extend ".ebss" section in a way:

         .ebss : > RAML4 | RAML5   PAGE = 1

    instead of default one:

         .ebss : > RAML4  PAGE = 1

    Array of size 2048 is 0x800 words and will take just a half of the RAML4. When you grow your array to 4200 you'll take 0x1068 words of the maximum 0x1000 words available per memory block.

    Hope this helps.

  • Hello Christian!

    Try to make the following changes to the file F28335_FLASH_FlashingLeds.CMD:

    .ebss : > RAML45 PAGE = 1
    data : > RAML45 PAGE = 1

    ...................................................


    SECTIONS
    {
    Net_terminals: > RAML45,PAGE = 1
    Controller: > RAML45,PAGE = 1
    IBx_addr: > RAML45,PAGE = 1
    Buck1Loop: > RAML45,PAGE = 1
    Buck2Loop: > RAML45,PAGE = 1
    DataLogTST: > RAML45,PAGE = 1
    GraphData: > RAML45,PAGE = 1

    }

    Regards,

    Igor

  • Hello Anton and Igor,

    Thanks for your answers, I've changed my CMD file at the .ebss part.

    Trying with:

    .ebss : > RAML45   PAGE = 1 

    makes I still got the following error:

    no valid memory range(NULL) available for placement of ".ebss" F28335_FLASH_FlashingLeds.CMD /Prueba3 line 146 C/C++ Problem

    I'm using CCSv5, by the way. Changing the code to:

    .ebss : > RAML4 | RAML5   PAGE = 1

    now gives me this error:

    program will not fit into available memory. run placement with alignment/blocking fails for section ".ebss" size 0x10b0 page 1. Available memory ranges: RAML4 size: 0x1000 unused: 0x1000 max hole: 0x1000 RAML5 size: 0x1000 unused: 0x1000 max hole: 0x1000 F28335_FLASH_FlashingLeds.CMD /Prueba3 line 146 C/C++ Problem

    I also have 2 questions:

    1. If I change the line that starts with .ebss, I must change the line that starts with data, and all the lines at SECTIONS, as Igor suggested?

    2. Additional to the data I have, I need to declare more variables. Which memory section could I join to RAML4 and RAML5, when solved the actual problem?

    1513.F28335_FLASH_FlashingLeds.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    // TI File $Revision: /main/9 $
    // Checkin $Date: August 28, 2007 11:23:38 $
    //###########################################################################
    //
    // FILE: F28335.cmd
    //
    // TITLE: Linker Command File For F28335 Device
    //
    //###########################################################################
    // $TI Release: DSP2833x Header Files V1.00 $
    // $Release Date: September 7, 2007 $
    //###########################################################################
    */
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks for your help!

  • Try to change memory sections definition.

    Replace those segments:

       RAML4      : origin = 0x00C000, length = 0x001000
       RAML5      : origin = 0x00D000, length = 0x001000

    with this one:

       RAML45     : origin = 0x00C000, length = 0x002000

    And then correct ".ebss" and others' placement:

    SECTIONS
    {
       // …
       .ebss            : > RAML45,     PAGE = 1
       data              : > RAML45      PAGE = 1
       DMARAML4  : > RAML45,     PAGE = 1
       DMARAML5  : > RAML45,     PAGE = 1
       // …
    }

    SECTIONS
    {
        Net_terminals:    > RAML45,PAGE = 1
        Controller:        > RAML45,PAGE = 1
        IBx_addr:         > RAML45,PAGE = 1
        Buck1Loop:        > RAML45,PAGE = 1
        Buck2Loop:        > RAML45,PAGE = 1
        DataLogTST:     > RAML45,PAGE = 1
        GraphData:         > RAML45,PAGE = 1
    }


    > 2. Additional to the data I have, I need to declare more variables. Which memory section could I join to RAML4 and RAML5, when solved the actual problem?


    You may use RAML6 and RAML7 when you'll need more memory or want to separate data between segments.


    program will not fit into available memory. run placement with alignment/blocking fails for section ".ebss" size 0x10b0 page 1. Available memory ranges: RAML4 size: 0x1000 unused: 0x1000 max hole: 0x1000 RAML5 size: 0x1000 unused: 0x1000 max hole: 0x1000 F28335_FLASH_FlashingLeds.CMD /Prueba3 line 146 C/C++ Problem

    This error happens, cause' you can't split continious data into two memory segments even they have no gaps.

  • Hello Christian!

    You should replace all the lines that were mentioned. Changing only one line does not make sense. If you want you can send your project. Also you can try following variants:

    1030.0000.F28335_FLASH_FlashingLeds.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    // TI File $Revision: /main/9 $
    // Checkin $Date: August 28, 2007 11:23:38 $
    //###########################################################################
    //
    // FILE: F28335.cmd
    //
    // TITLE: Linker Command File For F28335 Device
    //
    //###########################################################################
    // $TI Release: DSP2833x Header Files V1.00 $
    // $Release Date: September 7, 2007 $
    //###########################################################################
    */
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    5852.0001.F28335_FLASH_FlashingLeds.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    // TI File $Revision: /main/9 $
    // Checkin $Date: August 28, 2007 11:23:38 $
    //###########################################################################
    //
    // FILE: F28335.cmd
    //
    // TITLE: Linker Command File For F28335 Device
    //
    //###########################################################################
    // $TI Release: DSP2833x Header Files V1.00 $
    // $Release Date: September 7, 2007 $
    //###########################################################################
    */
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    3364.0000.F28335_FLASH_FlashingLeds.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    // TI File $Revision: /main/9 $
    // Checkin $Date: August 28, 2007 11:23:38 $
    //###########################################################################
    //
    // FILE: F28335.cmd
    //
    // TITLE: Linker Command File For F28335 Device
    //
    //###########################################################################
    // $TI Release: DSP2833x Header Files V1.00 $
    // $Release Date: September 7, 2007 $
    //###########################################################################
    */
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    3124.DSP2833x_Headers_nonBIOS.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    // TI File $Revision: /main/8 $
    // Checkin $Date: June 2, 2008 11:12:24 $
    //###########################################################################
    //
    // FILE: DSP2833x_Headers_nonBIOS.cmd
    //
    // TITLE: DSP2833x Peripheral registers linker command file
    //
    // DESCRIPTION:
    //
    // This file is for use in Non-BIOS applications.
    //
    // Linker command file to place the peripheral structures
    // used within the DSP2833x headerfiles into the correct memory
    // mapped locations.
    //
    // This version of the file includes the PieVectorTable structure.
    // For BIOS applications, please use the DSP2833x_Headers_BIOS.cmd file
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    7077.0001.F28335_FLASH_FlashingLeds.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    // TI File $Revision: /main/9 $
    // Checkin $Date: August 28, 2007 11:23:38 $
    //###########################################################################
    //
    // FILE: F28335.cmd
    //
    // TITLE: Linker Command File For F28335 Device
    //
    //###########################################################################
    // $TI Release: DSP2833x Header Files V1.00 $
    // $Release Date: September 7, 2007 $
    //###########################################################################
    */
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    1526.DSP2833x_Headers_nonBIOS.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    // TI File $Revision: /main/8 $
    // Checkin $Date: June 2, 2008 11:12:24 $
    //###########################################################################
    //
    // FILE: DSP2833x_Headers_nonBIOS.cmd
    //
    // TITLE: DSP2833x Peripheral registers linker command file
    //
    // DESCRIPTION:
    //
    // This file is for use in Non-BIOS applications.
    //
    // Linker command file to place the peripheral structures
    // used within the DSP2833x headerfiles into the correct memory
    // mapped locations.
    //
    // This version of the file includes the PieVectorTable structure.
    // For BIOS applications, please use the DSP2833x_Headers_BIOS.cmd file
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards,

    Igor

  • BTW, you may try to correct a little bit a previous statement before changing a number of lines:

        .ebss : >> RAML4 | RAML5   PAGE = 1

    The ">>" operator used to indicate that an output section can be split into specified memory ranges, spru513e.pdf, p.195, 7.5.4.7.

  • Thanks to both of you! I finally changed the memory section lengths, and it worked fine.

    I will also review the variants you sent me, and the use of  ">>" operator.