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.

How do I switch off aligment/blocking compiler option in CCS5.2?

Other Parts Discussed in Thread: TMS320F28335

Hello!

I have faced a strange problem with my project that was ported to CCS 5.2 from CCS 3.3. In CCS 3.3 everything was good and the problem didn't show up.

Here is memory area definition in my .cmd file:

MEMORY
{
     ...

     PAGE 1:
    TEST_MEM: origin = 0x200000, length = 0x101
     ...
}


And here is section definition in .cmd file

SECTIONS
{
     ...
 
     test_mem :> TEST_MEM, PAGE = 1
     ...

}


Then I defined 2 variables in .c file and placed them into a section test_mem:

     unsigned int var1=0;
     int var2[0x100];

     #pragma DATA_SECTION(var1,"test_mem")
     #pragma DATA_SECTION(var2,"test_mem")

Variables var1 and var2 are the only variables in this memory area. I am getting a compilation error:"error #10099-D: program will not fit into available memory. run placement with aligment/blocking fails for section "test_mem" size 0x140 page 1"

I can't understand why is the size of test_mem section 0x140? There are only two variables: var1 - 1 word and var2 - 0x100 words(0x1+0x100=0x101 but not 0x140). And the second question is how can I switch off this compiler option "aligment/blocking" for I think the problem is in this option?

In CCS 3.3 this code was compiled without errors and in .map file I saw such a memory allocation:

     00200000   _var1
     00200001   _var2

I'm using TMS320F28335 controller if this matters.

  • Thanks, George. But the only useful thing I've got from this article is -md option. This option has been turned off in CCS 3.3 and is turned off now too. In CCS 3.3 I was using code generation tools v.5.1.4. and now in CCS 5.2 I use code generation tools v.6.1.0. Can you tell me if the option -md was "on" by default in cgt v.5.1.4.? Because in CCS 3.3 I didn't have this problem with compilation.

  • Sergey Sh said:
    Can you tell me if the option -md was "on" by default in cgt v.5.1.4.?

    The -md option has never been on by default.

    Check the project build settings for both CCS 3.3 and CCS 5.2.  I suspect the difference is there.

    Thanks and regards,

    -George

  • I've checked all the settings and they are the same. George, maybe you know which setting does exactly influence on memory allocation?

    Thanks in advance.

  • Please use the CCS forum for CCS questions next time. Sorry for the note, but it will simpler for others to find such posts in the future when they are looking for help. :)

  • But my question was moved here exactly from CCS forum. ))

  • Sergey Sh said:

    In CCS 3.3 this code was compiled without errors and in .map file I saw such a memory allocation:

         00200000   _var1
         00200001   _var2

    I am unable to reproduce this result.  I always get a total size of 0x140 for the section test_mem.  Exactly which compiler version and build options give you a size of 0x101?

    Thanks and regards,

    -George

  • George, I'm sorry for aswering so long and for confusing question. The thing is that there is a bug in compiler version 5.1.4. The bug is that when the size of the array is less than 0x8000 words, it is aligned according to the page boundary and I get a gap between the variable and array and when the size is more than 0x8000 word the array is not aligned. But in compiler v.6.1.0 this bug, I think, was fixed and despite the size of array now I get a gap between the variable and array. That's why you were unable to repeat my result. So I've solved the problem by integrating variable and array in a structure. I've inserted a test project for CCS3.3 so you can try to switch the compiler version and see the result in .map file. Thanks for answers!

    test_prj.rar
  • Another solution to consider ... Do not put the variables in an artificial structure.  Instead, define them in hand-coded assembly.  Accesses to those variables, and no others, will require extra loads of the DP register, but that is unlikely to matter much.

    Thanks and regards,

    -George