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.

TMS320F280049C: How to use CCS v11.2 compiler to compile a .c file?

Part Number: TMS320F280049C

Hi

I got an error message when using cl2000.exe in CCS v11.2 as below to compile a .c file,

cd "C:\PSIM\Beta\PSIM_2022.1_Softkey\examples\Code Generation\F28004x Target\VSI3 with RL load\VSI3 with RL Load (closed loop) (C Code)"
C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-c2000_21.6.0.LTS\bin\cl2000.exe -pdsw=225 -q -o3 --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu0 -fr=FlashRelease -fs=FlashRelease -d=LARGE_MODEL -ml -v28 VSI3_with_RL_Load__closed_loop_.c -z -q -c -e=code_start -heap=0 -stack=0x30A -w -x -l=f28004x_headers_nonbios.cmd -l=F280049_FLASH_lnk.cmd -l=rts2800_fpu32.lib -l="PsBiosRomF004xFloat.lib" -o=VSI3_with_RL_Load__closed_loop_.out

The error message is as below:

"VSI3_with_RL_Load__closed_loop_.c", line 8: fatal error: could not open source file "math.h" (no directories in search list)
1 catastrophic error detected in the compilation of "VSI3_with_RL_Load__closed_loop_.c".
Compilation terminated.

The path of math.h file in my computer is  C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-c2000_21.6.0.LTS\include, do I have any way to avoid this error?

By the way the same command can compile .c file in CCS v9.2 without any error.

The project is attached for you review.

Thanks,

JiakaiVSI3 with RL Load (closed loop) (C code).zip

  • I don't see how the CCS project issued these build commands ...

    cd "C:\PSIM\Beta\PSIM_2022.1_Softkey\examples\Code Generation\F28004x Target\VSI3 with RL load\VSI3 with RL Load (closed loop) (C Code)"
    C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-c2000_21.6.0.LTS\bin\cl2000.exe -pdsw=225 -q -o3 --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu0 -fr=FlashRelease -fs=FlashRelease -d=LARGE_MODEL -ml -v28 VSI3_with_RL_Load__closed_loop_.c -z -q -c -e=code_start -heap=0 -stack=0x30A -w -x -l=f28004x_headers_nonbios.cmd -l=F280049_FLASH_lnk.cmd -l=rts2800_fpu32.lib -l="PsBiosRomF004xFloat.lib" -o=VSI3_with_RL_Load__closed_loop_.out

    There are two commands.  The first one is a cd (change directory) command.  The build of a CCS project never uses cd.  The second command is an invocation of the compiler cl2000.  It compiles one source file and then links the program.  A CCS project uses the compiler, but never in that manner.  It always compiles the files, then links with a separate invocation of the compiler.

    The immediate problem is that the compile command does not indicate where to find the RTS library include files like <math.h>.  You need to add an option similar to ...

    --include_path=C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-c2000_21.6.0.LTS\include

    When I build the project you attached, the build succeeds.  Here are the contents of the Console view ...

    **** Build of configuration 1_RamDebug for project VSI3_with_RL_Load__closed_loop_ ****
    
    "C:\\ti\\ccs1110\\ccs\\utils\\bin\\gmake" -k -j 8 all -O 
     
    Building file: "C:/Userdata/mytemp/VSI3 with RL Load (closed loop) (C code)/VSI3_with_RL_Load__closed_loop_.c"
    Invoking: C2000 Compiler
    "C:/ti/compilers/ti-cgt-c2000_16.9.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu0 -Ooff --include_path="C:/Users/a0321429/workspace_v11/VSI3_with_RL_Load__closed_loop_" --include_path="C:/ti/compilers/ti-cgt-c2000_16.9.2.LTS/include" --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="VSI3 with RL Load (closed loop) (C VSI3_with_RL_Load__closed_loop_.d_raw"  "C:/Userdata/mytemp/VSI3 with RL Load (closed loop) (C code)/VSI3_with_RL_Load__closed_loop_.c"
    "C:\Userdata\mytemp\VSI3 with RL Load (closed loop) (C code)\PS_bios.h", line 663: warning #179-D: variable "val" was declared but never referenced
    "C:/Userdata/mytemp/VSI3 with RL Load (closed loop) (C code)/VSI3_with_RL_Load__closed_loop_.c", line 248 (col. 18): advice #2614-D: (Performance) Use --fp_mode=relaxed to enable TMU hardware support for cos.
    "C:/Userdata/mytemp/VSI3 with RL Load (closed loop) (C code)/VSI3_with_RL_Load__closed_loop_.c", line 248 (col. 45): advice #2614-D: (Performance) Use --fp_mode=relaxed to enable TMU hardware support for sin.
    Finished building: "C:/Userdata/mytemp/VSI3 with RL Load (closed loop) (C code)/VSI3_with_RL_Load__closed_loop_.c"
     
    Building target: "VSI3_with_RL_Load__closed_loop_.out"
    Invoking: C2000 Linker
    "C:/ti/compilers/ti-cgt-c2000_16.9.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu0 -Ooff --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number -z -m"VSI3_with_RL_Load__closed_loop_.map" --heap_size=0 --stack_size=0x30A --warn_sections -i"C:/ti/compilers/ti-cgt-c2000_16.9.2.LTS/lib" -i"C:/ti/compilers/ti-cgt-c2000_16.9.2.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="VSI3_with_RL_Load__closed_loop__linkInfo.xml" --entry_point=code_start --rom_model -o "VSI3_with_RL_Load__closed_loop_.out" "./VSI3_with_RL_Load__closed_loop_.obj" "C:/Userdata/mytemp/VSI3 with RL Load (closed loop) (C code)/F280049_RAM_Lnk.cmd" "C:/Userdata/mytemp/VSI3 with RL Load (closed loop) (C code)/PsBiosRamF004xFloat.lib" "C:/Userdata/mytemp/VSI3 with RL Load (closed loop) (C code)/F28004x_Headers_nonBIOS.cmd"  -llibc.a 
    <Linking>
    warning #99922: C:\Users\a0321429\AppData\Local\Temp\129722: Invalid CIE reference 0xffffff00 for the FDE at offset 0x000001f7 in the .debug_frame section()
    Finished building target: "VSI3_with_RL_Load__closed_loop_.out"
     
    
    **** Build Finished ****

    This build works as I describe above.  The project is configured to use compiler version 16.9.2.LTS.  I have this compiler installed in a non-standard place C:\ti\compilers.  I configured CCS to search this directory for compilers any time a new project is added.

    Thanks and regards,

    -George