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.

TMS320F2812: some statements are skipped after compilation

Part Number: TMS320F2812


Hi team,

CCS Version: 12.4.0.00007. The data format is Int32.

A.  As shown in the figure below, the result of the park1.q calculation on line 144 of the previous statement is always changed to Q30 format. The next line assigns the value to iir.input, monitoring iir.input always goes to 0, Q30 * 2 does not cause numerical overflow, nor does it overflow based on monitoring results.

B.  The customer added a test sentence to line 148 for instr.testCount++; instr.testCount, but the statement is incremented by 1 every break.

C. Set a breakpoint at line 143, stop and press step in to jump directly to line 152, the instr.testCount increases normally and the park1.q result has a value normally, but iir.input always is 0. 

The compiler optimization level is 0, no optimization, as set in the following figure: 

From assembly, lines 144 through 151 are optimized, with no assembly statements. However, the middle test statements should be optimized, but they are working properly and automatically increment by 1 when jumping from 143 to 152 lines. Disassembled is as follows: 

Note: The program was working properly before, there was a continuous /// three / when used the shortcut Ctrl + / to comment an entire statement, and the problem occurred after the customer deleted it.

The following attempts were made by the customer but all failed:

  • Delete the project files all, just copy the .c and .h files out and then build the project files again.
  • Change the version of CCS V11 to build.
  • Try replacing C2000 tools. 

In other editors, make the trailing characters appear, and it's fund that if the comment is followed by a CR, the next statement will not be executed, after a CR press returns to CRLF, the next statement executes. 

The customer only have Windows and has no extra action. Normally, the window press enter is CRLF, but it changes suddenly. Could you please help check this case? Thanks.

Best Regards,

Cherry

  • HI Cherry,

    There is some odd behavior happening. In the second screenshot I see the program counter on line 152 where there is no source. Perhaps the source code correlation off. 

    A test case would be very helpful. Could one be provided? It does not have to be the actual project but simply a very striped down simplified version that can reproduce the same issue.

    Thanks

    ki

  • Hi Ki,

    Thank you for the support.

    Perhaps the source code correlation off. 

    The source code is good.

    In other editors, make the trailing characters appear, and it's fund that if the comment is followed by a CR, the next statement will not be executed, after a CR press returns to CRLF, the next statement executes.

    The reason for this issue is as follows: 

     / The trailing character of each line becomes CR after the comment statement, but theoretically the trailing character of Windows should be CRLF. causing the compiler to think that the next line is also a comment. The workaround is to press Enter again after each line and the program will return to normal. 

    Actually the case now here is how does this tail become a CR, no copy and paste have done by the customer, and they haven't edited it on Linux. 

    Thanks and regards,

    Cherry

  •  / The trailing character of each line becomes CR after the comment statement, but theoretically the trailing character of Windows should be CRLF. causing the compiler to think that the next line is also a comment. The workaround is to press Enter again after each line and the program will return to normal. 

    Actually the case now here is how does this tail become a CR, no copy and paste have done by the customer, and they haven't edited it on Linux. 

    The customer only works in a Windows environment and editing source using the CCS editor? Are they working with files in version control?

  • Hi Ki,

    The customer only works in a Windows environment and editing source using the CCS editor? Are they working with files in version control?

    No GIT version is used for control, no other version of control software is used.

    Thanks and regards,

    Cherry

  • I'm not sure what is happening. I can't seem to reproduce the issue. I turn on visibility of special characters and can always see CRLF.

    To turn on special character visibility:

    SInce this all worked before, I suggest the customer try using a clean new workspace folder and importing the projects to it and see if that helps.