CCSTUDIO-THEIA: CCS 20.4.0 – Unable to Navigate to DriverLib Function Definitions (C2000Ware)

Part Number: CCSTUDIO-THEIA
Other Parts Discussed in Thread: C2000WARE, TMS320F28388D

In CCS 20.4.0, I imported the C2000Ware example
timer1_ex1_cputimers from:

ti/c2000/C2000Ware_xxx/driverlib/f2838x/examples/c28x

The code uses DriverLib APIs such as:

CPUTimer_setPeriod(CPUTIMER0_BASE, 0xFFFFFFFF);

The project builds, runs, and debugs correctly, and DriverLib is included properly.
However, when I try to navigate to the function definition, CCS shows:

“No references found for ‘CPUTimer_setPeriod’”

(This happens for many DriverLib functions; CPUTimer_setPeriod is just one example.)

This works correctly in CCS 12.8, but fails in CCS 20.4.0.
I see the same behavior on multiple machines.

Is this a known CCS 20.4.0 indexer issue, or is there a setting I need to enable?

  • I may have identified the cause of the issue.

    It looks like a bug to me, although I’m not certain whether this is the intended behavior.
    In the cputimer.h header file, all CPUTimer-related functions (such as CPUTimer_setPeriod) are enclosed within the following macro condition:

    #ifdef __TMS320C28XX__
        ...
    #endif

    The target device is a TMS320F28388D board, so this macro should be defined by default by the cl2000 compiler, since the target architecture is C28x.

    Can anyone confirm whether __TMS320C28XX__ is automatically defined in this case?

  • Hello Nic,

    Apologies for the delay, it looks like this thread got misrouted in E2E. I've assigned this to the correct expert now.

    Best,

    Matt

  • Hi Nic,

    The __TMS320C28XX__ macro is defined by the c2000 compiler. In order to verify this, you can try the following steps. 

    1. Right click on your project -> Properties -> C2000 Compiler -> Advanced Options -> Parser Processing Options

    2. Enable the option Generate list of pre- & user-defined macros (--preproc_macros, -ppm).

    3. Create an empty .txt file in your project and give the path to that file as the input in the field next to the above option. 

    4. Build the project and then open your .txt file. You will see the __TMS320C28XX__ defined there. It should look something like this. 

    That being said, even though the compiler automatically defines this macro, it is possible that the code indexer (responsible for operations like "Show Definition" when you right click on a function) may not have it defined. 

    For now, a workaround solution could be to define __TMS320C28XX__, in Project -> Properties -> C2000 Compiler -> Predefined symbols. 

    After this, build the project and you should be able to navigate to the function definition.

    I will check with the team as to why the code indexer cannot see the same predefined macros that the compiler sets in CCS 20.4.

    Thanks and Regards,

    Ira

  • Hi Ira,

    thank you for the detailed explanation.

    I tried the first approach you suggested. The .txt file containing the list of predefined macros is generated correctly, and I can confirm that __TMS320C28XX__ is indeed defined there. However, even after this, the CCS 20.4 indexer is still not able to navigate to the function definition.

    I had already tested the second workaround (manually defining __TMS320C28XX__ in Project → Properties → C2000 Compiler → Predefined Symbols), and that does resolve the issue for the indexer.

    My concern was mainly whether I was missing something, since this macro should already be defined automatically given that the target is a C28x device. While manually defining it is not a big issue in this small project, in larger projects it can become difficult to understand which macro needs to be predefined to enable the indexer—especially if the required macro is not obvious or documented.

    Thanks again for the support, and I appreciate you checking with the team about the indexer behavior.

    Nic

  • Hi Nic,

    It seems like the symbol needs to be added while defining the .projectspec file for the CCS example or the code indexer in CCS. I will bring it to the attention of the c2000Ware/ CCS team. 

    Thanks and Regards,

    Ira