SimpleLink SDK BLE Plugin User Guide

Table of Contents

Introduction

The SimpleLink SDK BLE Plugin is a companion software package that enables the use of a Bluetooth radio on a variety of SimpleLink platforms including the MSP432 platforms and CC32XX platforms. By having the ability to seamlessly and modularly add Bluetooth functionality (more specifically Bluetooth Low Energy/BLE) to an embedded system, a programmer can enable their embedded device to become a gateway to various IOT infrastructures.

This plugin leverages the use of the TI Simple Application Processor (SAP) driver connected to a CC26xx Simple Network Processor (SNP) to provide a highly customizable hardware configuration. For software connectivity between the SAP and the SNP, an architecture agnostic HAL/Drivers layer is used to promote software portability and maximize collateral reuse.

SimpleLink SDK Plugins are designed to work in tandem to the microprocessor specific SDK. This plugin is designed to work alongside the SimpleLink MSP432 SDK and SimpleLink CC32XX SDK. Without a prior installation of the SimpleLink SDK, the SimpleLink SDK BLE Plugin will not work. While testing of this software package was performed on release 3.20.00.xx of the dependent SDKs, it is likely that it will also work with newer and older versions of the SDK.

Plugin Architecture / General Overview

All of the code examples written for this software package leverage a combination of a host SimpleLink LaunchPad for the host processor. The LaunchPads currently supported include:

  1. MSP-EXP432P401R (MSP432P401 LaunchPad)
  2. MSP-EXP432P4111 (MSP432P4111 LaunchPad)
  3. MSP-EXP432E401Y (MSP432E401 LaunchPad)
  4. CC3220SF-LAUNCHXL (CC3220SF LaunchPad)
  5. CC3220S-LAUNCHXL (CC3220S LaunchPad)
  6. CC3235SF-LAUNCHXL (CC3235SF LaunchPad)
  7. CC3235S-LAUNCHXL (CC3235S LaunchPad)

Any one of these LaunchPads can be connected to a BLE radio using one of the following as the network processor:

*LAUNCHXL-CC2650 (SimpleLink CC2650 BoosterPack) hardware configuration

Additionally, the simple_central example allows the use of the LAUNCHXL-CC26X2R1 as a NWP with the MSP432E401Y as a supported host.

The communication between the host SimpleLink device and the CC26xx has been abstracted away using the Simple Application Processor (SAP) driver layer. The SAP driver allows for a generic and portable interface between the MSP432 and CC26xx, simplifies programming for the end user, and maximizes portability. A brief block diagram of the various software connections and driver interworkings can be seen below:

SAP Diagram

The SAP layer supports a physical UART Network Processor Interface (NPI) layer between the SimpleLink host MCU and the CC26xx. The SAP software APIs provide a generic software mechanism for programmers to write code that is easily portable to other TI microcontrollers (such as WiFi parts). For more information on SAP and a detailed set of documentation, please refer to the SAP Reference/API Guide.

Note that SAP provides two different power mode implementations: one low power mode and one regular power mode. Because MSP432 is marketed as a low power high performance device, the low power mode is used exclusively in all of the code examples. While the normal power mode will work (after updating the SNP image), it is recommended to stick with the low power mode unless project requirements dictate otherwise.

This simple_central project supports a 2-chip configuration. The supported Host MCU is a MSP432E401Y, and the supported Network Processor is a CC26x2R1. The CC26x2R1 is flashed with a modified host_test project, which implements a pure BLE Network Processor (NWP) for use with an external microcontroller. Host Test supports all GAP roles, but is configured to be in the Central role for this application. The NWP incorporates the TI BLE Host and Controller components of the protocol stack on the CC26x2, while the application resides on the external microcontroller, which for this application is the MSP432E4. For more information on Host Test, please view the Host Test README.

Communication between the CC26x2 and the MSP432E4 occurs through a UART serial interface using the Host Controller Interface (HCI) protocol. This application uses TI Vendor Specific HCI commands and a limited subset of Bluetooth LE HCI commands/events to implement a Bluetooth application. By using TI Vendor Specific commands and events, the application can communicate with and access the BLE stack.

Folder Structure

The folder structure for the SimpleLink SDK BLE Plugin is made to compliment the standard folder structure that the platform SDK adheres to. From the root directory, the following folders are available:

The source/ folder contains the code that is likely to end up seeing its way into an end application. Within there is the following folder:

The ti/ folder contains the bulk to the TI provided collateral to interact with and control the CC26xx BLE module. This folder is structured as follows:

The code provided in the bluetooth/ folder is provided as source only (as opposed to a pre-compiled library) as the user is likely to extend functionality to meet their program’s requirements.

The snp/ folder contains the SNP hex images that are used to program the CC26xx device (see the following section).

Generating New SNP Image / Firmware Upgrades

By default, the hardware configuration of the Peripheral Role examples are configured to use the SimpleLink LaunchPad + CC26xx (whether CC2650 BoosterPack or CC2640R2 LaunchPad) configuration over UART in power saving mode.

The default for the Central role example (simple_central) is configured to use the SimpleLink LaunchPad + CC26x2 configuration over UART with power saving mode disabled.

The image names generally follow the same format, which tell the user about which device it should be used for, what transport layer is used, and if power management, secure bootloader, and coexistence are enabled:

Also note if the image is in the “blestack” or “ble5stack” directories, as this indicates what BLE version is supported by the image.

By default the following two images are used and would likely be the images that the majority users would need to program:

The SNP image on the CC26xx is assumed to contain this hardware configuration and will not work reliably unless this firmware is programmed on the CC26xx. By default the CC2650 BoosterPack comes pre-programmed with this configuration, however the CC2640R2 LaunchPad must be explicitly programmed with the SNP image. Additionally if the user wants to update the CC2650 then it will have to be programmed as well. The programmer has a few different options available to them. The various SNP images for each hardware configuration can be found in the source/ti/snp folder of the plugin installation.

Embedded Firmware Image / SBL

The first option available for firmware updates to the CC26xx SNP is to store the new firmware image within the user application. This is done by converting the distributed SNP hex image into a C-array that contains a hex representation of the SNP image. Note that within the SNP folder, pre-generated C-arrays are available for all of the configuration variants.

The preferred method to convert the SNP hex image into a C-array is to use the open source S-Record utility. This utility is a free program that can easily convert between various embedded hex formats. Once S-Record has been downloaded/installed, copy and paste the SNP hex file that needs to be converted from source/ti/snp into the same directory as srec_cat.exe (or your OS’s equivalent). From there, open up a command prompt and run the following command:

srec_cat.exe simple_np_cc2650bp_uart_pm_sbl_59c69c3_merge.hex −Intel -o snp_c_array_image.c −C-Array

Note that the input filename might change depending on if the CC2650 BoosterPack or CC2640R2 LaunchPad is used. This will generate a “snp_c_array_image.c” file that contains the converted hex image in C-array format as well as all of the necessary addressing/overhead needed for SNP firmware updates. This file can be copied into any of the code examples included in this plugin in substitution of the snp_c_array_image.c file. *** Note that the default SNP image for all code examples is that of the CC2640R2 LaunchPad SNP. Any hardware configurations using the CC2650 BoosterPack must be explicitly updated to contain the CC2650 BoosterPack SNP image. ***

This file is used in various code examples to update the firmware on the CC26xx device during operation. The integrated firmware approach for firmware updates has the advantage that it does not require any external user interaction to download a new firmware, but results in a high memory footprint (the entire 128KB CC26xx SNP image is stored in the MSP432’s flash). For memory constrained applications, either an OAD firmware scheme or external programmer are suggested.

External/XDS Direct Programming - CC2650 BoosterPack

Additionally, the user can directly attach the CC2650 BoosterPack to an external programmer and program the CC2650 using the TI SmartRF Flash Programmer 2. To do this the user must first download and install the TI SmartRF FlashProgrammer 2 software utility from TI. Next, an external programmer must be attached to the CC2650 device. This can be an external XDS debugger, however the XDS110 debugger that is embedded on the MSP432 LaunchPad can also be used with a standard 10-pin ARM programmer cable. Note that this cable also comes packaged with the CC2650 BoosterPack. To use the MSP432 LaunchPad’s XDS110 programmer, first remove all of the jumpers between the MSP432 and XDS110 with the exception of 3V3 and GND.

Remove the jumpers

3V3 and GND must stay connected as they are required to power the CC26xx device during the programming process.

Next, attach the ARM programmer cable between the XDS110 and the CC2650 BoosterPack and stack the BoosterPack on top of the LaunchPad as shown in the following picture:

Connect the two devices

After attached, open up the SmartRF FlashProgrammer 2 program. Once opened, the program should show the XDS110 in the list of devices on the left. Note that if an “Unknown Device” is shown under the XDS110 instead of the CC2650, click the “Unknown Device” and then follow the prompts for updating the XDS110’s firmware. Once the CC2650 is detected (this should happen immediately), click the “Browse” button and locate the SNP hex image that you would like to download to the CC2650:

Choose the firmware

Once the SNP hex file is selected, press the “Play” button and the firmware should be downloaded/verified to the CC2650:

Program the device

Once programmed, disconnect the programming cable and reconnect the jumpers in between the XDS110 and the host MCU on the LaunchPad.

External/XDS Direct Programming - CC2640R2 LaunchPad & CC26X2R1 LaunchPad

Programming the CC2640R2 LaunchPad or CC26X2R1 LaunchPad with an external programmer is a bit simpler than the CC2650 BoosterPack as the CC2640R2 and CC26X2R1 have XDS110 debuggers embedded on the LaunchPads. To program the these devices, simply plug in the device to your computer through USB (make sure the jumpers between the debugger and LaunchPad are all connected):

Plug it in

After attached, open up the TI SmartRF Flash Programmer 2. program. Once opened, the program should show the XDS110 in the list of devices on the left. Note that if an “Unknown Device” is shown under the XDS110 instead of the device part number, click the “Unknown Device” and then follow the prompts for updating the XDS110’s firmware. Once the device is detected (this should happen immediately), click the “Browse” button and locate the SNP hex image that you would like to download to the device: