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.

CCSTUDIO: CCS Project Copy & Paste Issue

Part Number: CCSTUDIO
Other Parts Discussed in Thread: MOTORWARE, C2000WARE

I'm trying to copy a Motorware lab project and use it as a beginning for a custom motor controller board.  I copy and rename the project when I paste it but when I go to build it seems to be trying to build the old main project c file name.  I've seen similar questions on this topic and it was suggested to Export and then Import the project.  However, the Export Wizard doesn't have an option to export CCS project, but the Import Wizard does.  What is the proper way to copy an existing project for use as a new starting point.  The documentation says copy/paste is the preferred way to start a new project versus using the create new wizard.  Any help would be appreciated.

  • John,

    If the project includes "linked files" then when you do a copy and paste both projects are pointing to the same source file as the file was not in the original project to begin with.  There is a little more information on that here:

    https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-management.html#copying-projects

    You can tell if a file is linked by looking at the file icon in Project Explorer.  If it has a little arrow on it then it is a linked file.  I suspect that is what is happening here.  I just imported an example from the C2000Ware MotorControl SDK for one of the labs and the files are setup as linked.  

    For the main C2000Ware package the C2000 team has changed this so that the majority of examples create a copy of the source.  However it does not look like they have done this for the MotorControl SDK yet.

    This is a bit of a pain to work around but the export feature will do the trick.  

    Try this:

    • From the File menu select Export.
    • Then select General -> Archive file
    • Check the box beside the project to include in the archive
    • Check the option to "Resolve and export linked resources"
    • Specify a name for the zip
    • Click Finish

    Now you have a zip that has all the files.  

    • Rename the project that is in your workspace to something else or create a new workspace.  We need to do this as the project in the zip will have the same name.  I would recommend a new workspace as you can get into issues with the fact that the folder in the workspace for the old project is the same name as the one that we will be importing.
    • Now we are going to import the exported project.  Project -> Import CCS Projects
    • Change the selection to "Select archive file"
    • Specify the zip that you just exported
    • Check the box beside the project
    • Click Finish

    You should now have a project where all the files are actually in the project.  For me the import took a while, probably because there were a LOT of linked files.

    Now it should be easy to make a copy of the new project by just doing a copy paste.

    Regards,

    John

  • Hi John,

    Thanks for the assistance.  I tried this a couple of times are still not working.  It looks like the include paths are not being updated relatively as the compiler isn't able to find the TI Motorware include/driver files.  Below are snap shots of the include paths for the original project followed by it's copy.  Doesn't look like the path variables are being updated correctly with the import? 

    Original 

    Imported Project

    Here is the compiler flags in build settings for the original

    Imported project

    You can see the include flags are missing the correct paths from the root.  I'm just not sure which variables to update and where.

  • Can you take a look at the include paths here:

    There is probably a base level variable like the ${MCSDK_ROOT} shown above but for MotorWare.

    For me the SDK is setup as a product here:

    Then there are variables here:

    You could add any missing variables and their paths by clicking on the Add button.

    Regards,

    John

  • I think you've hit the nail on the head.  Here is my include directories

    However, the MW_INSTALL_DIR uses PROJECT_ROOT, which it probably shouldn't.

  • However, if I just go in and change [$PROJECT_ROOT} to the actual path to the MW (MotorWare) drivers and such it still doesn't work.

  • I corrected the MW_INSTALL_DIR many of the issue went away.

    However, it's not finding user.h and main.h.  I guess they didn't get zipped up with everything else?

    subdir_rules.mk:16: recipe for target 'hal.obj' failed
    "C:\ti\motorware\motorware_1_01_00_18\sw\modules\hal\boards\drv8301kit_revD\f28x\f2806x\src\hal_obj.h", line 70: fatal error #1965: cannot open source file "user.h"
    1 catastrophic error detected in the compilation of "../hal.c".
    Compilation terminated.
    gmake: *** [hal.obj] Error 1

  • John,

    If user.h and main.h were just referenced with #include in source then they would not be part of the zip as the project itself has no reference to them.  

    For the example that I imported I can see that user.h that is being included is inside the MotorControl SDK.  I am betting that there are several copies of it inside of MotorWare as the one that my project is using is in a board-specific folder.

    Changing the MW_INSTALL_DIR to be the full path to motorware is a good idea.  

    Do you still have the working original copy of the project?  If so if you open user.h you can put the mouse over the tab and that will show the full path of where the file is.  You could then use that to update the search path in the new copy.

    Regards,

    John

  • John,

    Yup, I still have the originals and have found the include files.  To summaries, I'm setting up a new project that is using an SDK lab example from TI Motorware as a starting point.  If I understand correctly, the reason Export/Import didn't setup my new project copy correctly is the way the include files were referenced in the original.  I fixed that by correcting the MW_INSTALL_DIR variable to point directly to the SDK directory.  Looks like there is another include variable that needs the same thing done to it.

    However, the bigger question is what directories and files should be replicated in my new project directories.  My project runs on a custom board, not a TI motor driver kit that all these driver files are based on.  Some files like user.c, user.h, main.h, hal.c, hal.h will need to be edited for my board.  What I'm considering is copying these files from the lab examples into directories under my new project.  Then setup include paths to those.

    Does that make sense?

    Thanks.

  • John,

    Copying those files into directories inside your new project makes sense to me.  That way you preserve what is in MotorWare.  

    Regards,

    John

  • Thanks for the help.  After all of this I only had to fix one of the motorware include references that didn't have enough of the path.

  • Great to know that it is working.

    John