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.

Different *.out result under same condition

Other Parts Discussed in Thread: TMS320F28335

Hi there,

I've been developing the SW project for C2000(TMS320F28335) with CCSv3.3.

Today, I found that my projet build results(*.out) are different under same condition.

That is, binary compare result for two MyProject.out files shows that there are so many differences even thouth I made no change in my project.

(Even two MyProject.map files are same without 'Linking Time' line.)

How can I make two MyProject.out files EXACTLY same?

Or, how can I assure that two MyProject.out will do same operation?

Thanks.

  • Ted Lee,

    CCS 3.3 and all of its build programs are just computer programs. They should behave the same every time you run them.

    If you do the following, what are your results?

    1. Build All for your application.
    2. Copy or rename the single .out file that is created to a new filename.
    3. Build All for your application.
    4. Compare the latest .out file to the renamed/copied one from step 2.

    Regards,
    RandyP

  • Some differences that can be expected between 2 builds of the same project are the time stamp and possibly text strings containing path information for files used by the compiler.

    I would recommend using a tool called objdiff from our CG_XML package to do this comparison. This compares only the relevant parts of the .out files that are actually loaded to the device.

  • Thanks a lot!!

    I executed the bootimage.exe in the XML tool, and I got EXACTLY same result !!

    MyProject1.out.c and MyProject2.out.c are perfectly same !

    Also, MyProject1.out.h and MyProject2.out.h are perfectly same !

    But, still, I can't understand why two *.out files (MyProject1.out and MyProject2.out) have so many differences.

    Anyhow, thanks a lot !

  • Just want to point out that bootimage is not intended to be used as it was here.  Use objdiff instead.  There are possible differences that this bootimage technique could overlook that objdiff would find.  One example: a difference in the length of the .bss section.  An uninitialized section like that is ignored by bootimage.  Use bootimage to convert the initialized sections of a .out executable into C code arrays of hex values.

    Thanks and regards,

    -George

  • Thanks a lot!

    I checked that my two "out" file is same when I use objdiff command.

    I really appreciate your help.

  • Hi Dear Aarti, 

    I ran into the same problem and trying to use objdiff to solve it. However, I have several problems when I was trying to use objdiff.

    1. I want to use the standalone version (objdiff.exe). What I did was I installed the whole package on windows; open and command window; go to the <root install path>\bin; run the command: objdiff <.out file 1> <.out file 2>, but it gave me the error message says:

      not well-formed (invalid token) at line 1, column 1, byte 2 at XML/Parser.pm line 187

    I tried to reinstall my perl (version 5.16), but this still shows up

    2. If the previous problem can be solved (which hasn't been solved yet), I want to compare only the useful part of the .out files, so I tried 

    objdiff -x <.out file 1> <.out file 2> --xml_indent=0 --obj_display=norawdata,nosymbols,nostrings,norelocs,nolnnos
    but it gives error messages:
    Unknown option : 
    Unknown option: xml_indent
    Unknown option: obj_display
    Processing <.out file 1> ...
    not well-formed (invalid token) at line 1, column 1, byte 2 at XML/Parser.pm line 187

    How do I fix these problems?
  • You don't say which target device you are using.  I presume you are using a C6000 family device, and thus the name of your object file display (OFD) utility is ofd6x.

    You are not passing the name of the OFD utility to objdiff.  Thus, it assumes the 2 input files are in XML format.  But those are binary executable files.  The XML parsing routines can't handle them.  Do this instead ...

    % objdiff file1.out file2.out -- ofd6x --xml_indent=0 ...

    Note the addition of ofd6x.  Also note that -x is not used with objdiff.

    All of this is covered in the objdiff documentation.  The cg_xml root directory includes a file index.htm.  Load that file into your web browser to see all the cg_xml documentation.

    Thanks and regards,

    -George

  • Hi George, 

    First of all, thank you very much for replying to this. I did check out the index.htm and the objdiff page. But I'm new to this so certain things I don't really understand.

    You are right I am using the C6000 compiler. I tried the one you suggested. It still gave me the error message: 

    Unknown option: xml_indent
    Unknown option: obj_display
    Processing <.out file 1> ...
    ' "ofd6x" ' is not recognized as an internal or external command, operable program or batch file. 
    Running "ofd6x" failed, stopped at script/objdiff.pl line 544

    I checked my path, the <root installation path>\cg_xml\bin is in the path. 


    So it turned out I didn't add my ofd6x path (<root installation path>\cg_xml\ofd ). I did that, but it still says 

    Unknown option: xml_indent
    Unknown option: obj_display

    I even tried to run ofd6x alone, but it still says no such options. 

    Alright. It's like I'm talking to myself, but for those of you who's trying to use these options under windows, it might not work. These options are ONLY developed under Linux!!! I tried it and it works.

  • Hi sorry it's me again,

    So it turned out I didn't add my ccs studio path. I did that, but it still says 

    Unknown option: xml_indent
    Unknown option: obj_display

    I even tried to run ofd6x alone, but it still says no such options. 

    Which path includes these things? Please point me to it. Thanks!

  • Precede the ofd6x command with "--".  I failed to do that in the example in my previous post (since corrected).  The "--" splits the command line in half.  Everything before is options to objdiff, everything after is options to ofd6x.

    Thanks and regards,

    -George

  • Is there an OFD utility for the C2000 family? I haven't been able to find one, and I'd like to be able to run objdiff to compare files generated by the C28 compiler.

    Thank you,

    Dave
  • Yes, it's ofd2000. It's in the same bin directory as cl2000.