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.

CCS v5.5 C2000 How to configure the .bin

Hi,

I have some problems with generating my .bin file. I use the follwing commandos in the post build step and they are working.

"${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd2000" "${CG_TOOL_ROOT}/bin/hex2000" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"

The problem is, the commands generate a huge file with all section in it.

How can I modify the post-build, that it generates a .bin with ist origin an 0x610010 and a legth of 0x1FFF0. Or only what is in my SECTIONS.

Best Regards Dr. Lunz

  • Please see this introduction to linker command files for some necessary background.  Pay particular attention to this part about which sections are initialized or uninitialized.

    That long tiobj2bin command puts all the initialized sections in the newly created .bin file.  Uninitialized sections at the beginning, or at the end, are skipped.  But what about any uninitialized sections that occur between initialized sections?  Or what about any holes in memory between initialized section?  Both those cases are handled the same way: tiobj2bin file fills that corresponding memory range with 0.  In your case, there is probably a combination of uninitialized sections and holes that get filled with 0.  As you have seen, this can result in a huge .bin file.  

    Change your linker command file so your initialized sections are all allocated next to each other.

    Thanks and regards,

    -George

  • I had tp put TYPE = NOLOAD to the line:

    FPUmathTables : > FPUTABLES, PAGE = 0

    and now it ist 23KB and not 1.900KB.

    But I thought without the NOLOAD, the Tables are in SRAM and faster. is there a alternative now?
  • Please see this wiki article for an explanation of NOLOAD and other similar special linker section types.  In your case, it makes sense to use NOLOAD if you are modeling some part of system memory that is always present.  A table of constants burned into ROM would be one example.  

    Thanks and regards,

    -George

  • I understand the NOLOAD. But I Need the functions as fast as possible.
    I use:

    ramfuncs : LOAD = FLASHG,
    RUN = RAML0,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    PAGE = 0

    With a Pragma to put my funktions into RAM. But how to put the FPU funktions in Addition into it?
  • Hi ,

    If you are looking to put the FPUTABLES in RAM, you would do something identical to the ramfuncs section. In the linker command file:

    FPUmathTables : LOAD = FLASHG,
    RUN = RAML3,
    LOAD_START(_FPUmathTablesLoadStart),
    LOAD_SIZE(_FPUmathTablesLoadSize),
    RUN_START(_FPUmathTablesRunStart),
    PAGE = 0

    In a .c file, you need to define the linker variables

    extern uint32_t FPUmathTablesLoadStart, FPUmathTablesLoadSize, FPUmathTablesRunStart;

    Then you can memcpy this section at runtime (please lookup the correct argument type and list for memcpy, shown below may not be exactly correct)

    memcpy(&FPUmathTablesRunStart, &FPUmathTablesLoadStart, &FPUmathTablesLoadSize);