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: Using CCS Variables in source code

Tool/software: Code Composer Studio

Hello

I would like to define a variable in the CCS project properties and use it in the source code.

I have followed this instructions:

IT seems working fine but I would like to modify the value of the variable in the post build steps. I call a script in the post build steps and it return a value. I would like to give the variable created in the Project properties->Build->Variables tab the value that my script output.

I can do it in a dos command prompt, my script generate a temp file and then I assign its content to the variable in this way:

SET /P My_Variable_CRC=<$TempFile$

But when I do it in the post build steps, looks like My_varialble is not affected and it retain the value that I set in the properties->Build->Variables tab.

Thanks for your help

Giorgio

  • Giorgio,

    The variables shown in that article are CCS build variables.  The are something that is defined and used in the Eclipse/CCS build system.  At build time those variables get replaced with their defined values.  That enables you to use them in compiler/linker options, including -D as well as post build steps.  A post build step can use one of the variables but it is not able to define them. Plus the definition of those variables occurs prior to the post build step running.

    Pre-build steps run before the build but they just run a command and don't have a way to define those variables.

    I have seen other methods used such as running a pre-build step that is a script that generates an options file (which could include -D options) or generates a header file the has #defines in it.  The output of that pre-build step can be used in the build.

    Regards,

    John

  • Thanks for your support.

    I will follow your directions for a different method.

    Regards

    GIorgio