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.

28035 linker file problem: .no sufficient memory space for .ebss

Other Parts Discussed in Thread: CONTROLSUITE

Hi all :

I'm now working on piccolo 28035 MCU with CCS v5.2 and compiler v6.1.4

I have assigned a RAM memory  space  for ,ebss as follow (the complete .cmd file and .map file is attached ):

http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/171/5287.map-file-and-cmd-file.7z

MEMORY

{

RAMM0 : origin = 0x000050, length = 0x0003B0 /* on-chip RAM block M0 */

  RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 *

RAML1L2L3 :   origin = 0x008800, length = 0x001800

}

SECTION

{

       .ebss             : >> RAML1L2L3|RAMM1,     PAGE = 1

}

but when I  build my project ,it appears following error  :

#10099-D program will not fit into available memory. run placement with alignment/blocking fails for section ".ebss" size 0x18e9 page 1. Available memory ranges: 

There are two things confused me that

1.  I   use  ">>" operator to split .ebss file into "RAML1L2L3" and "RAMM1" memory,  the total length(0x1800+0x0400) should be bigger than ".ebss" size (0x18e9) 

      and I didn't assign other sections into these memory, but why it can't fit  ".ebss" ?

2. The warning message doesn't show the value of  "Available memory ranges:" ,is that normal?


Thanks for your reading and any suggestions will be appreciated!

 

  • Hi Will!

    will yang said:

    2. The warning message doesn't show the value of  "Available memory ranges:" ,is that normal?

    It's strange. Check please in Project's Properties:

    1 What memory model is used

    2 What size of memory is allocated for stack (C2000 Linker->Basic Options->Set C system Stack Size)

    I have looked at your attached CMD. For the time being I didn't find something wrong.

    Regards,

    Igor 

  • Will,

    The linker does not have infinitely small granularity when splitting a section.  I ran a quick test and it looks like the linker will only split the .ebss section down to the object module level.  For example, suppose you have two source files: main.c, and foo.c, and you declare global variables in each.  The linker will keep the global vars from each source file together.  It will not split them.  This seems reasonable.  I reason it this way: if you have an array for example, you'd agree that it cannot be split.  I suspect the linker cannot see into each object module and determine the composition of the .ebss section.  It treats the contribution of each object module as an "Array" that cannot be split.

    So, it may be that despite your trying to split your section up and put in multiple memories that would appear to have sufficient capacity, the linker may not have been able to do it.

    There is actually text in the Assembly Language Tools User's Guide, SPRU513E, p.196, that says the .bss section should not be split (and I'd assume this means .bss and .ebss).  It also says that if you use >> the linker will issue a warning and ignor the >>.  I've found this to be incorrect, as in my testing I was able to get the .ebss to split along object module boundaries, and I get no warning.

    Here is what I would suggest.  First, define some large dummy memory block in your .cmd file (this is fake memory, just for building your project).  Then, link your .ebss section to this memory.  That will allow you to successfully build your project, and then you can look at the .map file and find out what's going on.  You can see the contribution of each object module to the total .ebss section.  You might be able to see why the link was unable to split te .ebss and fit into the RAM blocks you specified.

    Do you have any large arrays?  If so, you can use a DATA_SECTION pragma to place them in a named section other than .ebss.  You can then link this section specifically in the .cmd file.  In effect, you are manually splitting out one or more large blocks and allocating them yourself to help the linker split the remaining pieces of the .ebss.


    Regards,

    - David

  • Hello David!

    A small remark.

    In controlSUITE there are many examples of CMD where splitting is used (mainly for F28M35/36) for .ebss section. I have used this method successfully also (for experimental goals). Compiler (6.0.1) swallows even such feints:

    RUN = RAML2|RAML3|RAML4, PAGE = 1

    Thus the issue of Will is non-trivial.

    Regards,

    Igor

  • Hello Igor,

    To be clear, I am not suggesting that .ebss section cannot be split.  What I'm saying is that there are limits to how finely the linker will split things.  It is easy to produce a simple example where there is plenty of memory to fit everything, but the linker cannot split the .ebss.

    main.c:

    volatile int x[64];
    volatile int y[64];
    void main(void) {}

    linker .cmd:

    L7SARAM_A   : origin = 0x00F000, length = 0x000060
    L7SARAM_B   : origin = 0x00F060, length = 0x000060

    .ebss         : >> L7SARAM_A | L7SARAM_B,    PAGE = 1

    The above will fail to link.  The linker will not split a section from a single object file.  In this case, the .ebss section from main.obj.  The error message is:

    "../F28335_nonBIOS_ram.cmd", line 53: error #10099-D: program will not fit into
       available memory.  run placement with alignment/blocking fails for section
       ".ebss" size 0x8a page 1.  Available memory ranges:
       L7SARAM_A    size: 0x60         unused: 0x58         max hole: 0x58
       L7SARAM_B    size: 0x60         unused: 0x60         max hole: 0x60

     

    But, if you move the declaration of y[64] to a different source file, say foo.c, the linker will split the .ebss section along object module boundaries and fit things in the specified memories.  The resulting .map file shows the split into two different .ebss sections, .ebss.1 and .ebss.2:

    .ebss.1    1    0000f000    00000048     UNINITIALIZED
                      0000f000    00000040     foo.obj (.ebss)
                      0000f040    00000004     rts2800_fpu32.lib : _lock.obj (.ebss)
                      0000f044    00000004                       : exit.obj (.ebss)

    .ebss.2    1    0000f080    00000040     UNINITIALIZED
                      0000f080    00000040     main.obj (.ebss)

     

    Regards,

    David

     

     

  • Hello David!

    I see. Many thanks. What a cunning compiler...Thus if we return to first example and we will do so: 

    volatile int x[64];
    volatile int y[64];
    void main(void) {}

    linker .cmd:

    L7SARAM_A   : origin = 0x00F000, length = 0x000064
    L7SARAM_B   : origin = 0x00F064, length = 0x000064

    .ebss         : >> L7SARAM_A | L7SARAM_B,    PAGE = 1

    then it's all right, is it not?

    Regards,

    Igor

  • Close.  Remember to think in hex.  The array sizes are 64 decimal, which is 0x40 hex, each.  So, for main.obj, the .ebss will be 0x80 words in length.  You need a memory at least this long.  The following will work:

       L7SARAM_A       : origin = 0x00F000, length = 0x000008
       L7SARAM_B       : origin = 0x00F100, length = 0x000080

    and you get the .map file:

    .ebss.1  1    0000f000    00000008     UNINITIALIZED
                    0000f000    00000004     rts2800_fpu32.lib : _lock.obj (.ebss)
                    0000f004    00000004                       : exit.obj (.ebss)

    .ebss.2  1    0000f100    00000080     UNINITIALIZED
                    0000f100    00000080     main.obj (.ebss)

     

    - David

     

     

  • Well...Of cause 0x80! And little question. What reason is for these "distortions" in controlSUITE (an example of RAM.CMD for F28M35):

    ramfuncs : >> RAMM0 | RAML0 | RAML1, PAGE = 0
    .text : >> RAMM0 | RAML0 | RAML1, PAGE = 0
    .cinit : > RAMM0 | RAML0 | RAML1, PAGE = 0
    .pinit : >> RAMM0 | RAML0 | RAML1, PAGE = 0
    .switch : >> RAMM0 | RAML0 | RAML1, PAGE = 0
    .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */

    .stack : > RAMM1 | RAML2 | RAML3, PAGE = 1
    .ebss : >> RAML2 | RAML3 | RAMM1, PAGE = 1
    .econst : >> RAMM1 | RAML2 | RAML3, PAGE = 1
    .esysmem : >> RAMM1 | RAML2 | RAML3, PAGE = 1

    IQmath : >> RAMM0 | RAML0 | RAML1, PAGE = 0

    Regards,

    Igor

     

  • Igor,

    I don't know why the ControlSuite examples are telling the linker it can split up all the sections.  Maybe whoever wrote the examples was just trying to maximize flexibility should someone start modifying the examples.  Personally, I like more precise control over what the linker is does, so I would only split a section if I had to.

    - David

  • Igor,

    Dave's suggestion to only split a section as last resource is good practice. Several of other examples for the F28035 attest that notion by taking full advantage of the pragma directives. Look at Example_F2803xCpuTimer - not a single split.

  • Well, yes. A lot of people are working on the project and each have own ideas and styles. Some time ago I could not find some function in controlSUITE because after name function  "space" was before brackets. And the sad and funny...Many thanks for the very helpful consultation.

    Regards,

    Igor 

  • Many thanks, Lenio!

    I will consider your advice certainly.

    Regards,

    Igor

  • Hi All :

    I do have a large array for table searching ,

    so  I use " #pragma DATA_SECTION( table name,"section name") " to assign the array into a bigger section as David mentioned

    and it looks OK now!

    Thanks for every suggestion there!

    Will

  • Me too faced the same problem, 

    I increased the length of Memory containing .ebss section to manifold that is required and it worked.

    Kind Regards

    Karuna Mudliyar