CC2640R2 to CC23xx Porting Guide

This section will describe, in general terms, how to port a project developed for the CC2640R2 device on the SimpleLink Low Power F1 2P4 SDK to a CC23xx device running the SimpleLink Low Power F3 SDK.

The SimpleLink Low Power F1 2P4 SDK offers examples using the BLE5 stack and the BLE stack. The SimpleLink Low Power F3 SDK implements the BLE5 stack, so any projects running on the BLE stack on the SimpleLink Low Power F1 2P4 SDK must be migrated to the BLE5 stack before the porting process begin. The migration process is detailed in the Porting BLE-Stack to BLE5-Stack guide. Once the project is running on the BLE5 stack, then the best way to port a project is to open a new example project with similar functionality in the new SDK and transfer your changes and application code over to the new example.

The following sections discuss the major changes between the CC2640R2 and the CC23xx devices.

General Considerations

FreeRTOS

The CC23xx devices exclusively support FreeRTOS. If a project needs to be migrated from the SimpleLink Low Power F1 2P4 SDK, then it will need to be converted to FreeRTOS during the migration process.

LaunchPad support

Find support and all the collaterals for the LaunchPad CC2340R5 in the CC23xx LaunchPad Development Kit Product Page: CC2340R5 LaunchPad.

Sensor Controller

The CC23xx does not support the Sensor Controller. Any applications being ported from the SimpleLink Low Power F1 2P4 SDK that make use of the Sensor Controller will need to be modified to not use the Sensor Controller in order to work with the CC23xx.

Bluetooth 5.2 Enabled

If your project wasn’t already on a BLE5 platform, the CC23xx will provide the ability to support the new features of Bluetooth 5.2. This includes features such as higher throughput, longer range, advertising extensions, and improved coexistence with other wireless technology.

Migration Guides

Migrate to BLE5 stack

If migrating from a SimpleLink Low Power F1 2P4 SDK based project to a SimpleLink Low Power F3 SDK based project, then it is necessary to migrate the SimpleLink Low Power F1 2P4 SDK project to the BLE5 stack if its not already in the BLE5 stack. This initial migration will greatly ease the porting process further down the line.

If the project has not already been migrated to the BLE5 stack, then the Porting BLE-Stack to BLE5-Stack guide should be leveraged to aid in this section of the migration.

Migrate to FreeRTOS

An important step that must be taken in order to port an example from the SimpleLink Low Power F1 2P4 SDK to the SimpleLink Low Power F3 SDK is to ensure that the project is implemented in FreeRTOS. The SimpleLink Low Power F3 SDK only supports FreeRTOS, so any projects running on TI-RTOS will not work unless they are converted to FreeRTOS. To port a project from TI-RTOS to FreeRTOS please reference Modify the application code to support FreeRTOS. This part of the process should be done after the application code has been transferred to a sample project running on the SimpleLink Low Power F3 SDK.

Migrate the TI drivers

It is important to ensure that projects that are being ported to CC23xx are not using deprecated libraries. A few migration guides for libraries that should be updated as part of the SimpleLink Low Power F1 2P4 SDK to SimpleLink Low Power F3 SDK migration are shown below:

Compatibility Notes

Due to a number of improvements and feature additions, the recommended migration path for customers is to start with a CC23xx based project and migrate any custom application code and project configuration to the new project.

The following sections describe, in general terms, the software differences when migrating from CC2640R2 to CC23xx.

SysConfig

The SimpleLink Low Power F3 SDK leverages SysConfig to configure both the application and BLE5-Stack. For more information on the tool, see Get started with SysConfig.

Application TI-RTOS Build Configuration

Depending on the example project, the available application build configurations are:

Table 37. Project build configurations

Build Configuration

Description

Release

Turns off debug features (i.e. used in production)

Debug

Provides debug feature improvements: Enables exceptions, BIOS asserts, BIOS logging handling, places the BIOS in flash.

Each build configuration provided is user configurable. For CCS users, the build configuration can be modified in the SysConfig file located in the project directory.

Stack Build Configuration

All BLE5-Stack 3.03.01.00 applications configuration’s use a single project configuration. This build configuration yields additional flash footprint optimizations by the linker since the application and stack can share contiguous flash pages. This configuration is further discussed in the Single Project Configuration section of this User’s Guide.

Formerly, the BLE stack was configured using the build_config.opt command file. The BLE5-Stack 3.03.01.00 now uses SysConfig to configure the BLE5-Stack and generates the ti_build_config.opt.

For more information on this, see BLE5-Stack SysConfig Features.

Predefined Symbols

The predefined symbols have been moved from the project properties. Instead, SysConfig is used to configure and generate any relevant project defines inside ti_ble_app_config.opt.

For more information on this, see BLE5-Stack SysConfig Features.

GAP Role Removal

All GAP Roles source and header files (peripheral.c, peripheral.h, central.c, central.h, etc.) have been removed. With the GAP Role changes, GAP events are being handled differently. GAP events are now handle in the bleapputil_task.c file located in the commonBLEAppUtil folders. These events are pass in the app folder such as app_peripheral.c file and so on. This is where users should use these events.

Further discussion of this is in Porting BLE-Stack to BLE5-Stack.

Host Privacy

The design of the Host Privacy in BLE5-Stack 3.03.01.00 is a complete redesign of the former one on the CC2640R2.

In BLE5-Stack 3.03.01.00, the Host is responsible for the following tasks:

  • Configuring the privacy mode and own address type to conduct desired privacy operations on the controller

  • Performing pairing procedure to exchange device identity information including IRK, identity address, and address type

  • Updating peer device’s address information in the link DB after acquiring the identity information through pairing process

  • Managing resolving list by adding/removing resolving list entries or clearing

  • Storing resolving list to NV and restore it from, so that the privacy information is persistent across power cycles

Example

The following section provides an example of how to port a BLE5 CC2640R2 project from the SimpleLink Low Power F1 2P4 SDK to the SimpleLink Low Power F3 SDK. All of the steps shown below are essentially putting into practice the theory discussed earlier in this document.

Porting Simple Peripheral

For this porting guide, BLE5 Simple Peripheral will be ported from the SimpleLink Low Power F1 2P4 SDK device to the SimpleLink Low Power F3 SDK using a CC2340R5 device. To minimize project configuration differences, start with an example project in the CC23xx. The recommended approach is to start with a SimpleLink Low Power F3 SDK project that contains the same base functionality as the porting target project and merge in any custom functionality.

Examples based on the Simple Framework (simple_peripheral, simple_central etc.) can be migrated to the basic BLE example. This section will detail how to migrate from simple_peripheral to basic_ble.

Hint

Note that the basic_ble project from the SimpleLink Low Power F3 SDK gather all the following project from the SimpleLink Low Power F1 2P4 SDK in one:

  • simple_peripheral

  • simple_central

  • simple_obsverer

  • simple_broadcaster

When using the basic_ble example, SysConfig should be used to enable the required Bluetooth role(s).

  1. Choose a SimpleLink Low Power F3 SDK example project that contains your target project’s base functionality, it’s better to choose the basic_ble project as it handle all the different roles.

    Build the newly created project to avoid any errors related to the build environnement.

#. Transfer SysConfig settings On the SimpleLink Low Power F3 SDK a file called sysconfig gather a lot of configuration through a GUI.

For example all the files concerning the board itself should be implemented in sysconfig. There is no board.c file in basic_ble project.

Select the desired Bluetooth LE role(s) role. In the case of simple_peripheral, select “Peripheral”

Select desired BLE parameters.

Add any necessary SysConfig modules (UART, SPI, I2C, etc.)

Remove any unneeded SysConfig modules.

  1. Transfer Bluetooth LE profiles from the simple_peripheral` project to the basic_ble project.

    In the simple_peripheral project, the profiles may be found at the following directory: {PROJECT_LOC}/Profiles

    In the basic_ble` project, the profiles may be found at the following directory: {PROJECT_LOC}/common/Profiles

    Make sure that any #include statements that reference the simple_peripheral directory structure are updated to use the basic_ble directory structure if needed.

  2. Update the project to use the newer TI drivers that are supplied with the SimpleLink Low Power F3 SDK.

    The UART library has been deprecated and replaced by the UART2 library. Please follow the UART to UART2 Porting Guide

    The Pin and GPIO libraries are deprecated and have been replaced by the GPIO++ library. To update Pin or GPIO code, please reference the following porting guide GPIO++ Driver Porting Guide

  3. Convert the project from TI-RTOS to FreeRTOS. The CC23xx devices only support FreeRTOS. This must be done properly to ensure that the project behaves as expected and proper functionality is maintained. Please leverage the following guide Modify the application code to support FreeRTOS

  4. Remove any unnecessary application files within the app folder

    • For example, if your application will only implement the observer role, then the app_broadcaster.c, app_central, app_data, app_pairing, and app_peripheral may be removed. These additional files implement functionality that may not be useful in an observer-only application.

    • In the case of the simple_peripheral example, only the app_broadcaster.c, app_central, and app_observer should be removed if only the simple_peripheral functionality is desired.

  5. Transfer custom application code to the basic_BLE project.

    • Almost all of the application code present in the simple_peripheral project was located in the simple_peripheral.c file. In the basic_ble project, a lot of potentially unnecessary code is removed entirely and the remaining code is placed in modular files that can be expanded or minimized as needed.

    • The functionality of the custom code as well as the location of the custom code in the simple_peripheral project will determine the best location in the basic_ble project to transfer the code to.

      For example, any custom code added to the pairing process should likely be added to app_pairing.c file.

      Any custom code that deals with peripheral specific functionality such as advertising or connecting should likely be added to the app_peripheral.c file.

      Any code that is not directly related to the BLE5Stack operation can be placed in its own file within the app or common folders.

    • Highly customized code may require a bit more effort to migrate, but should be relatively straight forward to do so.

  6. Refer to the Core SDK release notes for additional information and the FreeRTOS examples included with SimpleLink Low Power F3 SDK.

    For additional information on how SimpleLink Low Power F3 SDK uses FreeRTOS see FreeRTOS (RTOS Kernel) Overview.

  7. At this stage, most, if not all, of the modifications required have been completed. It is possible that some additional modifications may be required for the project to function as intended, but these changes can be relatively minor compared to the modifications already made by following this porting guide.