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.

TMS320F28335: I was wondering if there is a way to ensure that the same checksum is always computed if the code has not changed.

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Hi,

The Checksum of the output file is changes every time I build the project even though I haven't changed the code.

(It is thought that the header and footer are included at the beginning and end of the output file.)

I was wondering if there is a way to ensure that the same checksum is always computed if the code has not changed.

Thanks and regards,
Sang-il

  • Sang-il,

    Just to confirm: Is this for code mapped to flash or RAM?  If flash, Are you checking the checksum via on-chip flash plugin in CCS?

    If not the code, did you change compiler build settings for optimization or compiler version or anything?

    Thanks and regards,
    Vamsi

  • Vamsi,

    Thanks for the quick reply. (^^)

    I know that I can compute a checksum for a FLASH memory sectors In On-Chip FLASH Plug-in tool.

    But, I am calculating the checksum of the entire output file with the HEX editor program.

    The CCS project's build settings, optimization options, and compiler versions were all same state.

    If I build a project with the same settings at different times without any changes, the header and footer parts of each output file are different. (My guess is that some sort of timestamp is included in the header and footer of the output file.)

    If the code or settings for the project have not been changed, I want to ensure that the checksum for the entire output file is always the same no matter what time it is built.

    I wonder if there is a way to modify the build setting of the CCS project so that the output file does not contain information that changes depending on the build time.

    Thanks and regards,
    Sang-il

  • Sang-il,

    Thank you for the detail.  In the hex utility settings, I don't see an option to remove the time stamp and date.  

    I can check with the compiler team if needed, but I don't think there is an option to suppress that info going in to the output.

    Thanks and regards,
    Vamsi

  • Vamsi,

    Thanks for your replies and comments.

    If possible, could you please check with the C2000 compiler team or the CCS team on this issue and let me know it?

    Thanks and regards,
    Sang-il

  • Sang-il,

    I assigned this to our compiler team to help you further.

    Thanks and regards,

    Vamsi

  • I don't know the cause of the difference.  The first thing I want to understand is how the executable .out files generated by the linker are different.  Please install the Code Generation Tools XML Processing Utilities.  Use the utility objdiff to compare .out files from different builds that you expect be the same.  Please tell me what you see.

    Thanks and regards,

    -George

  • George,

    For testing, I used two output files that were built five minutes apart. (I didn't change any code or project settings and I used the TMS320F28335 example included with TI C2000Ware.)

    [Comparison result using cg_xml tool]
    : Files are the same

    [Comparison result using HEX compare utility program]
    : Some different parts are visible

    Our customer maintains the firmware version with the checksum result of the entire output file. So, if the checksum of the output file is different depending on the build time, even though it is the same code with the same settings, a problem occurs.

    I was wondering if there is a way to solve this problem.

    OUT_XML.zip

    Thanks and regards,
    Sang-il

  • This approach ...

    Our customer maintains the firmware version with the checksum result of the entire output file.

    ... is flawed.  The entire output file contains much more than the executable image that is loaded to the target.  Keeping this extra information the same, build to build, is not a requirement the C2000 compiler tools are designed or tested to meet.

    I can give you some insight as to the differences that occur.  There are two kinds of differences I see in these files.

    The first difference ... These are COFF format object files.  The bytes at file offset 4-7 of each file contain a time stamp of the build.  There is no method for avoiding this time stamp.  Any comparison, or checksum, must ignore these bytes.

    The second difference ... Compiling C code uses temporary files.  The names of these temporary files are auto-generated, and differ between builds. The names of some of these temporary files appear in the debug information.  Building with the compiler option --keep_asm avoids these temporary file names.

    While those are all the differences I see in this specific case, I am unable to guarantee no other differences will ever arise.  Should that occur, we will support you, like we do all our customers.  

    Thanks and regards,

    -George

  • George,

    Thanks for your replies and comments.

    I'll share your answer with my clients and find another way.

    Sincerely,

    Sang-il