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.

CCS/TMS320F28054F: Predefined Symbol with filename

Part Number: TMS320F28054F

Tool/software: Code Composer Studio

Dear all,

I have got an issue with Code Composer Studio (7.4.0) and CGT 18.1.1.LTS.

In my project I need to define a global symbol named "PROJ_CONF_H" which contains the name of a file named "Motor_project.h" with lots of "#define" directives to be included to my project.

I'm using the "Predefined Symbols" dialog of CCS project properties.

So far, it works fine.

But some of the symbols which are defined within the "Motor_project.h" file are not available at my project sources, so compilation fails.

If I define the relevant symbol also in the "predefined symbols" dialog, compilation works fine, but for re-use of the code this is not my prefered solution.

Do you have a suggestion what's going wrong here?

Is there a possibility to see, which symbols are defined when compiling the sourcs of the project?

Thanks a lot in advance for any help!

Jonas

  • Use --preinclude=Motor_project.h instead.  This option is available Include Options.

    Thanks and regards,

    -George

  • Hello George,

    thank you for your answer.

    Using the --preinclude=Motor_project.h works fine, unfortunately the conditional highlighting of defined respectively undefined symbols does not work anymore.

    So, one more question:

    I've read in the compiler user's guide (chapter 2.3.2) that predefining names can also be done within a seperaste file and the --cmd_file option.

    Maybe this is the best solution for defining the required symbol PROJ_CONF to the desired filename "Motor_project.h"?

    What do you think?

    Kind regards

    Jonas

  • The command file referenced by the compiler option --cmd_file is only processed by the compiler shell, which in your case is cl2000.  For that reason, that file cannot refer to CCS project variables like PROJ_CONF.

    Thanks and regards,

    -George

  • Yes, sure. The file cannot refer to project variables.

    But the other way works fine.

    In that cmd_file I define the symbol PROJ_CONF="Motor_project.h" by the line

    "--"define PROJ_CONF="\"Motor_project.h\""

    and all symbols I need are defined and syntax highlighting works fine, too.

    Thanks a lot

    Jonas