SimpleLink MSP432 SDK Bluetooth Plugin User Guide

Table of Contents

Introduction

The SimpleLink MSP432 SDK Bluetooth Plugin is a companion software package that enables the use of a Bluetooth radio on any standard MSP432 platform. 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 relies heavily on several core elements within this SDK. Without a prior installation of the SimpleLink MSP432 SDK, the SimpleLink MSP432 SDK Bluetooth Plugin will not work. While testing of this software package was performed on release 1.40.00.28 of the SDK, 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 the MSP-EXP432P401R (MSP432 LaunchPad) and LAUNCHXL-CC2650 (SimpleLink CC2650 BoosterPack) hardware configurations. Additionally this plugin has been tested using a CC2640R2 LaunchPad as the network processor. Either hardware configuration should produce identical results. Note that due to resource limitations on the CC2640R2, the CC2640R2 cannot be used in BLE5 mode when using the two-chip configuration.

The communication between the MSP432 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 CC2650, 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 MSP432 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. As 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.

Folder Structure

The folder structure for the SimpleLink MSP432 SDK Bluetooth 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 SimpleLink MSP432 SDK Bluetooth plugin is configured to use the MSP432 LaunchPad + CC26xx (whether CC2650 BoosterPack or CC2640R2 LaunchPad) configuration over UART in power saving mode. 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 BoosterPack. 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 as shown:

Remove the jumpers

Next, attach the ARM programmer cable between the XDS110 and the CC2650 BoosterPack 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 MSP432 on the LaunchPad.

External/XDS Direct Programming - CC2640R2 LaunchPad

Programming the CC2640R2 LaunchPad with an external programmer is a bit simpler than the CC2650 BoosterPack as the CC2640R2 LaunchPad has an XDS110 debugger embedded on the LaunchPad. To program the CC2640R2 LaunchPad 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 CC2640R2, 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 CC2640R2:

Locate hex file

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

Program the device

Once programmed, disconnect the programming cable remove the jumpers on the CC2640R2 LaunchPad that run between the CC2640R2 and the XDS110:

Remove jumpers

Over the Air Download / Firmware Update (OAD)

Over-the-Air Download (OAD) functionality is a method to dynamically update the firmware running on the SAP/SNP without pre-storing the firmware image on the application processor. A client BLE device (mobile phone, PC, etc.) will connect to the MSP432/CC26xx system, negotiate details for the firmware download, and then download the new firmware image to the memory of the MSP432. It is important to note that OAD supports updating both the firmware on the SAP (the MSP432) and the firmware running on the SNP (CC26xx).

The process of setting up your SimpleLink system for OAD functionality is documented in detail in the Over-the-Air-Download code example.

Bluetooth Profiles

The SimpleLink MSP432 SDK Bluetooth Plugin contains a wide array of BLE profiles for reference use in the programmer’s applications. While these reference Bluetooth profiles are geared to showcase some of the MSP432’s capabilities, it is likely that they will need to be tweaked by the programmer to fit the end application’s requirements. These profiles can be located in the source/ti/bluetooth/ directory of the installation. A summary of these profiles is listed below:

Profile Source Code Examples Description
barometer_service.c Sensors BoosterPack Barometric pressure characteristic
button_service.c Project Zero MSP432 LaunchPad’s push buttons’ characteristic
data_service.c Project Zero Simple data string storage and stream characteristic
humidity_service.c Sensors BoosterPack Humidity percentage characteristic
ir_temp_sensor.c Sensors BoosterPack Temperature in Celsius characteristic
lcd_service.c LCD Boosterpack Text Displays text on the Kentec QVGA BoosterPack
led_service.c Project Zero Manipulation of MSP432 LaunchPad’s LEDs
movement_service.c Sensors BoosterPack Provides accelerometer/positional information
optic_service.c Sensors BoosterPack Ambient light sensor characteristic
oad_profile_extended.c Over-the-Air-Download Provides service to enable over-the-air firmware updates of both the SNP and SAP image
profile_util.c All Provides various utility functions common across services
simple_gatt_profile.c Simple Application Processor Several very simple BLE characteristics for demo
temperature_profile.c Temperature Sensor Broadcast Another temperature profile that provides temperature data in both Celsius and Fahrenheit

When applicable each profile provides a presentation format descriptor. Each descriptor will provide the host device with standard Bluetooth format types as well as standard Bluetooth unit definitions.

SimpleLink SDK Explorer - Mobile Application

SimpleLink SDK Explorer is a specialized mobile application made by Texas Instruments to showcase and extend functionality of SimpleLink SDK products. Currently SimpleLink SDK Explorer supports the SimpleLink MSP432 SDK Bluetooth Plugin and provides a rich set of interactive elements for interfacing with your CC26xx and MSP432 hardware configuration. The functionality of SimpleLink SDK Explorer is documented in detail in each individual code example documentation.

Generic Mobile Applications

There are also generic “BLE” applications available that will give users a more low level way to experience the code examples. For these generic applications, TI recommends:

These applications are free and provide users with a method to extensively configure their projects from a mobile host.

Serial Port Logging/Debugging

Note that for logging/debugging messages the back channel serial port of the LaunchPad is used. In order to read these messages, use your favorite serial terminal program (such as Tera Term or PuTTY). The COM port number will be different depending on the system configuration, however it should show up as XDS110 Class Application/User UART.

Device Manager

Make sure to use the Application/User UART and not the Auxiliary Data Port. Along with the COM port of the XDS110 UART, the back channel UART defaults to the following serial port values:

Serial port values

Code Examples

Project Zero – Starting point for BLE development and includes several capabilities such as LED control, button monitoring, and basic data storage

Simple Application Processor – Simple BLE example which showcases several capabilities such as notifications and basic Bluetooth property reads/writes

Sensors BoosterPack – Showcases the BOOSTXL-SENSORS BoosterPack to provided broadcasting of a variety of different sensor data over BLE

Temperature Sensor Broadcast – Leverages the MSP432’s integrated temperature sensor to periodically broadcast temperature data

LCD Text BoosterPack – Code example that gives the user the ability to draw text with variable positions/colors on the Kentec QVGA BoosterPack

Over-the-Air Download – Demonstrates how to update the firmware of the MSP432 and CC2650 over BLE without the need to store whole firmware images on the MSP432

IDE/Software Configurations

This software package supports and has been tested with TI Code Composer Studio 7.2 as well as IAR Embedded Workbench for ARM v8.11.1. Both FreeRTOS and TI-RTOS are fully supported in this release.

Code Composer Studio Project Guide

The SimpleLink MSP432 SDK Bluetooth Plugin is designed to integrate seamlessly with the Code Composer Studio Integrated Development Environment from Texas Instruments. After installing the plugin (it is recommended to use the default installation directory), CCS should automatically detect and install the plugin software package without any special interaction from the user. To check to see if the plugin has installed correctly, go to the Windows->Preferences menu item. Under the Code Composer Studio->Products item you should see “SimpleLink MSP432 SDK Bluetooth Plugin” installed (with a version number):

Product installed

Note that the installation path of the plugin needs to be present in the Product Discovery Path:

Product installed

IAR Embedded Workbench Project Guide

IAR Embedded Workbench is fully supported under the SimpleLink MSP432 SDK Bluetooth Plugin ecosystem. Setting up your development environment to work with IAR involves pointing IAR to the plugin and SDK directories as mentioned below.

To get started, a list of external variables needs to be imported in IAR in order to let the IDE know the paths for all of the relevant software installations. An example configuration file that uses the default paths can be found in the tools/iar/simplelink_msp432_sdk_bluetooth_plugin.custom_argvars file of the SimpleLink MSP432 SDK Bluetooth Plugin installation directory. This file might have to be changed depending on specific installation paths and version numbers; however it should work if the user chose to use the default installation paths (note the version numbers might slightly vary from the picture below):

Import external variables

To import this file into your IAR IDE, navigate to Tools->Configure Custom Argument Variables.

Import external variables

From here, click the “Global” tab and navigate to the directory where the custom_argvars file is stored (by default in the examples/ directory of the installation path).

Add variables

After importing this file the custom variables will show up in the text box in the middle of the screen. Click OK to closeout and save the dialog. Note that these custom variables need only be imported once and the settings will persist.

Variables have been imported

Once the external symbols have been imported you can either open the project manually on the file system or use IAR’s built-in example project explorer. To open the project manually, simply go to File->Open->Workspace:

Variables have been imported

Navigate to the example project’s eww file. For example, the simple application processor’s eww file would be located at:

install_directory/examples/rtos/MSP_EXP432P401R/bluetooth/simple_application_processor/tirtos/iar/simple_application_processor.eww 

Ready to go

Note that if you upgrade or change versions of the SimpleLink MSP432 SDK Bluetooth Plugin or the base SDK, the external tools variables will have to change to point to the correct version of the software.

Support

Please email support inquiries to msp432_ble_plugin@list.ti.com