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 file

Hi,

if we have a block of memory, say uint32_t, that want to directly dump into the object file at a particular section "name1", given it name "name2", specify length in bytes "len3", is there any TI utility to do that, so later we can directly refer and link to that data in other functions (via linker)? I am trying to bypass assembler and somehow directly put into the object file.

gnu has a objcopy utility, but not sure if it is compatible with TI eabi format, and whether it is designed to do that the above. And for non-arm devices like C2000, gnu tools could not work. Is there specific TI tools to do that?

Dave

  • Dave Smith62 said:
    if we have a block of memory, say uint32_t, that want to directly dump into the object file at a particular section "name1", given it name "name2", specify length in bytes "len3", is there any TI utility to do that, so later we can directly refer and link to that data in other functions (via linker)? I am trying to bypass assembler and somehow directly put into the object file.

    Unfortunately, the linker does not support a method for doing that.

    Dave Smith62 said:
    gnu has a objcopy utility, but not sure if it is compatible with TI eabi format,

    It is.

    Dave Smith62 said:
    and whether it is designed to do that the above.

    It isn't.

    Dave Smith62 said:
    And for non-arm devices like C2000, gnu tools could not work. Is there specific TI tools to do that?

    You can create a binary file from any TI executable with the utility tiobj2bin from the cg_xml tools.  However, the output of this tool cannot be an input to the linker, so it is not a solution to your problem.

    Thanks and regards,

    -George

  • I don't understand how tiobj2bin is used for, could you give some example? There is no document.

    And for what you remarked "It isn't.", can we first declare C arrays of such "len1" of bytes, and by default initialization they are empty, using it as a placeholder only; then we use gnu objcopy to put data of same length into "len1" area, like we are rewriting its contents, but never touch its symbol. Can that be done?

  • Dave Smith62 said:
    I don't understand how tiobj2bin is used for, could you give some example? There is no document.

    It is a Windows batch file, or equivalent Linux shell script, you run from the command line.  If you run it with no arguments, it dumps out a one-line help summary.  You can also view it in your favorite text editor.  It starts with a block comment which discusses usage.

    Dave Smith62 said:
    And for what you remarked "It isn't.", can we first declare C arrays of such "len1" of bytes, and by default initialization they are empty, using it as a placeholder only; then we use gnu objcopy to put data of same length into "len1" area, like we are rewriting its contents, but never touch its symbol. Can that be done?

    In short, no.  There is no feature of the linker, or any other standalone utility, which supports this approach.

    Thanks and regards,

    -George