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.

CCSTUDIO: Same compiler and code composer studio but different *.out file

Part Number: CCSTUDIO
Other Parts Discussed in Thread: MOTORWARE, UNIFLASH

I have transferred the code from my old laptop to new. In both laptops, I have CCS10.4.0.00006 version, TI v20.2.5LTS compiler, same optimization, (opt level 2, speed vs size trade-offs -2, same linker flags. On both machines compiler compiles well without any warning or error. However, size of *.out files is slightly different 453.15KB in old and 453.67KB in new. The old code works perfectly and in new some part of code doesn’t behave as expected. In view of this, how can I check what might be going wrong? The code is based on instaspin library usage and motorware. If I download code from old laptop, motor runs well, hoever from new the motor doesn't run, but all other things like flag, DC voltages wtc update properly.

  • Please compare both builds as directed in the article Find Source of Code Size Increase.  But with one difference.  You are interested in any function that has a different size.  

    Note size is being used as a proxy for the real objective, which is a difference in behavior.  Thus, it is not strictly correct.  In actual practice, it tends to be close enough.  Focus on the functions with a different size.  I don't know what you will find.  But is likely to further the investigation.

    Thanks and regards,

    -George

  • Dear George,

    I tried as you suggested and found out that the files are having identical components as seen in the excel file. However, the *.out files are different as seen winMerge. Also, if I use uniflash to download files, one gives proper function, the other one doesn't. Is there anything else that I can try using 0fd2000 or otherwise?

  • For each build, please submit the build log, the .out file, and the linker map file.  

    To get a build log, please rebuild the entire project.  One way to do that is to right-click on the name of the project and select Rebuild Project.  Then save the contents of the Console (not Problems) view to a text file.  Use the icon named Copy Build Log (older versions of CCS) or Save build log to file (newer versions of CCS).  

    Organize the files into two directories named old and new.  Then zip it up and attach it to your next post.

    Thanks and regards,

    -George

  • NewFaultyCode.zipOldWorkingCode.zip

    Please find herewith attached files as requested

  • Thank you for the files.

    I disassembled each .out file with dis2000 and compared them.  All the differences occur in instructions, i.e. no data differences.  All of those instructions are for functions in the these two files: hal1_2.c and pwm.c.  This screenshot shows lots of differences close together ...

    The older code is on the left, the newer code is on the right.  The pattern you see here, a constant value that is off by 1, repeats for all the differences. 

    Please build the files hal1_2.c and pwm.c again, but add the option --gen_preprocessor_listing.  Please look up that option in the C28x compiler manual.  Among other effects, it creates listing files with the extension .rl. Compare those files.  Focus on the functions from that screenshot, like PWM_setDigitalCompareInput.  I'm not sure what you will find.  But that difference causes those constants in the disassembly to be different.

    Thanks and regards,

    -George