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.

LCF Group Union Problem: 2 binaries wanted, only one generated

I'm trying to use the union/group functionality for linker command script files.  I have 3 libraries, two of them should be unionized. I'm only seeing one image created with the generated map saying only two were created.  I was interested in knowing if what I'm trying to do is possible and how to do this.  So, the union should have two groups who will occupy the same memory region in DDR2, where one image is loaded or the other, but not both. 

Thanks for any help, in advance!

MEMORY

{

FLASH_LOC_BIST (RWX) :org = 0xB0000000, len = 0x001FFFFF

FLASH_LOC (RWX) :org = 0xB0200000, len = 0x001FFFFF

APPLICATION (RWX) : org = 0xe0000000, len = 0x40000000

}

UNION

{

GROUP(RUN_IMAGE)

{

/* Initialized Sections */

.header_RUN

.RUN_const { -l=RUN.lib(.const) }

.RUN_text { -l=RUN.lib(.text) }

.RUN_c6xabi.extab { -l=RUN.lib(.c6xabi.extab) }

.RUN_c6xabi.exidx { -l=RUN.lib(.c6xabi.exidx) } END(RUN_text_end)

.RUN_fardata { -l=RUN.lib(.fardata) } START(RUN_data_start)

.RUN_rodata { -l=RUN.lib(.rodata ) } START(RUN_data_end) END(RUN_edata)

.RUN_bss { -l=RUN.lib(.bss ) } START(RUN_bss_start)

.RUN_far { -l=RUN.lib(.far ) } END(RUN_bss_end)

} > FLASH_LOC // load addr

GROUP(BIST_IMAGE)

{

/* Initialized Sections */

.header_BIST

.BIST_const { -l=BIST.lib(.const) }

.BIST_text { -l=BIST.lib(.text) }

.BIST_c6xabi.extab { -l=BIST.lib(.c6xabi.extab) }

.BIST_c6xabi.exidx { -l=BIST.lib(.c6xabi.exidx) } END (BIST_text_end)

.BIST_fardata { -l=BIST.lib(.fardata) } START(BIST)

.BIST_rodata { -l=BIST.lib(.rodata ) } START(BIST_data_end) END(BIST_edata)

.BIST_bss { -l=BIST.lib(.bss ) } START(BIST_bss_start)

.BIST_far { -l=BIST.lib(.far ) } END(BIST_bss_end)

} > FLASH_LOC_BIST  // load addr

} > APPLICATION   // run addr

// roms file to demonstrate creating 3 images needed (not a syntactically superior example)

ROMS

{

BIST: origin = 0xb0000000, len=0x01000000

RUN: origin = 0xB0200000, len=0x01000000

OTHER: origin = 0xe0000000, len=0x01000000

}

 

 

  • The linker can only create one output file.  The purpose of a UNION is to arrange for multiple output sections or GROUPs to have different load addresses but the same run address.  Please see the section titled Using GROUP and UNION Statements in the C6000 assembly tools manual.

    While I'm not sure it discusses the same problem, this forum thread appears helpful.

    Thanks and regards,

    -George

  • George,

         Its interesting you posted the forum thread link above;  I was able to solve Mike's problem for a multi-stage boot, where the low image is my "core" and the high image is my application that depends on core components.  When I use the term "Image" or "Output", I'm referring to the Flash/Binary image created by the hex6x tool.  I do not want to split the coff, or elf, formatted output file.

    To solve Mike's problem, if he were using flash images as his terminology for "output", I use a group for the high components  and one for the low.   I was able to generate two Flash binaries as long as both high and low are allocated to different memory regions in the linker command file...which I believe it is what Mike wanted to accomplish.   You also have to ensure the ROMS spec file has two regions, which is fed to the hex6x tool to provide the information it needs to generate a b00 and b10 file. 

    Steps

    1.  Create a Project that Holds "Low"s source code, and include high.lib which holds his other components he wants to load for his "high" components.   The linker command file and ROMS spec must be specific here;  The ROMS spec should state   Low's region and High's region to get the two generated binaries. 

    2.  At runtime/Boot time, in low execution, at whatever discrete point you choose, load the high image into DDR memory. 

    3.   Call a function off of high's library.  This should work and does for me.

     

    My problem is in step #1, I have the same situation but two libraries.  Each library needs to be loaded to the same address in DDR2, based upon some discrete message at runtime.  If you get a 0, load High. If you get a 1, load some other Application.  

    The union feature allows you to have a component's load address be different, but run address be the same.  Then, I have to ask...if I have two different load addresses, why couldn't I generate two different outputted binaries using hex6x?   I think this would solve the problem where I would like dynamic loading, but not have to have TI specific calls in my code. 

    Thanks for your replies.  I will verify your answer.

    -S

  • George,

         Also, is there an easy way to have multiple links during a single build?  If the user wanted to generate three separate images with groups, would it require three projects?  How can I be sure the core, low and high applications have pointers setup to each other correctly in multiple (different) builds? 

    -S