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.

CCSTUDIO: CCS:CCS Compiler with C++ generated a big bin file

Part Number: CCSTUDIO
Other Parts Discussed in Thread: AM2431, UNIFLASH

Tool/software:

Hello

I am using CCS Version: 11.1.0.00011 with TI Clang v1.3.0.LTS

If i add some C++ code, the bin file become over 200M.Normal is 1000k.

The code i added is like below:

static Atest  A __attribute__((section("DATA_AREA")));  (If i change this code into "static Atest  A ",generated bin file size is normal(1000K))
void Func()
{
  A.setbb();
}


class Atest
{
public:
    int aa[1];
public:
    void setbb()
    {
        aa[0] = 1;
    }
};

Func test()

{

A.setbb();

}

Linker.Cmd file is like below:

DDR_TEST1: {}ALIGN (8)> DDR

MEMORY
{
R5F_VECS : ORIGIN = 0x00000000 , LENGTH = 0x00000040
R5F_TCMA : ORIGIN = 0x00000040 , LENGTH = 0x00007FC0
R5F_TCMB0 : ORIGIN = 0x41010000 , LENGTH = 0x00008000
MSRAM_VECS : ORIGIN = 0x70000000 , LENGTH = 0x100
MSRAM_0 : ORIGIN = 0x70000100 , LENGTH = 0x1A0000 - 0x100
MSRAM_VERSION :ORIGIN = 0x701A0000 , LENGTH = 0x20
DDR : ORIGIN = 0x80000000 , LENGTH = 0xF500000

}

My question is 

I have to put var A into DDR ,How can i do that and get a normal size bin file?

  • Hello Qiao,

    Thanks for reaching out to Texas Instruments E2E support forum.

    Can you please tell which device are you using?

    Also please tell us which SDK are you using? Also please specify the version of it?

    I can see that you are using a three year old compiler. Is there a specific reason to choose this version?

    The latest version of TI ARM CLANG compiler is v3.2.2.LTS and is available on ARM-CGT-CLANG which has various bug fixes, optimization and more feature support.

    Regards,

    Tushar

  • Hello, Tushar

    i use the board ourself developed and the CPU is AM2431

    My SDK version is mcu_plus_sdk_am243x_08_03_00_18.

    The version of SDK and CCS are the requirements from my company. i cannot change it

  • Hello Qiao,

    Thanks for sharing the above information.

    I have tried to build the hello world cpp example with the above changes and not able to see the generated *.out file having size ~200M.

    The generated file has size of around ~317KB only.

    Please refer below screenshot.

    Can you please detailed steps for replicating issue at our end?

    Regards,

    Tushar

  • Thanks for your feedback.

    i have tried this in another project and  get the same result.

    by the way, i have changed main.c to main.cpp 

  • Hello Qiao,

    Can you please tell us which example have you modified?

    I can see in the screenshot above are you trying to modify the SBL example?

    In the SDK there is hello_world_cpp project which you can modify to develop project related to C++. 

    Also in the linker.cmd file what does the DDR_TEST1 section is referring to?

    Regards,

    Tushar

  • Hello Tushar

    i am trying to modify the project sbl_jtag_uniflash_am243x-evm_r5fss0-0_nortos_ti-arm-clang

    sorry for the wrong linker.cmd the right is below

    And my bin file is like below

  • Hello Qiao,

    by the way, i have changed main.c to main.cpp 

    Can you please also tell what all files have you changed in the project?

    Have you also changed the compiler flags?

    Have you enabled/disabled any optimization flag in makefile?

    Regards,

    Tushar

  • Sorry for the late reply.

    Since we changed a lot in the SDK, i tried to use the original SDK and change the code in the NULL_SBL example.

    Then i found that the image size is normal.

    So i think it's maybe related to the changes in the SDK.

    Thanks for your support.