Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

TMS320F280025: Compiler issue

Part Number: TMS320F280025
Other Parts Discussed in Thread: C2000WARE

Hi Champ,

Customer met below issue :

The code RTE_APP_ISR_INVFast2_UPPWM_DOWNPWM() function missing in the disassembly code.

But if add one blank line before this code , disassembly code will be normal.

Customer already try below condition, both have the same issue. attached is customer  project. customer want to know the root cause and how to avoid this issue in the future.

INVTest2_53084.rar

Condition 1: Customer already try CCS10.1.0.0010 and ti-cgt-c2000_20.2.1.LTS

C2000 Compiler

-v28 -ml --float_support=fpu32 --idiv_support=idiv0 --tmu_support=tmu0 -O3 --fp_mode=relaxed --include_path="D:/ccs_workspace/v10/HV/11kwSingle-HV/INVTest2" --include_path="D:/Program Files/TI/ccsv10/C2000Ware_3_02_00_00/device_support/f28002x/common/include" --include_path="D:/Program Files/TI/ccsv10/C2000Ware_3_02_00_00/device_support/f28002x/common/include" --include_path="C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-c2000_20.2.1.LTS/include" --include_path="D:/ccs_workspace/v10/HV/11kwSingle-HV/INVTest2/Source Code Files" --include_path="D:/ccs_workspace/v10/HV/11kwSingle-HV/INVTest2/Source Code Files/Base" --include_path="D:/ccs_workspace/v10/HV/11kwSingle-HV/INVTest2/Source Code Files/Chip Device/Include" --include_path="D:/ccs_workspace/v10/HV/11kwSingle-HV/INVTest2/Source Code Files/Chip Device/Include/Heads" --include_path="D:/ccs_workspace/v10/HV/11kwSingle-HV/INVTest2/Source Code Files/Chip Device/LIB/FlashAPI" --include_path="D:/ccs_workspace/v10/HV/11kwSingle-HV/INVTest2/Source Code Files/Chip Device/LIB/FlashAPI/Constants" --advice:performance=all --define=DEBUG --define=_FLASH --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi

C2000 Linker

-v28 -ml --float_support=fpu32 --idiv_support=idiv0 --tmu_support=tmu0 -O3 --fp_mode=relaxed --advice:performance=all --define=DEBUG --define=_FLASH --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"INVTest2.map" --heap_size=0x100 --stack_size=0x200 --warn_sections -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-c2000_20.2.1.LTS/lib" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-c2000_20.2.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="INVTest2_linkInfo.xml" --entry_point=code_start --rom_model

Condition 2: Customer already try CCS11.1.0.00011 and ti-cgt-c2000_21.6.0.LTS

C2000 Compiler

-v28 -ml --float_support=fpu32 --idiv_support=idiv0 --tmu_support=tmu0 -O3 --fp_mode=relaxed --include_path="C:/Users/aohua/Desktop/VAIMD62375C1U17AV100B01D04" --include_path="D:/Program Files/TI/ccsv10/C2000Ware_3_02_00_00/device_support/f28002x/common/include" --include_path="D:/Program Files/TI/ccsv10/C2000Ware_3_02_00_00/device_support/f28002x/common/include" --include_path="C:/ti/ccs1110/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/include" --include_path="C:/Users/aohua/Desktop/VAIMD62375C1U17AV100B01D04/Source Code Files" --include_path="C:/Users/aohua/Desktop/VAIMD62375C1U17AV100B01D04/Source Code Files/Base" --include_path="C:/Users/aohua/Desktop/VAIMD62375C1U17AV100B01D04/Source Code Files/Chip Device/Include" --include_path="C:/Users/aohua/Desktop/VAIMD62375C1U17AV100B01D04/Source Code Files/Chip Device/Include/Heads" --include_path="C:/Users/aohua/Desktop/VAIMD62375C1U17AV100B01D04/Source Code Files/Chip Device/LIB/FlashAPI" --include_path="C:/Users/aohua/Desktop/VAIMD62375C1U17AV100B01D04/Source Code Files/Chip Device/LIB/FlashAPI/Constants" --include_path="C:/Users/aohua/Desktop/VAIMD62375C1U17AV100B01D04/Source Code Files/Project/RTE" --advice:performance=all --define=DEBUG --define=_FLASH --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi

C2000 Linker

-v28 -ml --float_support=fpu32 --idiv_support=idiv0 --tmu_support=tmu0 -O3 --fp_mode=relaxed --advice:performance=all --define=DEBUG --define=_FLASH --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"VAIMD62375C1U17AV100B01D04.map" --heap_size=0x100 --stack_size=0x200 --warn_sections -i"C:/ti/ccs1110/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/lib" -i"C:/ti/ccs1110/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="VAIMD62375C1U17AV100B01D04_linkInfo.xml" --entry_point=code_start --rom_model

  • Hello,

    I see the customer is compiler with -O3. This is high optimization, resulting in impacted debug visibility. If the customer disables optimization, does the issue go away?

    Thanks

    ki

  • Ki,

    After disables optimization , issue is the same!

    You can try attached  project.

  • Thank you for the CCS project.  I can see the missing instructions in the INVTest2.out file which is inside the project.  However, when I build the project myself, I am unable to reproduce that result.  I have tried several different variations.  It always works for me.  

    Please try to demonstrate the problem while building only the file InvCalc.c.  Add the compiler --src_interlist.  This causes the compiler to keep the auto-generated assembly file, and add comments to it.  In this case, the file InvCalc.asm can be found in the directory CPU_FLASH1 (the directory named after the CCS build configuration).  When inspecting that file, search for the string 253 (the source line where the problem occurs).  You'll find something similar to this ...

    ;*** 251	-----------------------    EPwm7Regs.AQCSFRC.all = 5u;
    ;*** 253	-----------------------    EPwm2Regs.AQCSFRC.all = 0u;
    	.dwpsn	file "../Source Code Files/Project/APP/Power Manager/Inverter/InvCalc.c",line 251,column 8,is_stmt,isa 0
            MOVW      DP,#||EPwm7Regs||+73  ; [CPU_ARAU] 
            MOVB      @$BLOCKED(||EPwm7Regs||)+73,#5,UNC ; [CPU_ALU] |251| 
    	.dwpsn	file "../Source Code Files/Project/APP/Power Manager/Inverter/InvCalc.c",line 253,column 9,is_stmt,isa 0
            MOVW      DP,#||EPwm2Regs||+73  ; [CPU_ARAU] 
            MOV       @$BLOCKED(||EPwm2Regs||)+73,#0 ; [CPU_ALU] |253|

    I have not seen the problem at this level of analysis.  If I did, I would expect the last 3 lines to be absent.  Please try to find a way to build the code so that something similar occurs.  Once you do that, for the source file InvCalc.c, please follow the directions in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George

  • George,

    Did you try with the same CCS and complier version?

  • George,

    I have repeat customer issue based on pervious project.

    Original InvCalc.c file line 253 is blank line , so without issue.

    If without this blank line, like following, the issue will happened.

    attached is the InvCalc.asm file.

    InvCalc.asm

  • George,

    The test case as attached.

    InvCalc.pp

    My CCS version is 11.0.0.00012.compiler version is c2000_20.2.1.LTS.

    compiler option:

    -v28 -ml --float_support=fpu32 --idiv_support=idiv0 --tmu_support=tmu0 -O3 --fp_mode=relaxed --include_path="C:/workspace_v11/INVTest2_53084/INVTest2" --include_path="D:/Program Files/TI/ccsv10/C2000Ware_3_02_00_00/device_support/f28002x/common/include" --include_path="D:/Program Files/TI/ccsv10/C2000Ware_3_02_00_00/device_support/f28002x/common/include" --include_path="C:/ti/ti-cgt-c2000_20.2.1.LTS/include" --include_path="C:/workspace_v11/INVTest2_53084/INVTest2/Source Code Files" --include_path="C:/workspace_v11/INVTest2_53084/INVTest2/Source Code Files/Base" --include_path="C:/workspace_v11/INVTest2_53084/INVTest2/Source Code Files/Chip Device/Include" --include_path="C:/workspace_v11/INVTest2_53084/INVTest2/Source Code Files/Chip Device/Include/Heads" --include_path="C:/workspace_v11/INVTest2_53084/INVTest2/Source Code Files/Chip Device/LIB/FlashAPI" --include_path="C:/workspace_v11/INVTest2_53084/INVTest2/Source Code Files/Chip Device/LIB/FlashAPI/Constants" --advice:performance=all --define=DEBUG --define=_FLASH --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -k --src_interlist

    Link option  :

    -v28 -ml --float_support=fpu32 --idiv_support=idiv0 --tmu_support=tmu0 -O3 --fp_mode=relaxed --advice:performance=all --define=DEBUG --define=_FLASH --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -k --src_interlist -z -m"INVTest2.map" --heap_size=0x100 --stack_size=0x200 --warn_sections -i"C:/ti/ti-cgt-c2000_20.2.1.LTS/lib" -i"C:/ti/ti-cgt-c2000_20.2.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="INVTest2_linkInfo.xml" --entry_point=code_start --rom_model

  • Huihuang,

    George is out of the office for a couple of days and will reply once he returns.

    Regards,

    John

  • The test case as attached.

    Thank you.  Unfortunately, I remain unable to reproduce the problem.

    From the InvCalc.asm attachment you posted on May 26, the problem is seen in these lines ...

    ;*** 249	-----------------------    if ( g_u16DirectionNegCnt < 2u ) goto g19;
    	.dwpsn	file "../Source Code Files/Project/APP/Power Manager/Inverter/InvCalc.c",line 249,column 4,is_stmt,isa 0
            MOV       AL,@||g_u16DirectionNegCnt|| ; [CPU_ALU] |249| 
            CMPB      AL,#2                 ; [CPU_ALU] |249| 
            B         ||$C$L17||,LO         ; [CPU_ALU] |249| 
            ; branchcc occurs ; [] |249| 
    ;*** 251	-----------------------    EPwm7Regs.AQCSFRC.all = 5u;
    	.dwpsn	file "../Source Code Files/Project/APP/Power Manager/Inverter/InvCalc.c",line 251,column 8,is_stmt,isa 0
            MOVW      DP,#||EPwm7Regs||+73  ; [CPU_ARAU] 
            MOVB      @$BLOCKED(||EPwm7Regs||)+73,#5,UNC ; [CPU_ALU] |251| 
    ||$C$L17||:    
    ;***	-----------------------g19:

    Only one field is assigned the value 5.  Then it ends.  There should be another assignment of 0 to another field.  When I try to reproduce the problem, I see this ...

    ;** 20874	-----------------------    if ( g_u16DirectionNegCnt < 2u ) goto g19;
    	.dwpsn	file "file.c",line 20874,column 4,is_stmt,isa 0
            MOV       AL,@||g_u16DirectionNegCnt|| ; [CPU_ALU] |20874| 
            CMPB      AL,#2                 ; [CPU_ALU] |20874| 
            B         ||$C$L17||,LO         ; [CPU_ALU] |20874| 
            ; branchcc occurs ; [] |20874| 
    ;** 20876	-----------------------    EPwm7Regs.AQCSFRC.all = 5u;
    ;** 20878	-----------------------    EPwm2Regs.AQCSFRC.all = 0u;
    	.dwpsn	file "file.c",line 20876,column 8,is_stmt,isa 0
            MOVW      DP,#||EPwm7Regs||+73  ; [CPU_ARAU] 
            MOVB      @$BLOCKED(||EPwm7Regs||)+73,#5,UNC ; [CPU_ALU] |20876| 
    	.dwpsn	file "file.c",line 20878,column 9,is_stmt,isa 0
            MOVW      DP,#||EPwm2Regs||+73  ; [CPU_ARAU] 
            MOV       @$BLOCKED(||EPwm2Regs||)+73,#0 ; [CPU_ALU] |20878| 
    ||$C$L17||:    
    ;***	-----------------------g19:
    

    The assignment of 5 is present.  But the assignment of 0 is also present.  The line numbers are different, because I am building the preprocessed file, which has many more lines from header files inside it.  Otherwise, these code sequences start the same way.  They match until the assignment to 0 starts.  

    Until I reproduce the problem, there is no way to advance the issue.  I'll discuss your problem with a few other people, then get back to you.

    Thanks and regards,

    -George

  • I'll contact you through private messages.  

    -George

  • George,

    I don't know why you cannot reproduce the problem, both customer and me can reproduce he problem

    At three testing case can reproduce the  problem: detail compiler option can found in the pervious forum.

    1.Customer side: CCS10.1.0.0010 and ti-cgt-c2000_20.2.1.LTS

    2. Customer side: CCS 11.1.0.00011 and ti-cgt-c2000_21.6.0.LTS

    3.My side:  CCS  11.0.0.00012 and  c2000_20.2.1.LTS.

    I not sure you see below info which i post on May 26 or not. 

    Did you try remove the NO.253 blank line?

    which CCS and compiler version you have try?

    I will let other FAE to try if they can reproduce the problem or not.

  • Thank you for the additional information we exchanged through private messages.  Unfortunately, I am still unable to reproduce the problem.

    I did find one detail in InvCalc.c worth discussing.  At first, I ignored it, because I didn't think it was related to the problem.  At this point, though, we have to consider it.  

    It relates to how line endings are represented in text files.  First some background on the ASCII characters related to line endings.

    ESC HEX Notes
    \n 0xA

    newline

    \r 0xD carriage return

    Here is what the column headings mean.

    • ESC : The C/C++ escape sequence for that ASCII character
    • HEX: The hexadecimal value of the ASCII character
    • Notes: The usual term used when referring to the character

    In text files on Windows systems, the lines end with the character sequence \r \n.  

    Line 253 of the file InvCalc.c has an extra \r at the beginning of it.  There are a few different ways you can see this extra \r character.  I use the text editor gvim, and it renders this character ^M.  Here is a screen shot.

    Many other text editors do not show it at all, or may render it differently.  Even so, this extra \r character is present.

    Because it is a space character, it should not affect anything.  At this point, however, we have to consider the possibility it is part of the problem.

    Please try moving the extra \r from line 253 to line 251.  Does that cause line 251 to be ignored?  Try removing the extra \r.  Does that cause the problem to go away?  When I try these experiments, it makes no difference.  The generated code continues to be as expected.

    Thanks and regards,

    -George

  • George,

    Could you tell me which testing condition (CCS/Complier version) you already try?

  • George,

    i already let other FAE help to try pervious project with CCS11.1.0 and CGT v21.6.0.LTS by delete  InvCalc.c file NO253 blank line.

    They also can reproduce the problem. i'm so curious why you cannot reproduce the problem.

     Could you tell me which testing condition (CCS/Complier version) you already try?

  • I've tried compiler versions 20.2.1.LTS and 21.6.0.LTS.  CCS versions 10.1.1 and 11.1.0.  All sorts of variants related to the source code.  Adding and removing blank lines.  Adding and removing the extra \r character.  I always the get same result.  The generated code continues to be as expected.

    Have you tried the experiments related to \r I describe in my last post?

    Thanks and regards,

    -George

  • Thanks to more work behind the scenes, I am able to reproduce the problem.  While I don't completely understand everything, I understand enough to tell you what to avoid.

    Here is screen shot of what is displayed in the CCS editor ...

    When you take a careful look at each character near the end of one line and the start of the next, you see this ...

     ;   /   /   T   O   D   O  \r  \t  \t  \t                   R   T   E   _   A

    Each character is displayed, followed by some spaces.  For a simple ASCII character, you see it, followed by 3 spaces.  Space characters from the source line are hard to see, because they too are followed by 3 spaces.  If a character is not a simple ASCII character, it is represented by an escape sequence, and followed by 2 spaces.  In this case, \r means carriage return, \t means tab, and \n means newline.

    Except \n never appears.  This is the thing to avoid.  Never allow a bare \r to appear.  Always make sure the end of line sequence is \r \n.  

    The CCS editor thinks a bare \r means the line has ended.  The compiler does not.  The compiler handles a bare \r like a space or a tab.  In this case, the comment that starts //TODO carries over to what the CCS editor displays as the next line, and causes that entire line to be commented out.

    This is an odd situation.  I'm discussing it with my team, and will get back to you.  

    Thanks and regards,

    -George

  • I investigated further, and ended up filing this issue against the compiler EXT_EP-10833.  You are welcome to follow it with that link.

    As for a workaround ... This issue is very old.  Probably more than 20 years old. It only showed up now.  This is evidence that this problem is very rare. That being the case, it may make sense to do nothing more than remove the bare \r character in this one file.

    Thanks and regards,

    -George

  • George,

    Any plan to fix this issue in future complier release?

    Due to in CCS editor cannot see  the special character like following, how customer could avoid this kindly of problem in the future?

     ;   /   /   T   O   D   O  \r  \t  \t  \t                   R   T   E   _   A

    Using which editor tools could  see above character?

    If customer cannot see this special character in CCS editor, the  pentional risk will be always there, if we have no plan to fix this issue in future complier release? do we have plan to update CCS editor so that the special character could be displayed in CCS editor?

    Another question : why you can reproduce the problem now, but cannot reproduce problem before?

  • You can see the characters in CCS but you have to turn on the feature for that.  Most editors have a way to show this type of character.  In CCS open the preferences dialog then select General->Editors->Text Editor on the left.  Then enable the option to "Show whitespace characters" on the right.

    Once you do that you can see the special characters.

    If you look at the end of line 252 you can see that it is missing a character as compared to all other lines.

    i.e. it only has 

    Instead of 

    Regards,

    John

  • Can you also answer other questions?

    I have try the way "Show whitespace characters", i can see   it only has  .

    I want to know use which tools can see following character?

     ;   /   /   T   O   D   O  \r  \t  \t  \t                   R   T   E   _   A

  • What do you not see?

    The >> >> >> is the 3 \t (tabs)

    The .... is the 4 spaces

  • I see like following,

    i want to know use which tools can see following character?

     ;   /   /   T   O   D   O  \r  \t  \t  \t                   R   T   E   _   A

  • I do not know of a tool that displays it as \r \t ...  However any editor will have an option to show the characters.  Typically they are shown similar to how CCS shows them.

    VS Code

     

  • George,

    Any plan to fix this issue in future complier release?

    How customer could avoid this kindly of problem in the future?

     ;   /   /   T   O   D   O  \r  \t  \t  \t                   R   T   E   _   A

    Using which editor tools could  see above character?

    Another question : why you can reproduce the problem now, but cannot reproduce problem before?

  •  ;   /   /   T   O   D   O  \r  \t  \t  \t                   R   T   E   _   A

    Using which editor tools could  see above character?

    I developed that display not by using a text editor, but by using a utility normally used to dump out bytes from a binary file.  The command is called od.  It is available on Linux, and other Unix-like systems.  I first reduced the problem file down to a small number of lines.  Then I ran a command similar to ...

    od -An -c -w20 small_file.c

    Then I copied one line of the output of that command into the forum post.

    While that is a good way to clearly demonstrate the problem in a forum post, I don't think it is practical for any other use in this situation.

    Thanks and regards,

    -George

  • why you can reproduce the problem now, but cannot reproduce problem before?

    To cause the problem to occur, a blank line must be removed from the file in the CCS project submitted by the customer.  The precise way in which that happens is significant.  I never paid attention to exactly how I removed the blank line.  But, however I did it before, it did not cause a bare \r character to remain.  Eventually, after many attempts, I got lucky and stumbled on to a way to remove the blank line that leaves the bare \r behind.

    The lesson we should all learn is to submit a test case, as much as possible, in the very form in which the problem occurs.

    Thanks and regards,

    -George

  • Further details on this thread are being worked privately.  Just for now, this thread is marked resolved, even though that is not really the case.  When it does get resolved, I'll post a quick summary here.

    Thanks and regards,

    -George

  • In case it helps attached is a different test case which causes a compile error.

    This is done by having a comment which ends with only \r "swallow" the opening brace on the next source line.

    The view from the notepad++ editor which allowed the "ASCII Codes Insertion Panel" to insert the \r at the end of a line:

    The od dump of the created source file:

    $ od -An -c -w10 main.c 
       i   n   t       m   a   i   n       (
       v   o   i   d   )       /   /       t
       h   i   s       l   i   n   e       e
       n   d   s       w   i   t   h       o
       n   l   y       \   r  \r   {  \r  \n
                       r   e   t   u   r   n
           0   ;  \r  \n   }  \r  \n
    

    The resulting error from the compiler, when running CCS under Linux:

    **** Clean-only build of configuration Debug for project TMS320F280025_CR_only_line_ending ****
    
    /home/mr_halfword/ti/ccs1120/ccs/utils/bin/gmake -k -j 12 clean -O 
     
    rm -rf  "TMS320F280025_LF_only_line_ending.hex"  "TMS320F280025_LF_only_line_ending.out" 
    rm -rf "main.lst" 
    rm -rf "main.obj" 
    rm -rf "main.d" 
    Finished clean
     
    
    **** Build Finished ****
    
    **** Build of configuration Debug for project TMS320F280025_CR_only_line_ending ****
    
    /home/mr_halfword/ti/ccs1120/ccs/utils/bin/gmake -k -j 12 all -O 
     
    Building file: "../main.c"
    Invoking: C2000 Compiler
    "/home/mr_halfword/ti/ccs1120/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/bin/cl2000" -v28 -ml -mt --float_support=fpu32 --idiv_support=idiv0 --tmu_support=tmu0 --include_path="/home/mr_halfword/workspace_v11/TMS320F280025_CR_only_line_ending" --include_path="/home/mr_halfword/ti/ccs1120/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --asm_listing --preproc_with_compile --preproc_dependency="main.d_raw"  "../main.c"
     
    >> Compilation failure
    subdir_rules.mk:7: recipe for target 'main.obj' failed
    "../main.c", line 2: error #131: expected a "{"
    1 error detected in the compilation of "../main.c".
    gmake: *** [main.obj] Error 1
    gmake: Target 'all' not remade because of errors.
    
    **** Build Finished ****
    

    The attached project created in CCS 11.2

    TMS320F280025_CR_only_line_ending.zip