Table of Contents

Introduction

Simple Application Processor is a simple code example which showcases basic functionality of the SimpleLink MSP432 SDK Bluetooth Plugin. Simple BLE concepts such as characteristic manipulation and property notifications are examined. This code example is made to be a bare bones implementation that can be used as a basis for more elaborate implementations.

Hardware Prerequisites

Simple Application Processor requires the standard configuration of an MSP-EXP432P401R LaunchPad with an attached BOOSTXL-CC2650 BoosterPack or LAUNCHXL-CC2640R2 Launchpad. This hardware configuration is shown in the below image:

MSP432 LaunchPad with CC2650 BoosterPack

Alternatively, the CC2640R2 LaunchPad can be used in lieu of the CC2650 BoosterPack. In this case the CC2640R2 LaunchPad should be stacked on the MSP432 LaunchPad as seen below:

CC2640R2 on the MSP432

Software Prerequisites

This code example has been tested with IAR Embeded Workbench 8.20 and Code Composer Studio v8.0. For more information on how to import this project into your IDE workspace and build/run, please refer to the main user’s guide.

Service/Profile Table

Purpose UUID Format Properties Profile Source
LED Control 0xFFF1 Integer Read/Write simple_gatt_profile.c
Read 0xFFF2 Integer Read simple_gatt_profile.c
Write 0xFFF3 Integer Write simple_gatt_profile.c
Notify Characteristic 0xFFF4 Integer Notification simple_gatt_profile.c

Usage

Once the Simple Application Processor code example starts the output to the terminal will notify the user of initialization and then set the state of the application to idle.

Simple Application Processor Initialization

In idle mode, the application is in a low power mode and not actively advertising. In order to start advertising, the S1 switch on the LaunchPad needs to be pressed. The S1 switch can be found on the left side of the LaunchPad as pictured below:

Button Positions

Once the S1 button is pressed, the device will start advertising itself with a device name of “Simple AP”. Also note that once advertising (and while connected) the LED on the MSP432 LaunchPad’s LED1 pin is turned red to signify activity.

Simple AP BLE device

After connecting to the Simple AP device, the terminal screen should print that the peer was connected and also print the ID of the peer:

Connection Log

At this point the device is connected and successfully negotiated the connection details. Scrolling down past the product information (this might be different depending on your client) there should be a list of four different characteristics and their corresponding properties/values (these are described in detail in the following sections):

List of characteristics

LED Control (UUID: 0xFFF1)

Characteristic 1 in this code examples toggles the tricolor led connected to the LED2 pin of the MSP432 LaunchPad. Note that values written to this characteristic are irrelevant as any new value written simply toggles the LED between and off and on state. Select this characteristic and select to write a new value:

Characteristic 1

Enter any arbitrary number and select Done to finish the write:

Writing a value

After the value has been written the LED attached to LED2 on the MSP432 LaunchPad should turn on to its white color state:

LED on

Writing another value to the characteristic will cause the LED to turn off.

Read-Only Characteristic (UUID: 0xFFF2)

Characteristic 2 is a very simple characteristic that is simply read only. This might be useful if the BLE device has a constant that it needs to broadcast out to a device. Simply select this value and read the value to receive the constant integer value of 2:

Read only characteristic

Write-Only Characteristic (UUID: 0xFFF3)

Characteristic 3 is another very simple characteristic that is simply write only. No value can be actively read from this value. To write to this characteristic, simply choose it and write a new value:

Write only characteristic

Notification Characteristic (UUID: 0xFFF4)

Characteristic 4 is a notification characteristic which provides periodic notifications to listeners with updated values. In the case of this code example, the values that are notified occur on a period of every five seconds and simply consist of an integer value that is being incremented by one. To observe this notification, select the characteristic and enable notifications. You should see an incrementing value being displayed approximately every five seconds:

Notification characteristic

SimpleLink SDK Explorer

SimpleLink SDK Explorer is a customized mobile application from Texas Instruments that is designed to compliment various aspects of the SimpleLink SDK mobile ecosystem. Currently this application is available for iOS and Android devices.The code examples included in the SimpleLink SDK BLE Plugin are fully modeled and showcased as a part of SimpleLink SDK Explorer. From the Apple AppStore search for SimpleLink SDK and download the SimpleLink SDK Explorer.

The app can also be found at the links below:

Apple AppStore: https://itunes.apple.com/us/app/simplelink-sdk-explorer/id1237329921?ls=1&mt=8

Google Play: https://play.google.com/store/apps/details?id=com.ti.simplelinksdkexplorer&hl=en

Additionally, the full BSD licensed source code for both applications can be found at the link below: https://www.ti.com/tool/download/SIMPLELINK-SDK-BLUETOOTH-PLUGIN

Open the mobile application once it has been downloaded:

SimpleLink SDK Explorer Main Menu

From the main screen select the Profile Examples menu item. This will take you to a list of profile examples that correspond to each code example in the SimpleLink MSP432 SDK Bluetooth Plugin:

SimpleLink SDK Explorer Profiles

Select the Simple Application Processor menu item. On the next screen SimpleLink SDK Explorer will automatically scan for BLE devices in your vicinity. Make sure Bluetooth is enabled on your iOS device or else no devices will show up in this view. After pressing S1 on your MSP432 LaunchPad the Simple Application Processor will start to advertise and show up as “SimpleAP”:

SimpleAP

Select SimpleAP. The next screen will show the control view for all different characteristics of the Simple Application Processor code example:

Simple AP view

Pressing “Toggle LED” will cause a write to the LED service (0xFFF1) and cause the LED0 on the MSP432 LaunchPad to toggle. Pressing “Read Value” will read the current value from the read characteristic (0xFFF2) and writing a value will cause a write to the write characteristic (0xFFF3). Pressing the enable notifications button will enable notifications on the notification service (0xFFF4). This will cause the notification service to update and increment the value approximately every five seconds.

SBL Update

Updating the firmware on the CC2650 BoosterPack uses the SBL libraries to invoke the CC26xx’s bootloader and transfer the new firmware over serial. For Simple Application Processor, the method to trigger this invocation is to press and release the S2 button on the LaunchPad. Note that in order to trigger the firmware update, no active BLE device can be connected. Once S2 has been pressed, LED2 on the LaunchPad will toggle red to signal the BSL start:

SBL LED

*** 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. ***

The console screen will print the status of the firmware update as well as signal when the update has finished. At the end of the update the status of the update will be printed over the serial port and the MSP432 will reboot itself:

SBL log