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:
3. Hardware Preparation and Requirements
I used the following hardware:
-
the SimpleLink™ Bluetooth low energy/Multi-standard SensorTag CC2650STK
-
the XDS110 JTAG Debug Probe (not supported, as it turned out) and the SimpleLink SensorTag Debugger DevPack
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:
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. |
3.2. Using the SensorTag DevPack
The SimpleLink SensorTag Debugger DevPack is the recommended probe for the SensorTag.
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:
Verify that the required products are installed and selected:
Verify the target configuration:
And the 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:
The System Analyzer must be enabled by modifying the TI-RTOS config file uartecho.cfg
[e2e7]:
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:
#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:
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
TI E2E support forum
dicussions started by the author
-
[] CC2650STK: SensorTag doesn’t show up in device list of TI SensorTag App
-
choosing the right app: the flyer in the box mentions an app that is not available anymore, the SimpleLink SensorTag on Google Play is the correct one, although the CC2650STK is not part of the SimpleLink family
-
granting permissions: for some reason you must grant access to your phone’s location. This is not only annoying because this is supposed to be demo software, but also the app doesn’t work without warning if you don’t grant access.
-
also applies to the CC1350STK.
-
-
[] CC2650STK: Cloud Settings for the IBM IOT platform for BlueMix Free
-
currently the IBM Watson IoT platform access (as opposed to the IBM Quickstart access) is not available with the SimpleLink SensorTag app due to a bug.
-
also applies to the CC1350STK.
-
-
[] CC2650STK: Is there a linux compatible BLE stack for the CC2650STK
-
no, this is one of the idiosyncrasies of the CC2650STK, refer to the Simplelink CC1350 SensorTag Bluetooth and Sub-1GHz Long Range Wireless Development Kit for a Linux compatible BLE development environment.
-
-
[] CCS/CC2650STK: Failed to launch debug session for CC2650STK
-
contrary to what the discussion suggests, the target configuration of the uartecho_CC2650STK project is correct, no modification is required.
-
contrary to what the discussion suggests, the XDS110 JTAG Debug Probe is currently not supported for the Sensor Tags, use the SimpleLink SensorTag Debugger DevPack.
-
contrary to what the discussion suggests, the coin battery must not be inserted during debugging, the target is powered by the SimpleLink SensorTag Debugger DevPack.
-
also applies to the CC1350STK.
-
-
[] CCS/CC2650STK: Can I use CCS and the XDS110 debug probe to program and debug the CC2650STK SensorTag
-
while it is possible to connect the XDS110 JTAG Debug Probe, see Figure XDS110 connection, this debug probe is currently not supported for the Sensor Tag.
-
also applies to the CC1350STK.
-
-
[] CC1350STK: Downloading new firmware images to the device via the Over-the-Air-Download (OAD) service not as described in doc
-
this is currently an open question for the SimpleLink SensorTag app team.
-
also applies to the CC2650STK.
-
-
[] CCS/CC2650STK: Can’t start the System Analyzer despite the README.md saying so
-
see chapter Using the System Analyzer
-
applies to all TI-RTOS based projects.
-
-
[] CC2650STK: Can’t use UART on CC2650 STK
-
this was due to the usage of the XDS110 JTAG Debug Probe debug probe in conjunction with the suggested modification of the target configuration file in [e2e5].
-
also applies to the CC1350STK.
-
-
[] CC1350STK: Where is the out-of-box demo source code for the CC1350 and CC2650 Sensor Tags ?
-
the out-of-box demo source code is not available. Why ?
-
also applies to the CC2650STK.
-
-
[] CCS/CC1350STK: Empty project debug session not as expected
-
I am unable to reproduce the errors mentioned. I suppose that they were related to the usage of the XDS110 JTAG Debug Probe rathern than the SimpleLink SensorTag Debugger DevPack.
-
also applies to the CC2650STK.
-
-
[] CCS/CODECOMPOSER: Code Composer Studio 9 Installer hangs on Windows 7 SP1
-
installing the CC13x and CC26xx device support on Windows 7 Pro fails, this is a bug related to the TI emulator driver installation.
-
-
[] CCS/CC1350STK: Setting for Power Selection for CC1350STK and for CC2650STK
-
the power selection in the target configuration files of the example projects are correct, when using SimpleLink SensorTag Debugger DevPack. The battery/power supply must be removed during debugging.
-
also applies to the CC2650STK.
-
related discussions started by other users
-
[] CCS/CC2640R2F: INFO — Cortex_M3_0: File Loader: Memory write failed: Timed out waiting for target flashloader to execute command. Tags: Connection ….
-
[] CCS/CC2650: Memory write failed: Timed out waiting for target to halt
-
[] CCS/CC2640: The program works perfectly on first launch, but has "Memory write failed" error on the next launch.