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/TMS320F28388S: generate bin file too large

Part Number: TMS320F28388S

Tool/software: TI C/C++ Compiler

Hi Expert,

My customer generate bin file that up to 600M bytes , which is too large to use, the bin file include the info of initialization RAM value, which are the reason that lead to so big size, is there any way to remove the RAM info in bin file as these are never used to reduce size of the bin file ?

Below are the code that customer post, any suggestion for the issue?

https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/81/f2838x_5F00_cpu1_5F00_app_5F00_demo.7z

  • The MSGRAM_CPU_TO_CM_RT section is already set as NOINIT in the linker command file, but the C2000 Hex Utility doesn't seem to pick that up by default.

    If you explicitly add the following to the C2000 Hex Utility, then the MSGRAM_CPU_TO_CM_RT section is excluded from the output:

    --exclude=MSGRAM_CPU_TO_CM_RT

  • When I build the project, a bin file is not generated.  So, I'm not certain my proposed solution solves the problem.  But I am confident enough to suggest it.

    In the C source file f2838x_cpu1_allocate_ecat_to_cm.c, change the first line in this code ...

    uint32_t IPC_RAM_C28[64] = {0};
    #pragma DATA_SECTION(IPC_RAM_C28,"MSGRAM_CPU_TO_CM_RT")
    

    ... to ...

    uint32_t IPC_RAM_C28[64];
    #pragma DATA_SECTION(IPC_RAM_C28,"MSGRAM_CPU_TO_CM_RT")
    

    Notice how the array IPC_RAM_C28 is not initialized.  

    The linker command file contains this related line ...

       MSGRAM_CM_TO_CPU_RT : > CMTOCPURAM_RT, type=NOINIT

    Because the array IPC_RAM_C28 is the only variable in that input section, this line effectively allocates it.  As currently defined, the array IPC_RAM_C28 is initialized, and thus cannot be placed in an output section with the special property type=NOINIT.  That combination is not supported.   I suspect you do not intend for for this array to be initialized.  By removing the = {0}, it is no longer initialized.

    For another example of the problems that result from combining an initialized variable with a section that is NOINIT, please see this forum thread.

    Uninitialized sections are ignored when creating a bin file, which is probably what you intend for the section which contains the array IPC_RAM_C28.

    Strong ZHANG said:
    My customer generate bin file that up to 600M bytes

    When the array IPC_RAM_C28 is mistakenly initialized, this effectively creates one initialized section that, in memory, is a long distance away from all the other initialized sections.  The only way a bin file represents a gap in memory, regardless of size, is by filling it with 0.  One side effect is that the bin file can be very large.

    Thanks and regards,

    -George