CODECOMPOSER: Creating project to the same folder from a project-spec with command Line

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: MSPM0L2228

Tool/software:

I need to use the CCS command line to create a project from a project-spec file, but without moving the files to another folder.

For example, my workspace is in c:\user_name\workspace_ccstheia, and in this workspace folder I already have all the source files and a project-spec file needed to create a project, these files are in c:\user_name\workspace_ccsthe\demo_project. I would like to create the project files from the project-spec and the source files to the same folder(c:\user_name\workspace_ccsthe\demo_project), because the source files need to stay in this folder rather than be copied to another folder.

In CCS GUI, I can use the "Import project" option to successfully create the project, but in CCS command line, an error will appear with the prompt "A project with name 'demo_project' already exists in workspace", regardless the project files does not exist at this moment. I think the command line simply decide the duplication based on the folder name, rather than checking inside the folder.

Is it possible to have the command line behave like the GUI to allow creating the project in the same folder?

Best regards,

Shuyang

  • Two more questions:

    1. I tried to use the com.ti.ccs.apps.importProject command instead of com.ti.ccs.apps.createProject, but the import command does not recognize .projectspec file. Is this expected behavior or a bug in CCS20?

    2. I tried to create a project first, then modify the project files(.project, .ccsproject, .cproject) to achieve my goal, but it seems these project files have to be in the project root folder. Is there a way to place the project files to a different folder rather than PROJECT_ROOT? Or Is there a way to specify PROJECT_ROOT during importing a project?

    Best regards,

    Shuyang

  • I think the command line simply decide the duplication based on the folder name, rather than checking inside the folder.

    I think you are correct. I will need to follow up with engineering to confirm.

  • 1. I tried to use the com.ti.ccs.apps.importProject command instead of com.ti.ccs.apps.createProject, but the import command does not recognize .projectspec file. Is this expected behavior or a bug in CCS20?

    This is expected behavior. A projectspec is not a real project but a template of one. importProject is for an actual (real) CCS projects. createProject needs to be used to create a project from a projectspec.

    2. I tried to create a project first, then modify the project files(.project, .ccsproject, .cproject) to achieve my goal, but it seems these project files have to be in the project root folder. Is there a way to place the project files to a different folder rather than PROJECT_ROOT? Or Is there a way to specify PROJECT_ROOT during importing a project?

    These files are generated and CCS expects them to be in the root location of the project folder. It is not recommended to manually modify them (except in rare circumstances) and need to be in the root project folder location.

    Thanks

    ki

  • Hi Ki,

    Thanks for the reply. Please let me elaborate on the use case: the request is from a customer, they have this project which supports multiple silicon devices, to build the project they created a Python script to add the required files and configurations to the project files, then build the project through command line.

    The project folder looks like this:

    demo_project
    ├─ User code
    | ├─ lib
    | └─ toolchain └─ CCS
     └─ IAR
     └─ Keil

    The project files need to be located in seperate folder like CCS/IAR/Keil, so no project file exists in project root folder.
    It looks using the project spec is the only way to achieve the goal, since the .projectspec can be placed in any folder.
    Can you please help follow up on the original question that if it is possible to create a project in its own folder using command line, just like the GUI IDE does?
    Best regards,
    Shuyang
     
  • Can you please help follow up on the original question that if it is possible to create a project in its own folder using command

    It looks like it is possible. I tried it out and it worked for me.

    See my example:

    My workspace folder is "workspace_ccstheia" in my user folder. Inside that folder is a folder called "adc12_monitor_supply_LP_MSPM0L2228_nortos_ticlang". Inside that folder there is a subfolder called "ticlang". Inside that folder is a projectspec file "adc12_monitor_supply_LP_MSPM0L2228_nortos_ticlang.projectspec" which I want to import to my current workspace folder.

    So I run the command to create a project based on the projectspec:

    You can see that the project create succeed. There are some warning about source files already existing which is fine. They key thing is that the project was created. You can now see the .*project files and the targetConfigs and .settings folders in the project folder "adc12_monitor_supply_LP_MSPM0L2228_nortos_ticlang" that was just generated when the project was created.

    So this seems to work.

    What I suspect is happening is that you previously imported successfully with the IDE and then you left the main "demo_project" subfolder alone and then deleted the project files inside thinking you deleted the project from the workspace. That actually is not enough. You also need to make sure the project information in the workspace metadata is cleared. If you did not, then CCS will still think the project is imported and will prevent you from doing it again (whether from command line or IDE).

    Thanks

    ki

  • Hi Ki,

    You are right on the spot! After clearing the metadata cache I am able to create the project. Thank you so much for the help!

    Best regards,

    Shuyang