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.

TMS320F2800157: C2000Ware issue with f280015x header

Part Number: TMS320F2800157
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Hi,

I'm using the C2000Ware headers as part of both version 5.04 and 26.0.  When I include the header path,  I get:

"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: error #41: expected an identifier

The compiler is barking at IDLE below.  I made the mistake of editing my copy of this file on 5.4 to change IDLE to IDLE1.  Now that I've upgraded to 25.0 I'm seeing it again.  Is there a fix rather than me manually editing this?

I don't think I need this file and found that it's included from f280015x_device.h.  I saw that defining  __TMS320C28XX_CLA__ would bypass the include of f280015x_lin.h, but couldn't define it without getting an error.

Any suggestions would be greatly appreciated. 

struct SCIFLR_BITS {                    // bits description
    bp_16 BRKDT:1;                      // 0 Break-detect Flag (SCI compatible mode)
    bp_16 WAKEUP:1;                     // 1 Wake-up Flag
    bp_16 IDLE:1;                       // 2 SCI receiver in idle state (SCI compatible mode)
    bp_16 BUSY:1;                       // 3 Busy Flag
    bp_16 TIMEOUT:1;                    // 4 LIN Bus IDLE timeout Flag (LIN only)
    bp_16 rsvd1:1;                      // 5 Reserved
    bp_16 TOAWUS:1;                     // 6 Timeout After Wakeup Signal Flag (LIN only)
    bp_16 TOA3WUS:1;                    // 7 Timeout After 3 Wakeup Signals Flag (LIN only)
    bp_16 TXRDY:1;                      // 8 Transmitter Buffer Ready Flag
    bp_16 RXRDY:1;                      // 9 Receiver Buffer Ready Flag
    bp_16 TXWAKE:1;                     // 10 SCI Transmitter Wakeup Method Select
    bp_16 TXEMPTY:1;                    // 11 Transmitter Empty Flag
    bp_16 RXWAKE:1;                     // 12 Receiver Wakeup Detect Flag
    bp_16 IDTXFLAG:1;                   // 13 Identifier On Transmit Flag (LIN only)
    bp_16 IDRXFLAG:1;                   // 14 Identifier on Receive Flag
    bp_16 rsvd2:1;                      // 15 Reserved
    bp_32 rsvd3:8;                      // 23:16 Reserved
    bp_32 PE:1;                         // 24 Parity Error Flag
    bp_32 OE:1;                         // 25 Overrun Error Flag
    bp_32 FE:1;                         // 26 Framing Error Flag
    bp_32 NRE:1;                        // 27 No-Response Error Flag (LIN only)
    bp_32 ISFE:1;                       // 28 Inconsistent Sync Field Error Flag (LIN only)
    bp_32 CE:1;                         // 29 Checksum Error Flag (LIN only)
    bp_32 PBE:1;                        // 30 Physical Bus Error Flag (LIN only)
    bp_32 BE:1;                         // 31 Bit Error Flag (LIN only)
};
  • Hi John,

    The error you're hitting is a naming collision: the IDLE bitfield member in SCIFLR_BITS conflicts with a reserved keyword or macro definition in the TMS320C28x compiler environment. This is a persistent issue across C2000Ware versions — it wasn't fixed between 5.04 and 26.0 — which is why your manual IDLE → IDLE1 edit keeps getting wiped out with each upgrade.

    f280015x_lin.h is automatically pulled in by f280015x_device.h, meaning it gets compiled even when your project has no LIN functionality. There's currently no official TI patch for this specific conflict in C2000Ware 26.00.00.00.

    Instead of editing the TI-provided file directly, create a wrapper header that uses a #define to rename IDLE before the TI header is parsed, then #undef it afterward. This approach is consistent with how TI itself handles similar keyword conflicts for other reserved identifiers.

    // In your project's wrapper or preinclude header:
    #define IDLE IDLE_LIN
    #include "f280015x_lin.h"
    #undef IDLE_LIN

    Note - if IDLE is defined as a macro elsewhere in your toolchain, this rename needs to happen before that definition is visible.

    A cleaner variant is to use a forced include / preinclude file in your compiler settings (CCS: Project → Properties → C/C++ Build → Tool Settings → Predefined Symbols / Advanced) so the rename applies globally without touching any TI files.

    Thanks,

    Ira

  • Hi Ira,

    What is presented makes sense, but I'm unclear on the implementation.  My include that's pulling in f280015x_lin.h is below.

    #include "f280015x_device.h"
    I've tried bounding it with the #define/#undefine and that gives me the same error.
    I'm using CCS 20.5 and the complier settings aren't under the same path provided.
    Can you help?
    John
  • Hi John,

    The steps for CCS 20.5 would be as follows: -

    1. Go to your project explorer and right click on the project.

    2.1 See Properties -> C2000 Compiler -> Include Options

    2.2 See Properties -> C2000 Compiler -> Pre-defined symbols

    3. Compare your inlcude options and pre-defined symbols against the example C:\ti\c2000\C2000Ware_x_xx_xx_xx\device_support\f280015x\examples\empty_bitfield

    Can you tell me if they match exactly?

    If you're still hitting errors after adding the include path, sharing the exact error message and your specific F280015x device variant (e.g., F2800157 vs. F2800156) would help narrow it down further — particularly to rule out the LIN availability issue or a path variable misconfiguration.

    Thanks,

    Ira

  • Hi Ira,

    I'm still unclear on how to cause the compiler to bypass pulling in f280015x_lin.h since I'm using the following include:

    #include "f280015x_device.h"

    There are a few minor differences between the empty_bitfield project and mine.  Empty_bitfield is below

    • ${COM_TI_C2000WARE_SYMBOLS}
    • CPU1

    My project:

    • ${SYSCONFIG_TOOL_SYMBOLS}
    • ${COM_TI_C2000WARE_SYMBOLS}
    • DEBUG
    • _FLASH
    • _LAUNCHXL_F2800157

    Below is the full compile output for one of my files:

    C2000 Compiler - building file: "../Source/XC_CPLD.c"
    "C:/ti/ccs2050/ccs/tools/compiler/ti-cgt-c2000_25.11.0.LTS/bin/cl2000" -v28 -ml -mt --float_support=fpu32 --tmu_support=tmu0 -Ooff --include_path="C:/ti/C2000/C2000Ware_26_00_00_00" --include_path="C:/Users/jtreubig/OneDrive - STERIS Corporation/ti/CMAX/include" --include_path="C:/Users/jtreubig/OneDrive - STERIS Corporation/ti/CMAX/device" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/driverlib/f280015x/driverlib/" --include_path="C:/ti/ccs2050/ccs/tools/compiler/ti-cgt-c2000_25.11.0.LTS/include" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/libraries/flash_api/f280015x/include/FlashAPI" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/device_support/f280015x/headers/source" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/device_support/f280015x/headers/include" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/libraries/math/FPUfastRTS/c28/include" --define=DEBUG --define=_FLASH --define=_LAUNCHXL_F2800157 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="Source/XC_CPLD.d_raw" --include_path="C:/Users/jtreubig/OneDrive - STERIS Corporation/ti/CMAX/CPU1_LAUNCHXL_FLASH/syscfg" --obj_directory="Source" --cmd_file="syscfg/board.opt" --cmd_file="syscfg/c2000ware_libraries.opt" "../Source/XC_CPLD.c"
    [64]"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: error #41: expected an identifier
    [65]"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: error #80: expected a type specifier
    [66]"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: error #170: a function type is not allowed here
    [67]"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: warning #109-D: signed bit field of length 1
    3 errors detected in the compilation of "../Source/XC_CPLD.c".

    Look forward to your help,

    John

  • Hi John,

    When you #include "f280015x_device.h", it automatically chains in f280015x_lin.h as part of the full device peripheral header set. That's expected and unavoidable behavior for the F280015x family.

    The errors at line 236 of f280015x_lin.h:
    error #41: expected an identifier
    error #80: expected a type specifier
    error #170: a function type is not allowed here
    are triggered by the identifier IDLE inside the SCIGCR1_BITS struct (the line reads Uint16 IDLE:1;). Your project includes both driverlib headers (note --include_path=".../driverlib/f280015x/driverlib/" in your compile command) and bitfield headers (f280015x_device.h). Driverlib defines IDLE as a macro or enum value, and when the bitfield header tries to use IDLE as a struct member name, the preprocessor has already replaced it - producing the syntax garbage the compiler is complaining about.
    The empty_bitfield project doesn't hit this because it's a pure bitfield project with no driverlib includes in the path, so there's no conflicting IDLE definition in scope.
    Can you try the following steps to fix this?
    1. Right-click on Project -> Properties -> C2000 Compiler -> pre-defined symbols.
    2. Add the symbol DUAL_HEADERS manually and save changes.
    TI provides the DUAL_HEADERS preprocessor symbol specifically for projects that mix driverlib and bitfield headers. It activates guards within the headers that prevent shared identifiers (like IDLE) from colliding during preprocessing.It is added to avoid such conflicts in enums/structs/macros which share the exact same names in bitfield and driverlib headers.
    Can you try this and let me know if it works?
    Thanks,
    Ira
  • Hi Ira,

    Thanks for the suggestion, but I still get the same error messages.  Including how I inserted the symbol so you can check me.

    C2000 Compiler - building file: "../Source/XC_CPLD.c"
    "C:/ti/ccs2050/ccs/tools/compiler/ti-cgt-c2000_25.11.0.LTS/bin/cl2000" -v28 -ml -mt --float_support=fpu32 --tmu_support=tmu0 -Ooff --include_path="C:/ti/C2000/C2000Ware_26_00_00_00" --include_path="C:/Users/jtreubig/OneDrive - STERIS Corporation/ti/CMAX/include" --include_path="C:/Users/jtreubig/OneDrive - STERIS Corporation/ti/CMAX/device" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/driverlib/f280015x/driverlib/" --include_path="C:/ti/ccs2050/ccs/tools/compiler/ti-cgt-c2000_25.11.0.LTS/include" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/libraries/flash_api/f280015x/include/FlashAPI" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/device_support/f280015x/headers/source" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/device_support/f280015x/headers/include" --include_path="C:/ti/C2000/C2000Ware_26_00_00_00/libraries/math/FPUfastRTS/c28/include" --define=DEBUG --define=_FLASH --define=_LAUNCHXL_F2800157 --define=DUAL_HEADERS --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="Source/XC_CPLD.d_raw" --include_path="C:/Users/jtreubig/OneDrive - STERIS Corporation/ti/CMAX/CPU1_LAUNCHXL_FLASH/syscfg" --obj_directory="Source" --cmd_file="syscfg/board.opt" --cmd_file="syscfg/c2000ware_libraries.opt" "../Source/XC_CPLD.c"
    [64]"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: error #41: expected an identifier
    [65]"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: error #80: expected a type specifier
    [66]"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: error #170: a function type is not allowed here
    [67]"C:\ti\C2000\C2000Ware_26_00_00_00\device_support\f280015x\headers\include\f280015x_lin.h", line 236: warning #109-D: signed bit field of length 1
    3 errors detected in the compilation of "../Source/XC_CPLD.c".

    I will be glad to try any other solution and thanks for the help,

    John

  • Hi,

    Let me check with the team and get back to you.

    Thanks,

    Ira

  • Can you also try:

    1.Using  _DUAL_HEADERS 

    2. Keeping both DUAL_HEADERS and _DUAL_HEADERS.

    3. Your build uses ti-cgt-c2000_25.11.0.LTS, but C2000Ware 26.00.00.00 was validated against compiler version 22.6.2.LTS. Compiler 25.11.0.LTS introduced a breaking type definition change:

    • uint16_t was changed from unsigned intunsigned short
    • C2000Ware still defines Uint16 as unsigned int
    • This mismatch causes struct/bitfield declarations to fail in ways that look like identifier errors [3]

    Recommended action: Downgrade your compiler to ti-cgt-c2000_22.6.2.LTS and try

    4. Is it possible to use only driverlib headers in your code? This will remove the conflict entirely. Or is it necessary to use both driverlib and bitfield in your project?

    Thanks,

    Ira

  • Hi Ira,

    Tried the  _DUAL_HEADERS and it cures the problem.  The compiled results are exactly the same as my modified f280015x_lin.h file, which helps me, since I have already sent my ROM file to my vendor to build my assemblies.

    Thanks for your expert help!

    John