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.

Copying a project as a starting point

Other Parts Discussed in Thread: LM3S6965

Hello
I am quite new to CCS and with other IDE's I usually work by copying example projects into a seperate directory so I can make changes without fear of corrupting the original eample. However all tutorials and examples I have found work by using the original example.
If I try copying an example into a different directory then import the copied project then a build cretaes many errors due to incorrect path specification.

If I just try and link in the appropriate C and header files to a new project then again there appears to be lots of other project files missing causing build errors.

Could someone point me to a getting started guide that shows how to create a project from scratch and just add in any example code files as required.
Sounds simple I know but I just can't find anything like this.

Thanks
Bob

  • Hi Bob,

    The generic Getting Started Guide with v4 walks through creating, building and debugging  your first Hello World project from scratch. 

    Thanks

    ki

  • Hello Ki-Soo,

    I think Bob has the same problem than me: he is not thinking about how to make a new project, but to use a copy of a existing project and to modify it without losing the original one.

    I am working now with the PMSM motor control project from TI and I would like to copy the original project to a new one and make my own project using the copy, not the original. I have to modify the original one in order to adapt the software to another technical specifications, hardware and software.

    I have been trying to find the procedure to make the copy of a project but I have not found it, neither the documentation nor the TI web and forums. Could you help me, please?

    Thanks in advance,

    Miguel

  • Hi Miguel,

    Miguel said:
    I think Bob has the same problem than me: he is not thinking about how to make a new project, but to use a copy of a existing project and to modify it without losing the original one.

    Assuming that you and Bob are using CCSv4, you can simply right click on the project in the C/C++ Projects view and select 'Copy'. Then right-click again in the view and select 'Paste'. It will create a copy of the project in your workspace and you will be prompted to give it a new name since projects of the same name cannot co-exist in the same workspace.

    Thanks

    ki

  • Very useful tip, but few issues that I came across using this

     

    1. If you have multiple configurations, and few of the files are excluded in some configurations this information is not carried forward when you copy
    2. If you have specified the include paths as relative to “macro” defines, i.e. portable form the copying function does not keep this and resolves the include paths as absolute paths, This might be an issue if you change folders etc...

    Please see if you can include/ correct these in the future,

    Regards

    Manish Bhardwaj

  • Hi,

    I tried the "right-click-copy and paste", but it doesn't really work.  When I edit the files in the copied project the original file changes too!

    So then I "right-click-copy and pasted" the file in the copied project and edited that and it still edited the original file in the original project.

    There has got to be an easy way of using an example project as a starting point without changing the orignal file.

    I got this LM3S6965 eval board and it comes with these great little examples in the C:\StellarisWare\boards\ek-lm3s6965.

    So I want to use these as a starting point and change the code in  the new project without changing the orignal.

    I'd also like to have  the new project in a different directory if that is possible.

    Any help on this would be greatly appriciated.

    Thanks,

    Tim.

  • Tim,

     

    I have never had this issue, I always first create the folder/directory where i want the new copied project to be, then right click and copy paste and specify the directory path to this new folder.

    You should never keep two projects in the same folder as CCSv4 is directory based. 

     

    What i can see is that the issue may be in how the examples are provided from stellaris, they may have the files as "linked" files, if you change the linked file then the source would change. You can verify if the file is linked by seeing a small arrow on the file name.

    Hope this helps

    Manish Bhardwaj

  • Manish,

    Yes, a lot of the files have the arrow on the file but not all of the files.  (by the way the help files has a section defining all of the icons, but doesn't say anything about the arrow.)

    So, how do I use these stellarisware projects as a starting point?

    I make a folder in a different location with a different name  (D:\work\Software\stellaris_projects\my_uart_echo).

    Copy and paste the original (uart_echo) into this place and call it "my_uart_echo".  I get:

    What does this mean?

    Should I say 'yes" or 'no"?

    What should I do?

    Thanks,

    Tim.

  • Tim King said:

    So, how do I use these stellarisware projects as a starting point?

    Due to the fact that Stellarisware examples contain several "linked" files and relative paths to include files and libraries, if you wish to use one of the examples as a starting point for your own project, it is best to make a copy of the entire base Stellarisware folder. After that you can always delete the examples you are not interested in if you wish to clear out some disk space.

    Then open CCS, go to Project->Import Existing CCS/CCE Eclipse Project, browse to the new copied location, select the desired example project, and import it into your workspace. When you get the message about overwriting existing macros, go ahead and say Yes. The example projects include macros to make the project portable, which are read in by CCS when the project is imported. Since you are making a copy of the folders and importing the project from a different location, the message is saying that it needs to overwrite the macros with the new values.

  • Arti,

    Thanks.  I said "yes to the message about overwriting the existing macros and now all of the source files are gone--all of them from all of teh stellarisware projects!  in my new project there is a yellow ! on the source files and on the original project there is still the 'shortcut' arrow on the files, but when I double-click on them the it says "Resource /uart_echo does not exist". 

    Is there any way to recover from this?  do I have to reinstall everything again?

    tim.

  • Ok, I started over.

    I deleted everything from my workspace and re-did the "Import Existing CCS/CCE Eclipse Project" from the StellarisWare/boards directory.

    I rebuild the uart_echo project and it built again, So now I'm back at square one.

    I manually copied the C:\StellarisWare\boards\ek-lm3s6965 to a new folder called D:\work\Software\Stellaris\ek-lm3s6965.

    I made a new workspace which I put in D:\work\Software\Stellaris.

    I did the "Import Existing CCS/CCE Eclipse Project" from the new folder called D:\work\Software\Stellaris\ek-lm3s6965.

    Now the new uart_echo project files (uart_echo.c, startup_ccs.c, etc) all have a yellow '!' symbol on them and when I try to open them it says "Error retrieving content description for resource: /uart_echo/uart_echo.c".   Right-click>properties on uart_echo.c and I get:

    What do I have to edit to make these projects find that files that are right there in the folder!??

    Do I have to un-link the files or change the "Location" so it matches the "Resolved location"?  If so, How?

    I usually find the information like this in the help, but the help in the CCS program doesn't work very well.  For example if I want to find an explination of the dialog above I type in the name of the dialog into the search and it should have an entry that describes the dialog. The CCS help doesn't work this way.  How can I find information about the dialog boxes that I interact with in CCS?

    Thanks,

    Tim.

  • Tim,

    It is best to keep separate CCS workspaces for the original Stellarisware examples and for the copy you make.

    The Stellarisware projects include a file called macros.ini file(which defines a variable SW_ROOT that points to the root Stellarisware folder). This is read in every time you import the project, if you tell it to overwrite the existing macros, then if you want to go back to a project previously imported from a different location, you would need to reset the variable . You can check the macro set for the current project by going to Window->Preferences->General->Workspace->Linked Resources, and check the path for SW_ROOT. If you switch to a project with a different SW_ROOT you would need to edit this variable to point to the correct root location.

    To avoid having to do this each time, I would suggest creating different CCS workspaces, one for working with out-of-box Stellarisware examples, and another for your working projects (the working copy of Stellarisware). This way, within a given workspace, you will be importing projects from the same location.

    Some general information on Portable Projects and macros.ini file can be found here: http://processors.wiki.ti.com/index.php/Portable_Projects

    Tim King said:

    Is there any way to recover from this?  do I have to reinstall everything again?

     You shouldn't have to reinstall. The files themselves should all still be there in the file system. Please edit the SW_ROOT variable in CCS as described above to point to the correct root path and you should be able to rebuild the project. If this fails, just open a new workspace and import the project again.

     

     

     

  • I was finally able to get it to work (sort of).

    I copied the entire stellarisware folder (not just the one under the boards folder like I did before).

    I made a new workspace and put it in a different folder than the original workspace (not sure if that matters or not).

    I made the two workspace SW_ROOT variables such that the folders down further from that point were the same.

    New workspace:    SW_ROOT = D:\work\Software\StellarisWare\

    Original workspace:   SW_ROOT = C:\StellarisWare\

    Now I can edit the files in the new workspace without affecting the orignal files.  Also, at this point I copied uart_echo.c, renamed it to uart_foo.c, added that to the project, deleted uart_echo.c and I could edit uart_foo.c and build the project succesfully.  The key to this was makeing the relative paths work out the same for the two workspaces and then putting the uart_foo.c file in the same place that new workspace uart_echo.c file was located. 

    Thanks for your help.

     

    Tim.

  • hei,

      i have the same problem with you as follows. but i still not understand how you solved it. can you give the detail of steps.

       i use the TI examples. i copyed them out,

     my email is 20910114@zju.edu.cn

      你好,我遇到同样的问题,但是我仍然没有能很好的解决我的问题。我按照你们的解答去复制工程,并且去添加路径了。我用的是TI的 例程。如下图。

    我看了你们的解答,和给出的网页参考,但是还是没有能够弄清楚,我希望有一个比较详细的解答步骤。

     若是可以,我讲整理好步骤并发布到论坛上与大家分享。我的邮箱为:20910114@zju.edu.cn

    非常谢谢。

        

    DSP2833x_examples 里面的Cputimers工程文件。

  • OS Version: Windows 10

    CCS Version: CCSv7 and above

    Hello Everyone

    One can copy the existing 'example' project and the paste it with a new name (example1) in the workspace. However, if the copied 'example.c' file is modified, changes reflect in the original example file. As a simple workaround to this problem, just open the 'example.c' file in the original project and copy its contents. Now create a .c file with the new project name (example1_cpu01.c) and paste the original contents in this file. After that (I would recommend to the new project before you make any changes) you could modify the copied code with original code unaffected. The new project should now build with the original settings but with modified code. 

    Note: After copy-pasting the project, you will need to manually delete the original '.c' file in project explorer and then create the new '.c' file.

    Thanks

    Bhanu