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.

large array for 28335

I have defined a large array:

struct data_struc
{
    float x0, x1, x2, x3, x4, x5, x6;
} data_array[1000];

----------------------------------------------------

The linker issues an error message:

"../28335_RAM_lnk.cmd", line 131: error: run placement fails for object

   ".ebss", size 0x3a1b (page 1).  Available ranges:
   RAML4        size: 0x1000       unused: 0xe1d        max hole: 0xe18
   RAML5        size: 0x1000       unused: 0x1000       max hole: 0x1000
   RAML6        size: 0x1000       unused: 0x1000       max hole: 0x1000   

----------------------------------------------------

Line 131 of  my "28335_RAM_lnk.cmd" is:

   .ebss            : >> RAML4|RAML5|RAML6,     PAGE = 1

This should be enough for the array (size is 14000 / 0x36B0 words).

----------------------------------------------------

In my map file I see that RAML5 and RAML6 is not even used:

  RAML4                 0000c000   00001000  000001e3  00000e1d  RWIX
  RAML5                 0000d000   00001000  00000000  00001000  RWIX
  RAML6                 0000e000   00001000  00000000  00001000  RWIX

So it seems the linker wants to stuff the whole array into RAML4 which is obviously too small.

Thanks

Dina

  • PS

    I see 1000 elements use more space than available in the sections. But the same happens, when I reduce the number of elements to 500. So this should definitely be not too big.

  • if u want to have big array, u have to use external SRAM.

  • dina somaya said:

    I have defined a large array:

    struct data_struc
    {
        float x0, x1, x2, x3, x4, x5, x6;
    } data_array[1000];

    ----------------------------------------------------

    The linker issues an error message:

    "../28335_RAM_lnk.cmd", line 131: error: run placement fails for object

       ".ebss", size 0x3a1b (page 1).  Available ranges:
       RAML4        size: 0x1000       unused: 0xe1d        max hole: 0xe18
       RAML5        size: 0x1000       unused: 0x1000       max hole: 0x1000
       RAML6        size: 0x1000       unused: 0x1000       max hole: 0x1000   

    ----------------------------------------------------

    Line 131 of  my "28335_RAM_lnk.cmd" is:

       .ebss            : >> RAML4|RAML5|RAML6,     PAGE = 1

    This should be enough for the array (size is 14000 / 0x36B0 words).

    As you eluded to in your second message, 1000 * 14 is too large for your 0x3000 word space.  However 500 should not be.  One thing that is cluttering how you see it is that other .ebss data is there as well.  I suggest, since this array is huge, you make your own data section for it.

    i.e.

    #pragma DATA_SECTION(data_array, "hugearray")

    and in your linker

    hugearray : > RAML4|RAML5|RAML6, PAGE = 1

    This will tell you the exact number of words that need to be placed.

    Another thing you might want to try is instead of using | symbols, compressing the 3 RAM zones into 1

    i.e. instead of

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

    use

    RAML4L6 : origin = 0x00C000, length = 0x003000

    and

    hugearray : > RAML4L6, PAGE = 1

    Both methods should work though.

    In my map file I see that RAML5 and RAML6 is not even used:

      RAML4                 0000c000   00001000  000001e3  00000e1d  RWIX
      RAML5                 0000d000   00001000  00000000  00001000  RWIX
      RAML6                 0000e000   00001000  00000000  00001000  RWIX

    So it seems the linker wants to stuff the whole array into RAML4 which is obviously too small.

    Thanks

    Dina

    The map file is like this because your array has not been allocated at all.  If a linker error happens, it is not placed in the map file and will not show up.  What is showing is the rest of your data, excluding your array.

    Hopefully some of this helps,

    Tim

     

  • Thank you, Tim

    The second method worked. I used .ebss instead of hugearray, so no #pragma is needed:

      .ebss            : > RAML4L6,   PAGE = 1

    and I had to replace

       DMARAML4         : > RAML4,     PAGE = 1
       DMARAML5         : > RAML5,     PAGE = 1
       DMARAML6         : > RAML6,     PAGE = 1

    by

       DMARAML4L6       : > RAML4L6,   PAGE = 1

    I still don't understand, why concatenation of sections RAML4,5,6 doesn't work, since I used this method with the .text-section:

       .text            : >> RAML0|RAML1|RAML2|RAML3,     PAGE = 0

    Dina