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.

Placing a memory section right behind .resetVecs

Hi,

I am trying to use binpack.exe application from TivaWare with a *.bin file generated from TI-RTOS based project. Binpack.exe requires its input file to have a special 8 word header placed right after the interrupt vector table.

How can I achieve that with TI-RTOS? 

I have defined a table and a memory section :

#pragma DATA_SECTION(g_infoHeader, ".infoheader")
uint32_t const g_infoHeader[] =
{
    0xFF01FF02,
    0xFF03FF04,
    0xFFFFFFFF,
    0xFFFFFFFF,
    0xFFFFFFFF,
    0xFFFFFFFF,
    0xFFFFFFFF,
    0xFFFFFFFF
};

But I cannot find a way to place it (the .infoheader section) right after the .resetVecs section in the compilation output file.

I will greatly appreciate any help.

Thank you,

Peter A.

  • Peter,

    I think there are a few ways to do this.  This worked for me...

    In the linker command file add .infoheader to the SECTIONS specification, after the .intvecs entry, specifying the load address.  I picked 0x40 after first looking at the map file, and seeing .resetVecs ended at 0x3c.

    SECTIONS
    {
        .intvecs:   > 0x00000000
        .infoheader: > 0x40
        .text   :   > FLASH
    ...

    And above that somewhere, add a retain command to be sure the structure is not eliminated if not explicitly referenced in your program:

    --retain=g_infoHeader

    Then re-link the program:

    SEGMENT ALLOCATION MAP

    run origin  load origin   length   init length attrs members
    ----------  ----------- ---------- ----------- ----- -------
    00000000    00000000    00007eb0   00007eb0    r-x
      00000000    00000000    0000003c   0000003c    r-- .resetVecs
      00000040    00000040    00000020   00000020    r-- .infoheader
      00000060    00000060    00005a52   00005a52    r-x .text
      00005ab4    00005ab4    00002038   00002038    r-- .const

    There is likely a more elegant way to do this, but hopefully this works for you...

    Regards,
    Scott

  • Hi Scott,

    Thank you for your response. It works perfectly.

    I have been looking for a way to automate this solution a little but did not have any luck.

    I was trying to do something like that:

    SECTIONS

    {

       .intvecs:   > 0x00000000

       .infoheader: > 0x00000000 + SIZE(.resetVecs)

       .text   :   > FLASH

    ...

    So that I do not have to manually specify a new address for .infoheader every time resetVecs' size changes.

    Do you know how something like that could be achieved?

    Thank you,

    Peter A.

  • Hi Peter,

    OK, I understand you want to adjust for different sizes of .resetVecs.  I’d assumed this would be fixed for you.

    I tried a few different things with no success.  I think to get you the best answer this question should be posted on the compiler forum: e2e.ti.com/.../

    Or, I can ask that this thread be moved, your choice…

    Thanks,
    Scott

  • Hi Scott,
    I worked on that a little bit more and still did not find a way.
    I think that this thread fits better here - on the TI-RTOS forum.
    I will create another one on the compiler forum.

    Thank you for your help,
    Peter A.