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.

CODECOMPOSER: Global "Variables" not working as expected

Part Number: CODECOMPOSER

Tool/software:

Hi, there.

With CCS 20.0.0, I define a global variable in "File > Settings > Code Composer Studio Settings... > General > Variables". The variable type is "Path" so that it can be resolved for linked file path. But it is not working. The compiler will complain the file path is incorrect. If I define the variable in project's "Properties > General > Variables" then it works well.

Since I have a dozen of projects using shared source code and libraries, it will be very inconvenient to define the same variable in each project.

Can anyone confirm this issue?

Robert.

  • Hello Robert,

    I can't seem to reproduce this error. Any variable I set at the workspace level is also available from the project. I created both directory and path variables at the workspace level and both were available at the project level to use for linked files. 

    For the project, under "Properties > General > Variables", when you select "show both user-defined and system variables" does the workspace level variable appear in the list (it does for me)?

    Thanks

    ki

  • Hi Ki,

    Yes, the workspace level variables are shown when "show both user-defined and system variables" is selected.

    I think this issue is very strange because it does work for the 1st time when I set a path variable. Then, somehow, after the CCS is closed and opened again, it won't work any more. Then I try to remove it and set it again, it no longer work.

    Robert.

  • Then, somehow, after the CCS is closed and opened again, it won't work any more. Then I try to remove it and set it again, it no longer work.

    I still can't reproduce this issue. Once I use the workspace level variable in a project for a linked resource, I have no issues with the linked resource despite multiple CCS restarts.

    Can you provide a detailed test case with an example project I can import?

  • I test it again today.

    1. In workspace variables, define a path variable "PICOS" to "/Users/Robert/Documents/Codebase/PicOS".

    2. In project's variables, remove the path definition with the same name.

    3. Check the linked files... all are resolved.

    4. Try to build the project... no problem.

    4. Quiet CCS and open it again.

    5. Open project's variables list with "Show both user-defined and system variables." Variable PICOS is still there.

      

    6. In Explorer, expand the project's files. Now "unresolved" are shown for linked files.

    7. Try to build the project. The compiler shows errors about the file path.

    Robert.

  • Thanks for providing your test case, I will try this out and see if I can reproduce

  • I tried your test case but I was not able to reproduce. Am I missing something?

  • I think the configured path is saved in inconsistent places. After I created a workspace, a file named "MyWorkspace.theia-workspace" is created. But the content only contains the project folders. Do you know where (in the file system) the path variables are saved?

  • After I created a workspace, a file named "MyWorkspace.theia-workspace" is created

    Sounds like you are working with multi-root workspaces:

    https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_project-management.html#multi-root-workspace

    I did want to warning you about one potential issue with multi-root workspaces and debugging projects:

    https://sir.ext.ti.com/jira/browse/EXT_EP-12046

    Do you know where (in the file system) the path variables are saved?

    Project level variables are stored in the project but workspace level ones are likely stored in workspace cache folder:

    https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_troubleshooting.html#delete-workspace-cache

    I'll need to take a look to confirm. 

  • I did try to reproduce the issue with a multi-root workspace environment but again was unsuccessful. Does the issue occur in a single workspace folder environment?

  • I did notice this potential issue. When I add debug configuration and save it. All the content of the .theia-workspace file will be cleared. So I add it manually to overcome this issue. It's good that you already know this issue.

    Multi-root workspace has to be used for my current project for related libraries (projects). But I will test single workspace folder later.

    I think there is something with my workspace cache folder. I would like to delete the cache and create a new workspace.

  • I think there is something with my workspace cache folder. I would like to delete the cache and create a new workspace.

    To start fresh, see: https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_faqs.html#i-want-to-restart-code-composer-studio-with-a-fresh-environment-how-do-i-do-this

  • Hi Robert,

    I did notice this potential issue. When I add debug configuration and save it. All the content of the .theia-workspace file will be cleared. So I add it manually to overcome this issue. It's good that you already know this issue.

    Multi-root workspace has to be used for my current project for related libraries (projects).

    Note that we have a fix for the multi-root workspace issue. The fix is available in our latest CCS 20.0.2 release. We are wondering if you had a chance to try this version and if multi-root workspaces are working well for you.

  • Hi Ki,

    I have tested the global variable issue at CCS 20.0.2. It is fixed. Thanks!

    Btw, it still takes about 1 minute to launch CCS on macOS. Hope this can be fixed as soon as possible.

    Robert.

  • Thank for for the update. 

    How about multi-root workspaces? Is that now working well also?

    Btw, it still takes about 1 minute to launch CCS on macOS. Hope this can be fixed as soon as possible.

    We will have a fix for CCS 20.1.0 (end of this month). Would you be interested in trying a beta when it is available?

    Thanks

    ki

  • Hi Ki,

    Yes, I tested it under multi-root workspace. My project requires multi-root workspace.

    I can test beta version. Just give me the download link when it is available.

    Robert.

  • Yes, I tested it under multi-root workspace. My project requires multi-root workspace.

    Great, thank you for confirming!

    I can test beta version. Just give me the download link when it is available.

    Yes, will do.

    ki

  • Hi Robert, 

    I sent you a private E2E message regarding the beta version of 20.1.0. 

    Thanks

    ki