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.

Binary program file size bloated after CCS update

I just completed an automatic update of CCS (which I probably should not have done).

My current version is: 5.3.0.00090

and compiler is: 5.0.1

And the firmware is running on BeagleBone, booting from SD-card using StarterWare bootloader.

Unfortunately the size of my *_ti.bin file went from approximately 300 KB to +5 MB

Am i missing something, or is this expected behavior? Unfortunately the boot-up time for my device is now more than 10 sec, it was less than 1 sec before.

Hopefully there is optimization setting I am missing?

Any help on this would be welcome. Don't know what else to post here, but if anyone has experienced this problem before, I will gladly post any file/code/setting required to localize the problem.

Thanks
Bogi

  • It would be good to compare the linker map file from both projects.  Please post them.

    Thanks and regards,

    -George

  • Hi George

    It seems that I solved the problem without locating the issue. There were project setting variables all over the place referencing the old libraries, compiler and Starterware.

    I will no longer use automatic updates, but will do parallell installs of newer versions, and verify all updates before porting. I lost a lot of time porting to the new version of CCS, compiler and Starterware.

    PS. The linker command file was the same for both projects.

    Thanks
    Bogi

  • Hi George

    I have found the true cause of the bloated binary file, but not a solution however.

    I am only using static memory allocation in my embedded program, mainly to avoid memory leaks. I have declared a 10 MB buffer for receieving and transmitting files to/from sd-card over the network. It seems that the binary file more or less follows the size of this array. If i declare it to be 5 MB smaller, than the binary (_ti.bin) file is also 5 MB smaller.

    Is this expected behaviour? Unfortunately I don't have the linker map file from the previous build, but I have attached the current map file. 6378.enetEcho.zip

  • Bogi Magnussen said:
    Is this expected behaviour?

    Yes.

    This can be fixed.  You need to do two things.  1) Put the 10 MB buffer at the start of memory 2) Ignore the buffer when creating the .bin file

    For #1 ... See this post.  What it does with .text, you need to do with the .bss section from update.obj (which defines the 10 MB buffer).

    For #2 ... See this thread.  The solution there was to use arm-elf-objcopy from the ARM GNU toolset.

    Thanks and regards,

    -George

  • Thanks for your reply, it did the trick, now the binary size is around 200k, much more realistic. I tested it in debug mode with the blackhawk debugger and everything works fine. However, i cant get it to work with the starterware bootload (MLO), I suspect it is becuase the bootloader does not know that i put my buffer in front off the actual code?

    Here is my modified linker file:

    -stack  0x0008                             /* SOFTWARE STACK SIZE           */
    -heap   0x2000                             /* HEAP AREA SIZE                */
    -e Entry
    /* Since we used 'Entry' as the entry-point symbol the compiler issues a    */
    /* warning (#10063-D: entry-point symbol other than "_c_int00" specified:   */
    /* "Entry"). The CCS Version (5.1.0.08000) stops building from command      */
    /* line when there is a warning. So this warning is suppressed with the     */
    /* below flag. */

    --diag_suppress=10063


    -l C:/ti/AM335X_StarterWare_02_00_00_07/binary/armv7a/cgt_ccs/am335x/drivers/drivers.lib
    -l C:/ti/AM335X_StarterWare_02_00_00_07/binary/armv7a/cgt_ccs/am335x/system_config/system.lib
    -l C:/ti/AM335X_StarterWare_02_00_00_07/binary/armv7a/cgt_ccs/am335x/beaglebone/platform/platform.lib
    -l C:/ti/AM335X_StarterWare_02_00_00_07/binary/armv7a/cgt_ccs/utils/utils.lib
    -l C:/ti/AM335X_StarterWare_02_00_00_07/binary/armv7a/cgt_ccs/mmcsdlib/libmmcsd.lib



    /* SPECIFY THE SYSTEM MEMORY MAP */

    MEMORY
    {
            DDR_MEM        : org = 0x80000000  len = 0x7FFFFFF           /* RAM */
    }

    /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

    SECTIONS
    {
        GROUP
        {

        .bss:
         {
             update.obj (.bss)
             *(.bss)
         }

         RUN_START(bss_start)
         RUN_END(bss_end)

        }load>DDR_MEM

         .init    :
         {
            system.lib<init.obj> (.text)
        }load>DDR_MEM

        .text    : load > DDR_MEM              /* CODE                          */
        .data    : load > DDR_MEM              /* INITIALIZED GLOBAL AND STATIC VARIABLES */
        .const   : load > DDR_MEM              /* GLOBAL CONSTANTS              */
        .stack   : load > 0x87FFFFF0           /* SOFTWARE SYSTEM STACK         */
        .sysmem  : load  > DDR_MEM

    }

  • The last part of this issue is now solved. The problem was that the init code of my application was not located at the DDR start address, as required by the bootloader.

    Here are the modifications. I followed your advice from another post and moved .bss to the end of memory.

    /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
    SECTIONS
    {
        .init    :
         {
            system.lib<init.obj> (.text)
            *(.text)
        }load>DDR_MEM

        .data    : load > DDR_MEM              /* INITIALIZED GLOBAL AND STATIC VARIABLES */
        .const   : load > DDR_MEM              /* GLOBAL CONSTANTS              */
        .stack   : load > DDR_MEM           /* SOFTWARE SYSTEM STACK         */
        .sysmem  : load  > DDR_MEM
        .bss > DDR_MEM (HIGH)
         RUN_START(bss_start)
         RUN_END(bss_end)
    }