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.

TM4C1294NCPDT: Binary file issue

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: TM4C1294KCPDT, EK-TM4C1294XL

HI,

 I am using TCP ECHO Example (TI -RTOS) and modified it for client connection also added adc data to send over ethernet, this works fine. But when I want to test on stand alone (custom pcb)  system I need to load binary file into mcu, when I generates binary file its size is over 512MB and is too large. I also generated HEX file and load it, but MCU does not execute it. MCU works perfectly only in debug mode. so  request you to help for proper binary file generation 

TI-RTOS version  2.16.0.14

GNU Compiler version 7.2.1 Linaro

CCS  Version 9.1

tcpEcho_EK_TM4C1294XL_GNU.zip

I am attaching my entire project

Please Help

Regards

Khodidas

  • R & D said:
    MCU works perfectly only in debug mode.

    The reason for that is that the project has semi-hosting support enabled. See GNU examples for EK-TM4C123GXL fail to start unless debugger connected for host to disable semi-hosting.

  • The problem is the sections .stack and .vtable are initialized sections, and not uninitialized.  Further, these initialized sections are allocated in SRAM, at an address that is very far away from all the other initialized sections in FLASH.  As described in this forum post, any hole in a binary file between initialized sections must be filled with 0.  That's why the bin file is so large.

    So, the question reduces down to: Why are the sections .stack and .vtable initialized?  I can explain why they are initialized.  I cannot tell you how to fix it.

    Both of these sections are created in the C file tcpEcho_pm4fg.c. This C file is automatically generated.  The line which creates the .stack section is ...

    xdc_UChar ti_platforms_tiva_stack[2048] __attribute__ ((aligned(8), section (".stack")));
    

    This code causes the GCC ARM compiler to generate an initialized section named .stack.  By contrast, the TI ARM compiler creates an uninitialized section for this same code. 

    The same thing happens with the section .vtable, for the same reasons.

    I am unsure of how to fix this problem.  I will notify other experts about this thread.

    Thanks and regards,

    -George

  • George Mock said:
    The same thing happens with the section .vtable, for the same reasons.

    I think TI RTOS examples for GCC compiler generates 512MB bin file explains the issue for the .vtable section and a work-around. I haven't tried the work-around yet.

  • I made changes to:

    1. Allow to work without the debugger attached.

    a. In tcpEcho.cfg comment out SemiHostSupport:

    if (Program.build.target.$name.match(/gnu/)) {
    // Disabled to allow to work without the debugger connected
    //    var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
    }

    b. In the CCS Project Properties CCS Build -> GNU Linker -> Libraries -> Libraries use "nosys" instead of the "rdimon" library.

    2. To reduce the size of the bin file in tm4c1294kcpdt.lds add (NOLOAD) to the .vtable and .stack sections.

    Changed from:

        .vtable (_vtable_base_address) : AT (_vtable_base_address) {
            KEEP (*(.vtable))
        } > REGION_DATA
        .stack : ALIGN(0x8) {
            _stack = .;
            __stack = .;
            KEEP(*(.stack))
        } > REGION_STACK

    To:

        .vtable (_vtable_base_address) (NOLOAD) : AT (_vtable_base_address) {
            KEEP (*(.vtable))
        } > REGION_DATA
        .stack (NOLOAD) : ALIGN(0x8) {
            _stack = .;
            __stack = .;
            KEEP(*(.stack))
        } > REGION_STACK

    The size of the tcpEcho_EK_TM4C1294XL_GNU.bin file reduced from 536,946,000 to 151,352 bytes.

    I programmed the modified project into a EK-TM4C1294XL  and checked that the Ethernet interface was responding after resetting the board, in that acquired and IP address and responded to pings.

    The modified project is attached. 7382.tcpEcho_EK_TM4C1294XL_GNU.zip

  • Hi Chester,

      Thank you so much for chiming in with the fixes. 

  • Thank you for Generated Project , it works fine, but by loading  *.out file from ccs, but flashing *.bin file gives error Cannot read property 'DS' of undefined.

    Any way my purpose is solved.

    Regards

    Khodidas