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.

Help needed for CCS3.1 compilation error - can't allocate memory



Hi, there,

I am a newbie for DSP programming and need help for a compilation problem. I am using CCS3.1 and F2806. In my project, some variables are declared in the VariablesEEPROM.c file. When compiling the project, the following error occurs. What I could not understand is the memory used for the variables are only 0x64 while there are 0x79 memory availabe.  Could any of you help me to figure out where the problem is?  Thanks.

>>   error: can't allocate EEPROM_Shadow, size 00000064 (page 1) in EEPROMSHADOW

            (avail: 00000079)

>>   error: errors in input - AAGDSPV9_20.out not built

MEMORY

{

PAGE 1:   /* Data Space */

M0SARAM : origin = 0x000002, length = 0x00037E

EEPROMSTAMP : origin = 0x000380, length = 0x000001

EEPROMSHADOW : origin = 0x000381, length = 0x000079

}
SECTIONS
{
EEPROM_Shadow > EEPROMSHADOW PAGE = 1
{
VariablesEEPROM.obj (.ebss)
}
}

 

  • All uninitialized sections created by the compiler are "blocked", and when a section is blocked the linker needs to place it either within a page or at a page boundary. Blocking ensures that each variable is fully contained in a page if it is smaller than the page size. If the variable is bigger than the page size, blocking guarantees that it starts at the page boundary. The compiler does this because it uses this information to optimize the DP load. For example, compiler can safely load DP for a defined array once and access all its elements (or the first 64-bytes) without reloading DP. If blocking is not enabled the compiler has to load DP for accessing each element leading to much more inefficiencies.

    In your example, it is trying to allocate EEPROM_Shadow starting at a page boundary, but since the memory region starts at 0x381, it would need to allocate it to the next page boundary, and when doing so, there is not enough space left in EEPROMSHADOW to fit the section.

    If you change the memory config to have EEPROMSHADOW to begin at 0x380, it should allocate it fine.

    More details on "blocking" can be found in C28x Assembly Language Tools Users Guide, SPRU513.

     

  • Thanks. It does solve the problem.