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