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 CC2650 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.20.00.45 of the SDK, it is likely that it will also work with newer and older versions of the SDK.

Change Log

v1.00.00.80 - 12/30/2016 - General Availability Release

v1.00.00.48 - 10/17/2016 - Beta Release

Known Issues

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. While it is possible for several other hardware configurations (such as stacked MSP432 and CC2650 LaunchPads), for the sake of simplicity these hardware configurations are omitted from the code examples.

The communication between the MSP432 and the CC2650 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 either a physical SPI or UART Network Processor Interface (NPI) layer between the MSP432 and the CC2650, however by default the software and code examples in this package use the UART configuration. 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 base MSP432 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 the this folder there are the following folders:

The third_party/ folder contains third party implemented BSD licensed code that performs low level interaction with sensors for the Sensor Booster Pack code example. This is the lowest level interaction with the sensor and it is more likely that the user would use the board support packages under the ti/ folder.

The ti/ folder contains the bulk to the TI provided collateral to interact with and control the CC2650 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 CC2650 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 + CC2650 BoosterPack configuration over UART in power saving mode. The SNP image on the CC2650 is assumed to contain this hardware configuration and will not work reliably unless this firmware is programmed on the CC2650 (by default the CC2650 BoosterPack comes programmed with this configuration). If this hardware configuration needs to change or the firmware version needs to be updated on the CC2650, 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 CC2650 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

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 simple_np_cc2650bp_pm_merge.c file.

This file is used in various code examples to update the firmware on the CC2650 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 CC2650 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

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.

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/CC2650 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 (CC2650).

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.

Mobile Applications

Specialized applications that are developed to compliment the SimpleLink MSP432 SDK Bluetooth Plugin and planned for a follow-on release, however there are generic “Bluetooth” 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.0 as well as IAR Embedded Workbench for ARM v7.80.3. Currently only the TI-RTOS development environment is supported, however FreeRTOS support is planned on a follow-on 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

Importing a SimpleLink MSP432 SDK Bluetooth Project into IAR Embedded Workbench involves utilizing IAR’s Project Connections. There are a few more manual steps to get started in IAR compared to CCS, however most of the initial steps need only be completed once for all IAR project functionality to be enabled.

The first task that needs to be completed is to manually build the TI-RTOS libraries for IAR. Note that if this has been done previously for the SimpleLink MSP432 SDK then this step can be skipped. To start, open the imports.mak file in the MSP432 SDK installation directory (by default this is located at C:/ti/simplelink_msp432_sdk_1_20_00_45, however it may vary depending on your software setup). Open the imports.mak file and scroll down to where the IAR_ARMCOMPILER variable is defined:

External variables

This variable needs to be populated to point to the local IAR ARM Embedded Workbench directory. The caveat here is that the build tools do not play well with spaces so the path needs to converted into a DOS friendly format. If your IAR installation path does not include spaces you can skip this step and just add the path directly to the imports.mak file. To generate a build friendly path, open a Windows command prompt and navigate to the arm directory in your IAR installation folder. Run the command as follows:

for %I in (".") do echo %~sI 

Space friendly path

A spaceless path will be generated and can be put directly in your imports.mak file.

Note that the only other variable in the imports.mak file that needs to be populated is the XDC_INSTALL_DIR variable. This is the variable that points to TI’s special build utilities. This is installed in the parent folder of the MSP432 SDK installation and also needs to be space friendly (follow the above steps if the path has spaces in it).

Also note that the CCS_ARMCOMPILER and the other variables do not need to be defined (and might result in build errors if they are defined incorrectly) so it is best to keep them blank if CCS/GCC is not being used.

After these variables are defined it is time to build the TI-RTOS release. To do this, open a Windows command prompt and navigate to the TI-RTOS build directory. This directly is located in the MSP432 SDK installation directory (by default C:/ti/simplelink_msp432_sdk_1_20_00_45/kernel/tirtos/builds/MSP_EXP432P401R/release/iar). From this folder invoke the gmake command as follows:

C:\ti\xdctools_3_32_01_22\gmake.exe

This command might slightly vary depending on where xdctools is installed. If all went well, the TI-RTOS IAR library will build without issue similar to below:

Built TI-RTOS library

Now that the TI-RTOS libraries have been built for IAR the IAR IDE can now be opened. 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

Next we need to make sure project connections are enabled in the IDE options. Navigate to Tools->Options from the top toolbar. Under the project tab ensure “Enable project connections” is checked.

Enable project connections

Now that the external software installation variables are imported and project connections are enabled, the SimpleLink MSP432 SDK Bluetooth Plugin example projects can be safely imported in IAR. For this example, we will use the Simple Application Processor example. First create a new workspace and project like you would any other IAR project. It is important to make an empty project when prompted by the new project wizard:

New project

After the empty project is made, the device variant has to be set to MSP432P401R. Right click the project and select Options. Under General Options select device and navigate to TexasInstruments->MSP432P401R. After selected click OK to shut out the dialog.

Set the variant

After the device variant has been set we are ready to enable to import the project connection. Navigate to Project->Add Project Connection…:

Add the project connection

From the dialog, select IAR Project Connection and click OK:

IAR Project Connection

In the following prompt, navigate to the code example under the examples/ folder that you want to import. There should be a subfolder labeled iar that contains the project connection file. Select that file and click Open.

Open connection file

If everything went correctly the example project will be imported into your project and you can build/debug the project like you would any other project (be sure to set the Debugger to CMSIS-DAP in the project settings and not the Simulator):

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 mailto:msp432_ble_plugin@list.ti.com