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.

Why does rebuilding the code produce a different .out file? (MSP430)



I noticed that when I check a project out of source control and rebuild it, the .out file is slightly different, the .hex output is the same, the map file is different by one line.

The .hex file is identical, that makes sense.

The map file difference is just the build date, that makes sense.

The .out file however, is different. See the attached hex difference report.

Why is the exact same output not produced?

Regards,

Jim

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
.AlignLeft { text-align: left; }
.AlignCenter { text-align: center; }
.AlignRight { text-align: right; }
body { font-family: sans-serif; font-size: 11pt; }
td { vertical-align: top; padding-left: 4px; padding-right: 4px; }

tr.SectionGap td { font-size: 4px; border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
tr.SectionAll td { border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
tr.SectionBegin td { border-left: none; border-top: none; border-right: 1px solid Black; }
tr.SectionEnd td { border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
tr.SectionMiddle td { border-left: none; border-top: none; border-right: 1px solid Black; }
tr.SubsectionAll td { border-left: none; border-top: none; border-bottom: 1px solid Gray; border-right: 1px solid Black; }
tr.SubsectionEnd td { border-left: none; border-top: none; border-bottom: 1px solid Gray; border-right: 1px solid Black; }
table.fc { border-top: 1px solid Black; border-left: 1px solid Black; width: 100%; font-family: monospace; font-size: 10pt; }
td.HexItemNum { color: #827357; background-color: #F2F2F2; }
td.HexItemSame { color: #000000; background-color: #FFFFFF; }
.HexSegDiff { color: #FF0000; background-color: #FFE3E3; }
</style>
<title>Hex Compare</title>
</head>
<body>
Hex Compare<br>
Produced: 12/18/2013 9:12:54 AM<br>
&nbsp; &nbsp;
<br>
Mode:&nbsp; Differences &nbsp;
<br>
Left file: C:\Users\COOK\AppData\Local\Temp\star6403853293710431308.out &nbsp;
<br>
Right file: C:\SFTDEV\ADS5\Peripherals\Target\BoardApp\Debug\BoardApp.out &nbsp;
<br>
<table class="fc" cellpadding="0" cellspacing="0">
<tbody><tr class="SectionBegin">
<td class="HexItemSame">62 75 67 5F 70 75 62 6E 61 6D 65 73 00 30 <span class="HexSegDiff">38 35 </span>&nbsp; bug_pubnames.0<span class="HexSegDiff">85</span></td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">62 75 67 5F 70 75 62 6E 61 6D 65 73 00 30 <span class="HexSegDiff">37 39 </span>&nbsp; bug_pubnames.0<span class="HexSegDiff">79</span></td>
</tr>
<tr class="SectionEnd">
<td class="HexItemSame"><span class="HexSegDiff">38 34 </span>31 30 00 24 43 24 4C 31 00 24 43 24 4C 32&nbsp;&nbsp; <span class="HexSegDiff">84</span>10.$C$L1.$C$L2</td>
<td class="HexItemSame AlignCenter">&nbsp;</td>
<td class="HexItemSame"><span class="HexSegDiff">30 30 </span>31 30 00 24 43 24 4C 31 00 24 43 24 4C 32&nbsp;&nbsp; <span class="HexSegDiff">00</span>10.$C$L1.$C$L2</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionAll">
<td class="HexItemSame"><span class="HexSegDiff">38 31 34 </span>30 31 30 00 2E 69 6E 74 30 37 00 2E 69&nbsp;&nbsp; <span class="HexSegDiff">814</span>010..int07..i</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame"><span class="HexSegDiff">32 35 32 </span>30 31 30 00 2E 69 6E 74 30 37 00 2E 69&nbsp;&nbsp; <span class="HexSegDiff">252</span>010..int07..i</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionAll">
<td class="HexItemSame">75 67 68 00 30 <span class="HexSegDiff">39 31 39 </span>32&nbsp; &nbsp; 31 30 00 45 78 70&nbsp;&nbsp; ugh.0<span class="HexSegDiff">919</span>2 10.Exp</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">75 67 68 00 30 <span class="HexSegDiff">38 34 </span>&nbsp;&nbsp; 32 <span class="HexSegDiff">38 </span>31 30 00 45 78 70&nbsp;&nbsp; ugh.0<span class="HexSegDiff">84</span> 2<span class="HexSegDiff">8</span>10.Exp</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionBegin">
<td class="HexItemSame">61 64 43 6D 64 45 76 65 6E 74 00 30 <span class="HexSegDiff">31 33 </span>&nbsp;&nbsp; 36&nbsp;&nbsp; adCmdEvent.0<span class="HexSegDiff">13</span> 6</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">61 64 43 6D 64 45 76 65 6E 74 00 30 <span class="HexSegDiff">38 36 37 </span>36&nbsp;&nbsp; adCmdEvent.0<span class="HexSegDiff">867</span>6</td>
</tr>
<tr class="SectionEnd">
<td class="HexItemSame"><span class="HexSegDiff">38 </span>31 30 00 30 <span class="HexSegDiff">36 34 30 </span>30 31 30 00 54 69 6D 65&nbsp;&nbsp; <span class="HexSegDiff">8</span>10.0<span class="HexSegDiff">640</span>010.Time</td>
<td class="HexItemSame AlignCenter">&nbsp;</td>
<td class="HexItemSame">&nbsp;&nbsp; 31 30 00 30 <span class="HexSegDiff">32 38 38 </span>30 31 30 00 54 69 6D 65&nbsp; &nbsp; 10.0<span class="HexSegDiff">288</span>010.Time</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionAll">
<td class="HexItemSame">38 <span class="HexSegDiff">33 </span>&nbsp;&nbsp; 36 <span class="HexSegDiff">34 </span>31 30 00 53 65 74 41 6C 61 72 6D&nbsp;&nbsp; 8<span class="HexSegDiff">3</span> 6<span class="HexSegDiff">4</span>10.SetAlarm</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">38 <span class="HexSegDiff">31 39 </span>36&nbsp; &nbsp; 31 30 00 53 65 74 41 6C 61 72 6D&nbsp;&nbsp; 8<span class="HexSegDiff">19</span>6 10.SetAlarm</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionBegin">
<td class="HexItemSame">52 75 6C 65 73 49 6E 69 74 00 30 <span class="HexSegDiff">33 33 36 </span>38&nbsp; &nbsp; &nbsp; RulesInit.0<span class="HexSegDiff">336</span>8&nbsp;</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">52 75 6C 65 73 49 6E 69 74 00 30&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 38 <span class="HexSegDiff">39 </span>&nbsp; RulesInit.0&nbsp;&nbsp; 8<span class="HexSegDiff">9</span></td>
</tr>
<tr class="SectionEnd">
<td class="HexItemSame">&nbsp;&nbsp; &nbsp;&nbsp; 31 30 00 2E 69 6E 74 31 34 00 2E 69 6E 74&nbsp; &nbsp;&nbsp; 10..int14..int</td>
<td class="HexItemSame AlignCenter">&nbsp;</td>
<td class="HexItemSame"><span class="HexSegDiff">30 34 </span>31 30 00 2E 69 6E 74 31 34 00 2E 69 6E 74&nbsp;&nbsp; <span class="HexSegDiff">04</span>10..int14..int</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionBegin">
<td class="HexItemSame">65 6D 65 6E 74 65 64 49 73 72 00 30&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 36&nbsp;&nbsp; ementedIsr.0&nbsp;&nbsp; 6</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">65 6D 65 6E 74 65 64 49 73 72 00 30 <span class="HexSegDiff">37 34 39 </span>36&nbsp;&nbsp; ementedIsr.0<span class="HexSegDiff">749</span>6</td>
</tr>
<tr class="SectionEnd">
<td class="HexItemSame"><span class="HexSegDiff">38 32 38 </span>31 30 00 2E 69 6E 74 31 33 00 2E 69 6E&nbsp;&nbsp; <span class="HexSegDiff">828</span>10..int13..in</td>
<td class="HexItemSame AlignCenter">&nbsp;</td>
<td class="HexItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; 31 30 00 2E 69 6E 74 31 33 00 2E 69 6E&nbsp; &nbsp; &nbsp; 10..int13..in</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionAll">
<td class="HexItemSame">65 72 72 75 70 74 00 30 <span class="HexSegDiff">34 36 </span>38 30&nbsp; &nbsp; 31 30 00&nbsp;&nbsp; errupt.0<span class="HexSegDiff">46</span>80 10.</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">65 72 72 75 70 74 00 30 <span class="HexSegDiff">38 </span>&nbsp;&nbsp; 38 30 <span class="HexSegDiff">34 </span>31 30 00&nbsp;&nbsp; errupt.0<span class="HexSegDiff">8</span> 80<span class="HexSegDiff">4</span>10.</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionBegin">
<td class="HexItemSame">61 74 65 00 30 39 <span class="HexSegDiff">30 </span>30 34 31 30 00 2E 74 65 78&nbsp;&nbsp; ate.09<span class="HexSegDiff">0</span>0410..tex</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">61 74 65 00 30 39 <span class="HexSegDiff">31 </span>30 34 31 30 00 2E 74 65 78&nbsp;&nbsp; ate.09<span class="HexSegDiff">1</span>0410..tex</td>
</tr>
<tr class="SectionEnd">
<td class="HexItemSame">74 3A 49 6E 69 74 4C 61 6D 70 00 30 <span class="HexSegDiff">36 37 36 38 </span>&nbsp; t:InitLamp.0<span class="HexSegDiff">6768</span></td>
<td class="HexItemSame AlignCenter">&nbsp;</td>
<td class="HexItemSame">74 3A 49 6E 69 74 4C 61 6D 70 00 30 <span class="HexSegDiff">35 35 39 32 </span>&nbsp; t:InitLamp.0<span class="HexSegDiff">5592</span></td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionAll">
<td class="HexItemSame">63 68 49 6E 70 75 74 00 30 <span class="HexSegDiff">36 </span>&nbsp; &nbsp; &nbsp; 36 <span class="HexSegDiff">30 38 </span>31&nbsp;&nbsp; chInput.0<span class="HexSegDiff">6</span>&nbsp; 6<span class="HexSegDiff">08</span>1</td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">63 68 49 6E 70 75 74 00 30 <span class="HexSegDiff">37 38 39 </span>36&nbsp; &nbsp; &nbsp;&nbsp; 31&nbsp;&nbsp; chInput.0<span class="HexSegDiff">789</span>6&nbsp; 1</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
<tr class="SectionBegin">
<td class="HexItemSame">6E 69 74 41 6C 61 72 6D 44 72 69 76 65 00 30 <span class="HexSegDiff">37 </span>&nbsp; nitAlarmDrive.0<span class="HexSegDiff">7</span></td>
<td class="HexItemSame AlignCenter">&lt;&gt;</td>
<td class="HexItemSame">6E 69 74 41 6C 61 72 6D 44 72 69 76 65 00 30&nbsp; &nbsp; &nbsp; nitAlarmDrive.0&nbsp;</td>
</tr>
<tr class="SectionEnd">
<td class="HexItemSame">38 <span class="HexSegDiff">35 </span>36&nbsp; &nbsp; &nbsp;&nbsp; 31 30 00 48 65 61 72 74 42 65 61&nbsp;&nbsp; 8<span class="HexSegDiff">5</span>6&nbsp; 10.HeartBea</td>
<td class="HexItemSame AlignCenter">&nbsp;</td>
<td class="HexItemSame">38&nbsp; &nbsp; 36 <span class="HexSegDiff">34 38 </span>31 30 00 48 65 61 72 74 42 65 61&nbsp;&nbsp; 8 6<span class="HexSegDiff">48</span>10.HeartBea</td>
</tr>
<tr class="SectionGap"><td colspan="3">&nbsp;</td></tr>
</tbody></table>
<br>


</body></html>

  • Jim,

    In addition to time stamp there may be some other things that vary from build to build, mostly in the debugging information. If you are compiling with debug enabled (-g) this could be causing the differences.

    There is a command line utility named objdiff which can compare .out files and tell you if they are the same. The time stamp (as well as the inconsequential debug information) is ignored by this utility when doing this comparison.  See http://processors.wiki.ti.com/index.php/Code_Generation_Tools_XML_Processing_Scripts  

    There is also this related thread on this topic.

  • Hi AartiG,

    Thanks for the info. I checked the related thread you provided and at our company, we have the same concern as the participants on that thread. That is, it is very important that each development PC produces the exact same output.

    We generally check the .out file into revision control and then we can see if we able to build the same code. This is how we do it for the 2812 using CCS 2.2 & 3.3 which seem to be consistent. When we release to manufacturing, we will provide the .out or .hex depending on the programming methods they have employed for a particular product.

    Of course, we could convert it to .hex and then compare. However, it's an extra step and we have 4 developers constantly providing code updates. And, because the developers are working in CCS, the .out file is the most natural to work with. It would be nice if the debug information could be recreated identically. Then, only a time stamp would be different on file compare. Even better, a compiler option to force consistent debug symbol behavior and to omit the time stamp.

    But, for now, at least I understand it. We will just have to use the compare tool you mentioned or convert to .hex first. While not as handy as using the StarTeam RCS compare, it is workable.

    Regards,

    Jim