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.

CODECOMPOSER: Help with some random compilation errors in headers and source files provided by TI

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: C2000WARE

Hi!

Random one here, but while compiling my code, I get a bunch of errors from some header and source files that I have not even touched before. Default codes provided by TI.

I am unsure if I have done something wrong, but here are the errors:

">> Compilation failure
subdir_rules.mk:16: recipe for target 'MPM_CPU1.obj' failed
"C:/ti/F2837xD GCB/Device_support/F2837xD_headers/include/F2837xD_device.h", line 46: warning #48-D: incompatible redefinition of macro "EALLOW" (declared at line 106 of "C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2837xd\driverlib\cpu.h")
"C:/ti/F2837xD GCB/Device_support/F2837xD_headers/include/F2837xD_device.h", line 47: warning #48-D: incompatible redefinition of macro "EDIS" (declared at line 117 of "C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2837xd\driverlib\cpu.h")
"C:\ti\F2837xD GCB\Device_support\F2837xD_common\include\F2837xD_Examples.h", line 301: warning #48-D: incompatible redefinition of macro "Device_cal" (declared at line 152 of "C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2837xd\driverlib\sysctl.h")
"C:\ti\F2837xD GCB\Device_support\F2837xD_common\include\F2837xD_GlobalPrototypes.h", line 76: error #41: expected an identifier
"C:\ti\F2837xD GCB\Device_support\F2837xD_common\include\F2837xD_GlobalPrototypes.h", line 76: error #80: expected a type specifier
"C:\ti\F2837xD GCB\Device_support\F2837xD_common\include\F2837xD_GlobalPrototypes.h", line 76: error #91: function returning function is not allowed"

The errors after these are within my own code so I can fix those. But I am unsure what to do about these above warnings and errors! Maybe something in my written user code is causing them to chuck out errors? Any advice on how these may be occuring and how to fix them?

Best wishes,
Joel

  • Joel,

    Looking at the first error message this is happening because the 2 header files in question are both defining EALLOW.  Now both of those header files come from C2000Ware and when I look at them I can see that they have #ifndef around the definition so this error should not occur.  However when I look at the path of the header file F2837xD_device.h in your build output I can see that it is coming from a folder outside of C2000Ware.  Thus I am guessing that someone made a copy of this file from an old verison of C2000Ware which didn't have the #ifndef around the definition.

    Let me explain a bit further.  If I look at F2837xd_device.h that comes with C2000Ware (on your machine this would be in C:\ti\C2000\C2000Ware_3_04_00_00\device_support\f2837xd\headers\include) I can see that the #define for EALLOW is wrapped in #ifndef 

    #ifndef EALLOW
    #define EALLOW __asm(" EALLOW")
    #endif

    Similarly if I look at the cpu.h file that comes with C2000Ware I see

    #ifndef EALLOW
    #ifndef __TMS320C28XX_CLA__
    #define EALLOW __eallow()
    #else
    #define EALLOW __meallow()
    #endif // __TMS320C28XX_CLA__
    #endif // EALLOW

    So the issue appears to be with the fact that you are pulling in the F2837xD_device.h file from C:/ti/F2837xD GCB/Device_support/F2837xD_headers/include instead of from the one inside C2000Ware  (C:\ti\C2000\C2000Ware_3_04_00_00\device_support\f2837xd\headers\include).

    Fixing your include path to pull in the correct file should resolve the error.

    For me I added ${C2000WARE_ROOT}/device_support/f2837xd/headers/include to my search path as shown below 


    Regards,

    John

  • Hi Joel,

    As John mentioned , the header which you are including "F2837xD_device.h" does not seem to come from C2000Ware folder .

    The latest version of C2000Ware v3.04.00.00 does have the #ifndef around the definition.

    Can you let me know the version of C2000Ware that you are using ?

    Best Regards

    Siddharth

  • Hi John, 

    Thank you very much - this seems to have solved my issue! However, I get a new set of errors now when I place the headers and commons includes into my directory from C2000Ware folder. This time, there are errors in the .C source files:


    **** Build of configuration CPU1_RAM for project HV_MPM1 ****

    "C:\\ti\\ccs1020\\ccs\\utils\\bin\\gmake" -k -j 4 all -O

    Building file: "../device/F2837xD_CodeStartBranch.asm"
    Invoking: C2000 Compiler
    "C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -Ooff --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/device_support/f2837xd/headers/include" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/device_support/f2837xd/common/include" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/libraries/DCL" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/libraries/calibration/hrpwm/f2837xd/include" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/device" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/driverlib/f2837xd/driverlib" --include_path="C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="device/F2837xD_CodeStartBranch.d_raw" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/CPU1_RAM/syscfg" --obj_directory="device" "../device/F2837xD_CodeStartBranch.asm"
    Finished building: "../device/F2837xD_CodeStartBranch.asm"

    Building file: "../CLA_Fly.cla"
    Invoking: C2000 Compiler
    "C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -Ooff --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/device_support/f2837xd/headers/include" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/device_support/f2837xd/common/include" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/libraries/DCL" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/libraries/calibration/hrpwm/f2837xd/include" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/device" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/driverlib/f2837xd/driverlib" --include_path="C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="CLA_Fly.d_raw" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/CPU1_RAM/syscfg" "../CLA_Fly.cla"
    Finished building: "../CLA_Fly.cla"

    Building file: "../MPM_CPU1.c"
    Invoking: C2000 Compiler
    "C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -Ooff --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/device_support/f2837xd/headers/include" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/device_support/f2837xd/common/include" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/libraries/DCL" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/libraries/calibration/hrpwm/f2837xd/include" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/device" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/driverlib/f2837xd/driverlib" --include_path="C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="MPM_CPU1.d_raw" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/CPU1_RAM/syscfg" "../MPM_CPU1.c"

    >> Compilation failure
    subdir_rules.mk:16: recipe for target 'MPM_CPU1.obj' failed
    "C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2837xd\common\include\F2837xD_GlobalPrototypes.h", line 127: error #41: expected an identifier
    "C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2837xd\common\include\F2837xD_GlobalPrototypes.h", line 127: error #80: expected a type specifier
    "C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2837xd\common\include\F2837xD_GlobalPrototypes.h", line 127: error #91: function returning function is not allowed
    3 errors detected in the compilation of "../MPM_CPU1.c".
    gmake: *** [MPM_CPU1.obj] Error 1
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****

    Can you help me out with what the errors are saying?

    Best wishes,

    Joel

  • Hi Joel,

    The issue could be that since both the driverlib and common paths are included  in the same project,  the IDLE function is resolving to a MACRO in  cpu.h rather than the sysctl file.

    You can predfine the symbol "_DUAL_HEADERS" in project properties since it is using a project with both driverlib and bitfield styles of source files. This would redefine the DUAL macro for you in the cpu.h so that the IDLE() API is resolved to the right file.

    Best Regards

    Siddharth

  • Hi Siddharth,

    That seems to have fixed it... no longer getting the errors! Well, a new set of errors, but hey Slight smile

    Is it as easy as literally just presing the + button and typing _DUAL_HEADERS, and nothing else? See below:

    This seems to have worked, but seems possibly too simple - nothing is usually this simple but I'll take it!

    Thanks for your help! Much appreciated John and Siddharth.

    Joel

  • Hi Joel,

    Glad that it's resolved. I will mark this thread as closed.

    Best Regards

    Siddharth