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.

Merging multiple images (.out files) into a single image (.out file)

Other Parts Discussed in Thread: TMS320F28335

Hello everyone,

I am searching for a way to merge the two image files, a.out and b.out, into a single image file final.out to ease the flash process of the TMS320F28335.

If anyone could give me a hint or point me in the right direction that would be great.

Regards

douncon

  • Please have a look at this article. 

    http://processors.wiki.ti.com/index.php/Combining_executable_files

    Support for this process is in the hex2000 tool delivered as part of the 6.0 C2000 compiler. The tool should work with files created by older versions of the compiler.

  • When using hex2000.exe how is it possible to actually create a new  TI COFF (*.out) file?

  • Yes. The output of the hex utility when using the --load_image option will be an object file whose format is determined by the input files. For C2000 this will always be TI-COFF.

  • I have read this line and have tried but the result is not recognised by my coff reader.

    douncon

  • Can you provide more details? Is the coff reader producing any error messages? Can you post the output of ofd2000 when run on the file produced by the hex utility? 

  • The main change that I have seen so far in the output of the ofd2000 is that the File Type changed from File Type: executable file "-->" relocatable file. I also noticed when I am reading the generated file from the Hex2000 tool with a different tool it has no problems understanding the generated coff file .... might it be possible that there have been some changes made on the CoffLib since 'probably' 2003?

  • What version of the compiler was used to produce your executable files? I'm not sure if the format has changed since 2003. I don't think it has, but I can try to find out. Can your coff reader handle relocatable object files? The output of the hex utility is a relocatable object file so it can be input back into the linker. You can use the linker to produce an executable from the object file by passing it to the linker and setting up your linker command file to place all the input sections at the same addresses they are assigned in the object file.

  • Compiler Version 5.2.5

    The  coff read is not able to handle relocatable object files. :(

    I have tried to re link the result object file which was an output of the Hex2000.exe with the same command linker files that I used in the first place but the result still can not be burned into flash because it is linked in a way that it is trying to write into ram instead of the desired Flash areas.

    Any Ideas why this happens?

    Regards

    douncon

  • You will not be able to reuse the same linker command file. The memory map will be the same, but the sections will be different. You will need to add directives for each section in the load image object file and use absolute placement directives. So for instance, if your original output file contained the following two sections:

    .text :    0x40000
    .const: 0x41000 

    And your load image object file contains the following section that contains both of the original sections:

    .sec1: 0x40000

    You will need a linker command file that looks something like:

    SECTIONS
    {
       .sec1 > 0x40000
    }

  • Thanks a lot it works :D

     

    regards 

    douncon

  • Here a short step by step how it worked for me:

    1. run hex2000.exe on your *.out file 

    hex2000.exe --load_image app_a.out app_b.out -o=result.out -map=result.map

    2. check the out sections in the result.map file

    output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    image_1    0    00300000    00000fa9
                      00300000    00000fa9     result.out (image_1)
     
    image_2    0    0033ff80    00000080
                      0033ff80    00000080     result.out (image_2)

    3. create a new my.cmd file with the following

    SECTIONS
     
    {
     
    image_1: > 0x300000
     
    image_2: > 0x33ff80
     
    }

    4. run the linker on the result.out file with your new my.cmd file

    cl2000 --silicon_version=28 -g -z -m result_result.map --stack_size=0x200 --warn_sections --rom_model result.out -o result_result.out my.cmd

    5. the file result_result.out now is your new out file which you may use with your image loader