Opening, Configuring and Building Projects

This chapter is split into CCS and IAR instructions. If you are using IAR, skip ahead to Opening BLE-Stack IAR Projects.

BLE-Stack CCS Project Build Configurations

This and all BLE-Stack project workspaces contain various projects and build configurations as shown in Table 6. *_StackLibrary build configurations build the stack as a library as described in Stack Library Configuration (_stack_library).

Click the project name in the file explorer to select the project as the active project. In Figure 26., the application is selected as the active project. Each of these projects produces a separate, downloadable image.

The simple_peripheral sample project is the primary sample application for the description of a generic application in this guide. The simple_peripheral project implements a basic Bluetooth Low Energy peripheral device including a GATT server with GATT services. This project can be used as a framework for developing peripheral-role applications.

Table 6. Available CCS project build configurations
Project type Project naming convention Project’s build configuration Compatible project complement
Application *_cc2640r2lp_app FlashROM *_cc2640r2lp_stack
FlashROM_StackLibrary *_cc2640r2lp_stack_library
FlashROM_StackLibrary_RCOSC *_cc2640r2lp_stack_library
*_cc2640r2lp_app_oad_onchip FlashROM_OAD_ImgB *_cc2640r2lp_stack with FlashROM configuration
*_cc2640r2lp_app_oad_offchip FlashROM_OAD_Offchip *_cc2640r2lp_stack with FlashROM configuration
Stack *_cc2640r2lp_stack_library FlashROM_Library *_cc2640r2lp_app with FlashROM_StackLibrary configuration
*_cc2640r2lp_stack FlashROM *_cc2640r2lp_app with FlashROM configuration

Compile and Download

For all build configurations, the stack project should always be built before the application project. The default configuration is to build the stack as a library. The OAD projects use a split-image configuration. For these projects, follow the split-image steps below.

For projects where the stack is built as a library:

  1. Build the stack library project.

    • Set the stack project as the active project.
    • Select Project -> Build All to build the stack project.
  2. Build the application project.

    • Set the application project as the active project.
    • Select Project -> Build All to build the application project.
  3. Load the whole application

    • Select Run -> Debug to download the application

Note

Application project that consume the stack in a library form will not have hard defined image boundaries.

After the initial build, if the stack project is not modified, only the application project needs to be rebuilt.

For projects where the stack and application are split images (not a library):

  1. Build the stack project.

    • Set the stack project as the active project.
    • Select Project -> Build All to build the stack project.
  2. Build the application project.

    • Set the application project as the active project.
    • Select Project -> Build All to build the application project.
  3. Load the stack project

    • Set the stack project as the active project.
    • Select Run -> Debug to download the stack
  4. Load the application project

    • Set the application project as the active project.
    • Select Run -> Debug to download the application

Note

The stack project defines the flash and RAM boundary parameters used by the application project. Any modifications to the stack project require a rebuild of the stack project, followed by a rebuild of the application project to use the new boundary settings.

After the initial build, if the stack project is not modified, only the application project needs to be rebuilt.

Caution

Do not modify the CPU Variant in the project settings. All sample projects are configured with a CPU type, and changing this setting (that is, from CC2640R2F) may result in build errors.

Opening BLE-Stack IAR Projects

This section describes how to open and build an existing project and references the simple_peripheral project. All of the BLE-Stack projects included in the development kit have a similar structure.

Error

If you have imported the global <SDK_INSTALL_DIR>/tools/iar/SIMPLELINK_CC13XX_CC26XX_SDK.custom_argvars as described in Importing TI Drivers IAR Projects, then BLE-Stack examples will fail to build. For BLE-Stack examples, you must remove this custom_argvars file from your IAR global custom arguments.

  1. Open the IAR Embedded Workbench IDE from the Start Menu.

  2. Open an IAR workspace project: File -> Open -> Workspace…

    • For this example, select <SDK_INSTALL_DIR>\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral\tirtos\iar\ble5_simple_peripheral.eww

This workspace file is for the simple_peripheral project. When selected, the files associated with the workspace become visible in the Workspace pane on the left side of the screen. See Figure 27.

Select either project as the active project by clicking the respective tab at the bottom of the workspace pane. In Figure 27., the Overview tab is selected. This tab displays the file structure for both projects simultaneously. In this case, use the drop-down menu at the top of the workspace pane to select the active project. Each of these projects produces a separate downloadable object. The simple_peripheral sample project is the primary reference target for the description of a generic application in this guide. The simple_peripheral project implements a basic BLE-Stack peripheral device including a GATT server with GATT services. This project can be a framework for developing peripheral-role applications.

BLE-Stack IAR project build configurations

This and all BLE-Stack project workspaces contain various projects and build configurations as shown in Table 7. *_StackLibrary build configurations build the stack as a library as described in Stack Library Configuration (_stack_library).

Table 7. Available IAR project build configurations
Project type Project’s build configuration Compatible project complement
Application FlashROM Stack - FlashROM
FlashROM_StackLibrary Stack - FlashROM_StackLibrary
FlashROM_StackLibrary_RCOSC Stack - FlashROM_StackLibrary
FlashROM_OAD_ImgB Stack - FlashROM
FlashROM_OAD_Offchip Stack - FlashROM
Stack FlashROM_Library Application - FlashROM_Library
FlashROM Application - FlashROM

Compile and Download

For all build configurations, the stack project should always be built before the application project.

For projects where the stack is built as a library:

  1. Build the stack library project.

    • Select the stack project.
    • Select Project -> Make to build the stack.
  2. Build the application project.

    • Select the application project.
    • Select Project -> Make to build the application.
  3. Load the whole application

    • To download and debug: Select Project -> Download and Debug
    • To download without debugging: Select Project -> Download -> Download Active Application

Note

Application project that consume the stack in a library form will not have hard defined image boundaries.

After the initial build, if the stack project is not modified, only the application project needs to be rebuilt.

For projects where the stack and application are split images (not a library):

  1. Build the stack project.

    • Select the stack project.
    • Select Project -> Make to build the stack.
  2. Build the application project.

    • Select the application project.
    • Select Project -> Make to build the application.
  3. Load the stack project.

    • Select Project -> Download -> Download Active Application to download the stack project.
  4. Load the application project.

    • To download and debug: Select Project -> Download and Debug
    • To download without debugging: Select Project -> Download -> Download Active Application

Note

The stack project defines the flash and RAM boundary parameters used by the application project. Any modifications to the stack project require a rebuild of the stack project, followed by a rebuild of the application project to use the new boundary settings.

After the initial build, if the stack project is not modified, only the application project needs to be rebuilt.

When the application is downloaded (that is, flash memory programmed), you can debug without reflashing the device. Go to Project -> Debug without Downloading.

Caution

Do not modify the CPU Variant in the project settings. All sample projects are configured with a CPU type, and changing this setting (that is, from CC2640R2F) may result in build errors.