Overview

Users often want to use an example CCS project from Simplelink SDK as a starting point to create their own custom projects. This article describes a couple of different ways to make a copy of an example project. Note that each method comes with advantages and limitations.

Using CCS

This method is fairly easy and straightforward. However if the example project contains source files that are linked to their original location within the SDK, they will continue to be linked in the copied project, therefore editing these files will modify the file within the SDK. One way to avoid such unintended modifications of the SDK is to put the SDK installation under a version control system such as Git and make an initial commit of the original SDK so you could always revert back to the original code if needed.

To make a copy of a project in CCS:

  1. Right-click on the project in Project Explorer view and select Copy.
  2. Click in the blank area of Project Explorer view and select Paste.
  3. In the Copy Project dialog give the new project a different name.

For most TI-RTOS Kernel and TI Drivers examples that is all that is required to make a copy of the example project. However, some examples (like ble5_simple_central_cc2640r2lp_app and ble5_simple_central_cc2640r2lp_stack_library projects) may require additional settings or paths to be adjusted before the copied project can build successfully.

The section below shows the steps required before a copy of the ble5_simple_central_cc2640r2lp_app project can build successfully. Note that this is meant to serve as a reference only and the exact modifications will depend entirely on the example project and how it was originally set up. If the copied project generates build errors, taking a closer look at the error messages should give clues about the reason for the error.

Additional steps

  1. Select the copied version of the app project (in this example, it is named ble5_simple_central_cc2640r2lp_app_copy).
  2. Go to Project Properties → Build → Compiler → Advanced Options → Command Files and observe the first entry: ${PROJECT_LOC}/TOOLS/defines/${ProjName}_${ConfigName}.opt

    When the original project was first imported into CCS, the ${ProjName}_${ConfigName}.opt translated to ble5_simple_central_cc2640r2lp_app_FlashROM_StackLibrary.opt. During the Project Copy this file was merely copied over into the new project folder with the same name. However, at build time, CCS will look for a file named ble5_simple_central_cc2640r2lp_app_copy_FlashROM_StackLibrary.opt (since $ProjName is now ble5_simple_central_cc2640r2lp_app_copy) and fail.

  3. Edit the entry with the original file name as shown below.

  4. If you made a copy of the stack_library project as well, then proceed with the steps below. Otherwise you are done.

  5. Do the same .opt file name change as shown in step 3 inside the copied version of stack_library project.

  6. Go to Project properties → Build → Dependencies tab of the copied app project (ble5_simple_central_cc2640r2lp_app_copy).

  7. Click on Remove to remove the existing Referenced Project.

  8. Click on Add and select the copied version of the stack_library project (in this example, it is named ble5_simple_central_cc2640r2lp_stack_library_copy).

Using Projectspec File

This method is more advanced and requires some understanding of projectspec files and their format. The advantage over the previous approach is that it is easier to change properties of resources, so a linked resource could easily be changed to be copied into the project instead.

For more information on projectspec files, refer to this article.

Most example projects in current Simplelink SDKs are created using projectspecs. The example projectspec files can be copied and edited to change the name of the project and other build settings as desired.

To make a copy of a project using projectspec:

  1. Go the the example directory inside the SDK that contains the .projectspec file.
  2. Make a copy of the .projectspec file.
  3. Open the copied file and change the name of the project.
  4. If desired, identify any linked resources that you wish to be copied to project, and for those <file> elements, change the action="link" to action="copy".
  5. Import project into CCS using menu Project → Import CCS Projects.

Similar to the previous approach, some examples (like ble5_simple_central_cc2640r2lp_app and ble5_simple_central_cc2640r2lp_stack_library projects) may require additional changes, as shown below, before the copied projectspec can build successfully. Again, these steps are meant to serve as a reference for one specific example only, and the exact modifications will depend entirely on the example project and how it was originally set up. If the copied project generates build errors, taking a closer look at the error messages should give clues about the reason for the error.

Additional steps

  1. Open the copied version of stack_library projectspec file (in this example, it is named ble5_simple_central_cc2640r2lp_stack_library_copy.projectspec)

  2. Change the name of project, and change the name of .opt file in compilerBuildOptions (highlighted below).

  3. Open the copied version of app projectspec file (in this example, it is named ble5_simple_central_cc2640r2lp_app_copy.projectspec)

  4. Make changes at the highlighted areas below.

  5. In the same file, edit paths and filenames under linkerBuildOptions.