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.

CCSTUDIO: CCSTUDIO v20.4.0 breaks build, unable to differentiate between `<stdint.h>` integer types and integer keywords

Part Number: CCSTUDIO
Other Parts Discussed in Thread: C2000WARE, C2000-CGT, TMS320F28379D

A project that has compiled successfully in CCSTUDIO v20.3.1 now fails to compile immediately after an update to CCSTUDIO v20.4.0. Specifically, the issue lies in C2000Ware provided driverlib headers, where `<stdint.h>` types used in the headers cannot be resolved against the equivalent `unsigned` or `int` C keywords used in the builtins.

Notably, it seems the bundled C2000-CGT compiler version is 22.6.3 LTS, different from the previous CCS release's 22.6.2 LTS.

Below are snippets of the exact errors:

[106]".../driverlib/interrupt.h", line 484: error #313: cannot overload functions distinguished by return type alone
[107]".../driverlib/can.h", line 362: error #169: argument of type "int16_t *" is incompatible with parameter of type "int *"

 

Is there some sort of new project settings I must configure? I'm not sure why these compilation failures from `driverlib` are suddenly occurring.

 

Additional details: this is for a C28-core project, specifically the TMS320F28379D. In C++ source files, these are compilation failures. In C source files, the exact same errors appear as mere warnings instead.

  • Hi John,

    I'm sorry for the last reply. So it looks like in C2000-CGT 22.6.3 LTS the underlying type of int16/uint16_t in include/machine/_types.h has been changed.

    In 22.6.2 it was 


    #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

    and now it became

    #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

    so int was changed to short.

    But he driverlib still uses int/uint types like the older compiler. This discrepency is causing this issue.

    You can try the following things

    1. As a quick fix if you could switch back to 22.6.2. This issue will get fixed in the newer compiler releases. 

    2. Another workaround could be to make this change in \ti\ccs2040\ccs\tools\compiler\ti-cgt-c2000_22.6.3.LTS\include\machine\_types.h - change "typedef short" to "typedef int". After doing this you will need to rebuild RTS library with mklib.exe as per the C2000 compiler manual - TMS320C28x Optimizing C/C++ Compiler v22.6.0.LTS User's Guide (Rev. Z) (refer page 210)

    I understand that these aren't permanant fixes and I will notify the compiler team about this. 

    Could you try this and let me know if they work for you?

    Thanks and Regards,

    Ira

  • Hi John,

    Were you able to try this out?

    Thanks and Regards,

    Ira