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.

Compiler/TMS320F28377S: Linker RAM space allocation si not preforming

Part Number: TMS320F28377S

Tool/software: TI C/C++ Compiler

Hello

I compare the difference between the compile v18.12.5.LT and v20.2.0LTS.

Then, I seen some problemon memory allocation in both case, but the last version was not better.

I have 4 variable (Buffer). There are all the same size (64 word):

uint16_t  aPdOutputData[(0x0080 >> 1)];
uint16_t  aPdInputData[(x0080 >> 1)];
UINT16 aiPdRdBuffer[ ( ( ( 32 * 4 ) + 1 ) >> 1 ) ];
pir_Ds402CmdUnionType uDs402Cmd;


typedef union pir_Ds402CmdUnionType
{
   UINT16                           aiData[ ( ( ( 32* 4) + 1 ) >> 1 ) ];
   pir_Ds402VelocityCmdType         sVelocityCmd;
   pir_Ds402VelocityEncoderCmdType  sVelocityEncoderCmd;
   pir_Ds402PositionCmdType         sPositionCmd;
}

typedef struct pir_Ds402VelocityCmdType
{
   SINT32 lParam60FF_0;    /* Velocity */
   UINT16 iParam6040_0;    /* Control  */
}
typedef pir_Ds402VelocityCmdType pir_Ds402VelocityEncoderCmdType;

typedef struct pir_Ds402PositionCmdType
{
   SINT32 lParam607A_0;                /* Target Position */
   UINT32 lParam6081_0;                /* Profile Velocity */
   UINT32 lParam6083_0;                /* Profile Acceleration */
   UINT32 lParam6084_0;                /* Profile Deacceleration */
   UINT32 lParam6099_1;                /* Homing Speed during search for switch */
   UINT32 lParam6099_2;                /* Homing Speed during search for zero */
   UINT32 lParam609A_0;                /* Homing Acceleration */
   UINT16 iParam6040_0;                /* Control  */
   UINT16 iParam607E_0_iParam6060_0;   /* Polarity & Modes of operation */
}

Then, bellow find the map file generated for both compiler version:

18.12.5.LTS
00018880     622 (00018880)     _aPdInputData (0x40 Word)
000188c0     623 (000188c0)     _aPdOutputData (0x40 Word)
00018900     624 (00018900)     _aiPdRdBuffer (0x40 Word)
00018980     626 (00018980)     _uDs402Cmd (0x40 Word)
000189c0     627 (000189c0)     _CT_AutoTuning_InveretdPhase


20.2.0.LTS
00018880     622 (00018880)     _aPdInputData (0x40 Word)
000188c0     623 (000188c0)     _aPdOutputData (0x40 Word)
00018900     624 (00018900)     _aiPdRdBuffer (0x40 Word)
000189c0     627 (000189c0)     _uDs402Cmd (0x40 Word)
00018a00     628 (00018a00)     _CT_AutoTuning_InveretdPhase

All buffer have a size of 0x40 word. But the linker alllcoate more for some variable.

In 18.12.5, look at the space between aiPdRdBuffer and uDs402Cmd: 0x80 word. Then we lost 0x40 Words!

In 20.2.0, look at the space between aiPdRdBuffer and uDs402Cmd: 0xC0 word. Then we lost 0x80 Words!

What could be the reason of that? Is ther some compiler/linker option to resolve that? I not think it is allignement problem because 0x40 is always alligned.

Thank

  • Since this is a linker problem, I normally need the entire CCS project in order to reproduce it.  However, in this specific case, it might be possible to reproduce the problem with less. So, let's try that and see.

    I need a two things in addition to what you have above.  Please show, by copy-n-paste of the text, all the compiler build options.  Attach the linker command file to your next post.  So the forum will accept it, please add the file extension .txt.

    Thanks and regards,

    -George

  • Hello

    In fact I made a mistake, The free space betwwen the indicated variables is fill by other variable.

    I just need to check the good section into .map file.

    THen, When I get the good section, space is well filed.

    Then I not explain the difference of RAM size between compiler v18.12.5 and 20.2.0.

    The I compare the .ebss section into .map file for this 2 compiler because the v20.2.0 get 67 word in more..

    Then I seen some variable are added:

      00018980    00000040     rts2800_fpu32.lib : signal.c.obj (.ebss:_sigTable)

    000191a8    00000003     rts2800_fpu32.lib : ti_fenv.c.obj (.ebss)

    0x40 + 3 = 0x43 = 67 Words..

    Then I found the added variables!.

    Like the fpu library is into the compiler space, this is a need of new compiler version.