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.

Compiler/TMS320F280049: Combining Executables

Part Number: TMS320F280049

Tool/software: TI C/C++ Compiler

C2000 Software/Compiler Team,

Let me preface this by saying I've read through and tried implementing the examples at:

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

I'm trying to combine a bootloader and application out file for production programming purposes and I'm having trouble.

First I tried example 1 from the above link where you just pass all the out files to hex2000.  I've tried adding and removing options like memwidth, romwidth, various load_image options and I always seem to get an error about memory ranges being out of order:

memory ranges "image_11" and "image_12" out of order

This is just one of the errors I get, but interesting to note is that the number of out of order errors I get changes based on whether I pass the bootloader or application out file to the tool first.  Here is an example of how I'm calling hex2000 in the post build steps:

${CG_TOOL_ROOT}/bin/hex2000 bootloader.out application.out --memwidth=16 --romwidth=16 --load_image --load_image:file_type=executable --load_image:output_symbols=true  -o ${PROJECT_LOC}/ROM/combined.out

Not being one to give up easy, I've also tried example method 3 where the application is actually linked in the bootloader using an application object file and the bootloader linker command file.  This completes without errors but the application when loaded is not correct.  Here is what memory should look like:

Here's what it looks like when loaded with the outfile generated using the application object file and bootloader linker file:

I'm generating the application obj file as follows:

${CG_TOOL_ROOT}/bin/hex2000 application.out --memwidth=16 --romwidth=16 --load_image --load_image:file_type=executable --load_image:section_prefix="app_image" -o app_image.obj

I originally didn't have the mem/rom width arguments but thought that might be the culprit due to how the memory looked, but there appears to be something else going on.

Can someone point me in the right direction?  Thanks in advance,

Trey

  • Another interesting observation...

    In example case 1 where I'm just combining the out files, if I run the application out file through hex2000 and use its output to combine with the booloader out file (as opposed to the linker generated application out file), everything works and when loaded into memory the application locations look correct.

    Another question... in the above working case once I get to the combination step, if I have the output_symbols=true argument passed to hex2000, shouldn't I be able to debug (at least the bootloader) as normal?  Or will this not work because hex2000 is prefixing symbols?

    Trey

  • I focused on the first problem ...

    Trey German8 said:
    I always seem to get an error about memory ranges being out of order:

    I am unable to reproduce it.  

    What version of the compiler tools do you use?

    Please put the files bootloader.out and application.out in a zip file and attach that zip file to your next post.

    Thanks and regards,

    -George

  • George,

    My apologies for the delay in following up on this.  I hope you had some time to relax over the holidays.

    I'm using 20.2.1.LTS.

    I'll be sending the zip to you in a private message shortly.

    Trey

  • George,

    I spent some more time looking at it.  Turns out my stack sections were on top of each other.  I changed one to DSECT and now everything is happy.  Sorry for bugging you.

    Trey