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.

TMS320F280039: Modifications to int16_t and uint16_t type in C2000-CGT-v22.6.3

Part Number: TMS320F280039
Other Parts Discussed in Thread: C2000WARE

C2000ware version:6.00.01

In my project, I used both bitfield and driverlib, and referenced their header files using relative paths, as shown below:

image.png

I found that when I upgraded the compiler version from 22.6.2 to 22.6.3, the project that could compile normally before started to have compilation errors.

Building file: "../Sources/device.c"
Invoking: C2000 Compiler
"C:/ti/ccs1281/ccs/tools/compiler/ti-cgt-c2000_22.6.3.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --idiv_support=idiv0 --isr_save_vcu_regs=off --tmu_support=tmu1 --vcu_support=vcrc -O0 --opt_for_speed=3 --fp_mode=relaxed --include_path="C:/ti/c2000/C2000Ware_6_00_01_00" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/utilities/clb_tool/clb_syscfg/systemc/include" --include_path="C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers" --include_path="C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/FLASH_DEBUG/syscfg" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/device_support/f28003x/headers/include" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/driverlib/f28003x/driverlib" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/libraries/flash_api/f28003x/include/FlashAPI" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/libraries/calibration/hrpwm/f28003x/include" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/libraries/math/FPUfastRTS/c28/include" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/libraries/dsp/FPU/c28/examples/common" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/libraries/dsp/FPU/c28/include" --include_path="C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/libraries/math/CLAmath/c28/include" --include_path="C:/ti/ccs1281/ccs/tools/compiler/ti-cgt-c2000_22.6.3.LTS/include" --include_path="C:/ti/c2000/C2000Ware_6_00_01_00/libraries/dsp/VCU/c28/include" --advice:performance=all --define=FLASH --define=_FLASH --define=_DEBUG -g --float_operations_allowed=32 --fp_single_precision_constant --diag_suppress=303 --diag_suppress=148 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --cla_signed_compare_workaround=on -k --preproc_with_compile --preproc_dependency="Sources/device.d_raw" --include_path="C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/FLASH_DEBUG/syscfg" --obj_directory="Sources" --cmd_file="syscfg/board.opt" --cmd_file="syscfg/c2000ware_libraries.opt"  "../Sources/device.c"
 
>> Compilation failure
Sources/subdir_rules.mk:9: recipe for target 'Sources/device.obj' failed
"C:\ti\c2000\C2000Ware_6_00_01_00\driverlib\f28003x\driverlib\cpu.h", line 61: error #148: declaration is incompatible with "volatile unsigned int IFR" (declared at line 55 of "C:/ti/c2000/C2000Ware_6_00_01_00/device_support/f28003x/headers/include/f28003x_device.h")
"C:\ti\c2000\C2000Ware_6_00_01_00\driverlib\f28003x\driverlib\cpu.h", line 68: error #148: declaration is incompatible with "volatile unsigned int IER" (declared at line 56 of "C:/ti/c2000/C2000Ware_6_00_01_00/device_support/f28003x/headers/include/f28003x_device.h")
"C:\ti\c2000\C2000Ware_6_00_01_00\driverlib\f28003x\driverlib\interrupt.h", line 481: warning #1853-D: declaration hides built-in function "__disable_interrupts"
"C:\ti\c2000\C2000Ware_6_00_01_00\driverlib\f28003x\driverlib\interrupt.h", line 482: warning #1853-D: declaration hides built-in function "__enable_interrupts"
"C:/ti/c2000/C2000Ware_6_00_01_00/driverlib/f28003x/driverlib/can.h", line 359: warning #169-D: argument of type "int16_t *" is incompatible with parameter of type "int *"
"C:/ti/c2000/C2000Ware_6_00_01_00/driverlib/f28003x/driverlib/can.h", line 407: warning #169-D: argument of type "int16_t *" is incompatible with parameter of type "int *"
"C:/ti/c2000/C2000Ware_6_00_01_00/driverlib/f28003x/driverlib/can.h", line 456: warning #169-D: argument of type "int16_t *" is incompatible with parameter of type "int *"
"C:/ti/c2000/C2000Ware_6_00_01_00/driverlib/f28003x/driverlib/can.h", line 497: warning #169-D: argument of type "int16_t *" is incompatible with parameter of type "int *"
"C:/ti/c2000/C2000Ware_6_00_01_00/driverlib/f28003x/driverlib/lin.h", line 696: warning #169-D: argument of type "int16_t *" is incompatible with parameter of type "int *"
"C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/device.h", line 379: error #148: declaration is incompatible with "Uint16 RamfuncsLoadStart" (declared at line 242 of "C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/f28003x_globalprototypes.h")
"C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/device.h", line 380: error #148: declaration is incompatible with "Uint16 RamfuncsLoadEnd" (declared at line 243 of "C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/f28003x_globalprototypes.h")
"C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/device.h", line 381: error #148: declaration is incompatible with "Uint16 RamfuncsLoadSize" (declared at line 244 of "C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/f28003x_globalprototypes.h")
"C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/device.h", line 382: error #148: declaration is incompatible with "Uint16 RamfuncsRunStart" (declared at line 245 of "C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/f28003x_globalprototypes.h")
"C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/device.h", line 383: error #148: declaration is incompatible with "Uint16 RamfuncsRunEnd" (declared at line 246 of "C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/f28003x_globalprototypes.h")
"C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/device.h", line 384: error #148: declaration is incompatible with "Uint16 RamfuncsRunSize" (declared at line 247 of "C:/Users/pcbcj/Git_Project/server_psu_54v_3200w_llc_28003x/Headers/f28003x_globalprototypes.h")
8 errors detected in the compilation of "../Sources/device.c".
gmake: *** [Sources/device.obj] Error 1

This is because in version 22.6.3, the definitions of uint16_t were changed from unsigned int to unsigned short. However, in C2000ware, the definition of Uint16 is still unsigned int. Therefore, my project throws an error when compiling source files with the following header file.

image.pngimage.png

While int and short are equivalent in C2000, the compiler considers them to be of different types and reports errors.

  • I observed the same issue with new compiler v22.6.3 in 28388D

  • Thank you for notifying us of this issue.  I am able to reproduce the same behavior.  I filed EXT_EP-13044 to have it investigated.  You are welcome to follow it with that link.

    Thanks and regards,

    -George

  • The _types.h file in the following path also has the same problem.

    C:\ti\ccs1220\ccs\tools\compiler\ti-cgt-c2000_22.6.3.LTS\include\machine

    V22.6.3 V22.6.0

    #if defined(__TMS320C28XX_CLA__)
    typedef short __int16_t;
    typedef unsigned short __uint16_t;
    typedef int __int32_t;
    typedef unsigned int __uint32_t;
    #else
    typedef short __int16_t;
    typedef unsigned short __uint16_t;
    typedef long __int32_t;
    typedef unsigned long __uint32_t;
    #endif

    ##if defined(__TMS320C28XX_CLA__)
    typedef short __int16_t;
    typedef unsigned short __uint16_t;
    typedef int __int32_t;
    typedef unsigned int __uint32_t;
    #else
    typedef int __int16_t;
    typedef unsigned int __uint16_t;
    typedef long __int32_t;
    typedef unsigned long __uint32_t;
    #endif

    After upgrading the compiler version to 22.6.3, an error occurred.

    Description Resource Path Location Type
    #169-D argument of type "int16_t *" is incompatible with parameter of type "int *

  • Above issue was a result of the fix for https://sir.ext.ti.com/jira/browse/EXT_EP-12834 
    An updated fix for EXT_EP-12834 will be made and can be tracked with EXT_EP-13044

    In the meantime, for 22.6.3.LTS and 25.11.0.LTS, below workarounds can be used:
    Use only consistent type definitions from stdint.h

    Or undo below fix from EXT_EP-12834 in include/machine/_types.h
    and then rebuild the RTS library using mklib.exe per spru514 user guide.
    #else
    typedef short __int16_t;
    typedef unsigned short __uint16_t;
    To instead have this:
    #else
    typedef int __int16_t;
    typedef unsigned int __uint16_t;