I want to connect wireless sensors to a BLE enabled device like a smartphone or tablett.

The SimpleLink™ Bluetooth low energy/Multi-standard SensorTag CC2650STK is a tiny board based on the CC2650F128RGZ. I like because of:

  • the small footprint (32 x 41 mm) allowing for integration in an existing project (for example via UART) thus enabling BLE connectivity without having to deal with RF board design,

  • the comprehensive set of available sensors.

Getting started with the SensorTag wasn’t as easy as I hoped and this is a write-up of the problems I encountered.

Source code related to this note can be cloned from the compagnion repo.

1. Introduction

The name CC2650STK is the official part number for the development kit, also called SensorTag hereafter. A similar product Simplelink CC1350 SensorTag Bluetooth and Sub-1GHz Long Range Wireless Development Kit with dual-band capability is also available Getting started with the TI SensorTag CC1350. I prefer the CC1350STK for reasons discussed later.

2. Problems

The problems encountered and discussed on the TI E2E™ support forums revolve around several topics:

  1. the SensorTag App [e2e1], [e2e2], [e2e6]

  2. installation problems [e2e11]

  3. software availability [e2e3], [e2e9]

  4. choice of the debug probe [e2e4], [e2e5], [e2e8]

  5. project configuration files [e2e4], [e2e8], [e2e12]

  6. connection problems [e2e4], [e2e10]

  7. logging [e2e7]

3. Hardware Preparation and Requirements

I used the following hardware:

and the following software;

  • Linux Mint 18.2

  • Code Composer Studio 9.1 (CCS)

  • TI-RTOS for CC13XX and CC26XX, version 2.21.0.06 [st-sw1]

  • XDCtools version 3.32.0.06_core

The Sensor Tag comes with a lithium coin cell. For development, I prefer a stable lab power supply:

CC2650STK
Figure 1. The CC2650STK without coin cell slot ready for an external supply (1.8V - 3.8V)
If you leave the coin battery inserted during debugging (which is not recommended), the battery will be drained in less than a day.

3.1. Using the XDS110 debug probe

The XDS110 JTAG Debug Probe can be hooked up to the SensorTag via a JTAG cable and a small adapter board.

while the connection between the probe and the SensorTag is electrically correct, I was unable to get the XDS110 to work in with the SensorTag.
JTAG connection
Figure 2. JTAG connection between the XSD110 debugger and the CC2650STK ( the small adapter PCB is part of the XDS110 deliverable)

3.2. Using the SensorTag DevPack

The SimpleLink SensorTag Debugger DevPack is the recommended probe for the SensorTag.

DevPack
Figure 3. The DevPack probe mounted onto the CC2650STK
Remove the coin battery, it will be quickly drained by the debug connection.

4. Loading the sample project

Use the uartecho_CC2650STK project because it not only serves as a basic sanity check for the environment but also as a proof that the serial-over-USB host-target connection works as expected.

Download and install the project from the Resource Explorer:

sample project
Figure 4. Loading the sample project into the IDE

Verify that the required products are installed and selected:

required products
Figure 5. Required products

Verify the target configuration:

target configuration
Figure 6. Target configuration

And the debug settings:

debug settings
Figure 7. Debug settings

Ready to start the first debug session. Before doing so, I activate the System Analyzer. This is an optional step and applies to all TI-RTOS based projects, not only to SensorTag projects.

5. Using the System Analyzer

The README.md file of the sample project claims that the System Analyzer Unit is enabled. This is not correct and opening the System Analyzer (Tools → System Analyzer → Duration in the Debug Perspective), will show an error message:

Analysis Configuration
Figure 8. System Analyzer unconfigured

The System Analyzer must be enabled by modifying the TI-RTOS config file uartecho.cfg [e2e7]:

uartecho.cfg
BIOS.logsEnabled = true; // 1. Enable BIOS logging:
// 2. Disable the ROM build by commenting out these lines:

//var ROM = xdc.useModule('ti.sysbios.rom.ROM');
if (Program.cpu.deviceName.match(/CC2640R2F/)) {
//    ROM.romName = ROM.CC2640R2F;
}
else if (Program.cpu.deviceName.match(/CC26.2/)) {
//    ROM.romName = ROM.CC26X2V2;
}
else if (Program.cpu.deviceName.match(/CC13.2/)) {
//    ROM.romName = ROM.CC13X2V2;
}
else if (Program.cpu.deviceName.match(/CC26/)) {
//    ROM.romName = ROM.CC2650;
}
else if (Program.cpu.deviceName.match(/CC13/)) {
//    ROM.romName = ROM.CC1350;
}

var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup'); // 3. Add LoggingSetup
var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');
LoggingSetup.benchmarkLogging = true;
LoggingSetup.mainLoggerSize = 512;

Instrument the source code:

uartecho.c
#include <ti/uia/runtime/LogUC.h>
#include <ti/uia/events/UIABenchmark.h>

// ....

Log_write1(UIABenchmark_start, (IArg) "prompt"); (1)
UART_write(uart, echoPrompt, sizeof(echoPrompt));
Log_write1(UIABenchmark_stop, (IArg) "prompt"); (2)

// ....

while (1) {
   UART_read(uart, &input, 1);
   Log_write1(UIABenchmark_start, (IArg) "write"); (3)
   UART_write(uart, &input, 1);
   Log_write1(UIABenchmark_stop, (IArg) "write"); (4)
 }
1 open the first duration measurement named prompt
2 close the first duration measurement named prompt
3 open the second duration measurement named write
4 close the second duration measurement named write

Start a debug session and after the target has stopped at main, start the duration analysis (Tools → System Analyzer → Duration) and then resume the debug session. In a serial terminal, enter a couple of caracters and then pause the target.

The Duration tab will show the elapsed time for each log:

Duration
Figure 9. Measured durations

Ready to start the first debug session with the uartecho_CC2650STK_TI sample project.

6. Conclusion

The SensorTag is not a full blown development kit and there is a reason why the product page SimpleLink™ Bluetooth low energy/Multi-standard SensorTag CC2650STK recommends to use a suitable LaunchPad rather than the SensorTag for development. However, the corresponing LaunchPad has a much larger footprint and no sensors, therefore the SensorTag can provide value for small projects and prototypes where BLE connectivity and additional sensors are desirable. I prefer to use the Simplelink CC1350 SensorTag Bluetooth and Sub-1GHz Long Range Wireless Development Kit. This kit has the same footprint, similar sensors and is part of the SimpleLink product family. It therefore enjoys much better documentation, tool support and Linux support for the BLE stack, see Getting started with the TI SensorTag CC1350.

7. References

7.4. TI E2E support forum

7.4.1. dicussions started by the author