Skip to content

Commit b848bcc

Browse files
author
Sean Lyons
committed
Merge pull request #91 in SA/ble_examples from feature_sss-2.40 to develop
Squashed commit of the following: commit cc9064bc3abfd1e627f3e803e6888625683c559c Author: Max Wennerfeldt <[email protected]> Date: Tue Feb 19 09:15:56 2019 +0100 Removed stale files commit 96aaefe6a8a6bf9253f290d489d4a70726134eff Author: Max Wennerfeldt <[email protected]> Date: Tue Feb 19 09:10:18 2019 +0100 Added SSS example, removed audio examples
1 parent 9a29b07 commit b848bcc

File tree

186 files changed

+26204
-36405
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+26204
-36405
lines changed

README.md

Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212

1313
# Introduction
1414

15-
These examples and demos are for **TI SimpleLink CC26x2 SDK 2.30.00.34**
15+
These examples and demos are for **TI SimpleLink CC13x2 / CC26x2 SDK 2.40.00.XX**
1616

1717
This repository contains *Bluetooth&reg;* 5 sample applications for
18-
Texas Instruments' SimpleLink CC26x2 SDK. These examples have not been
18+
Texas Instruments' SimpleLink CC13x2 / CC26x2 SDK. These examples have not been
1919
validated as production-ready.
2020

2121
**Do not** use GitHub's bug tracking feature for support. For inquiries, see the
2222
[Bluetooth&reg; low energy Forum](https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538).
2323

2424
To use the examples and tools in this repository, please download and install
25-
the [SimpleLink CC26x2 SDK](http://www.ti.com/tool/SIMPLELINK-CC26X2-SDK) **first**, and if
26-
necessary [buy an evaluation kit](http://www.ti.com/tool/LAUNCHXL-CC26X2R1).
25+
the [SimpleLink CC13x2 / CC26x2 SDK](http://www.ti.com/tool/SIMPLELINK-CC13X2-26X2-SDK) **first**, and if
26+
necessary [buy an CC26X2](http://www.ti.com/tool/LAUNCHXL-CC26X2R1) or [CC1352](http://www.ti.com/tool/LAUNCHXL-CC1352R1) evaluation kit].
2727

2828
If you have any questions please refer to the [FAQ page](docs/faq.md).
2929
For examples for other SDK versions and platforms, see table below.
@@ -36,13 +36,23 @@ For examples for other SDK versions and platforms, see table below.
3636
</tr>
3737
<tr>
3838
<td>
39-
<a href = "https://github.com/ti-simplelink/ble_examples/tree/simplelink_sdk-2.30">TI SimpleLink CC26x2 SDK 2.30.00.34 (current)</a>
39+
<a href = "https://github.com/ti-simplelink/ble_examples/tree/simplelink_sdk-2.40">TI SimpleLink CC13x2 / CC26x2 SDK 2.40.00.81 (current)</a>
4040
</td>
4141
<td>
4242
<ul>
43-
<li><a href="#full-duplex-bidirectional-audio-demo">Full Duplex Bidirectional Audio Demo (Central/Peripheral)</li>
44-
<li><a href="#i2s-echo">I2S Echo</li>
45-
<li><a href="#bluetooth-5-throughput-demo">Bluetooth 5 Throughput Demo</li>
43+
<li><a href="#simple-serial-socket">Simple Serial Socket</li>
44+
</ul>
45+
</td>
46+
</tr>
47+
<tr>
48+
<td>
49+
<a href = "https://github.com/ti-simplelink/ble_examples/tree/simplelink_sdk-2.30">TI SimpleLink CC26x2 SDK 2.30.00.34</a>
50+
</td>
51+
<td>
52+
<ul>
53+
<li>Full Duplex Bidirectional Audio Demo (Central/Peripheral)</li>
54+
<li>I2S Echo</li>
55+
<li>Serial Port Profile</li>
4656
</ul>
4757
</td>
4858
</tr>
@@ -184,8 +194,8 @@ The numbering scheme is in the form of M.mm.pp.bb. The fields pp.bb are incremen
184194
as GitHub examples are released, M.mm will map a GitHub release to a SimpleLink
185195
SDK release.
186196

187-
### 2.30.00.00
188-
Initial offering of SimpleLink CC26x2 SDK 2.30.00.34 examples.
197+
### 2.40.00.00
198+
Initial offering of SimpleLink CC13x2 / CC26x2 SDK 2.40.00.81 examples.
189199

190200
## Installation
191201

@@ -204,17 +214,17 @@ This repository can be cloned/download anywhere on your computer. There is a
204214
dependency between this repository and the SimpleLink CC26x2 SDK install
205215
location.
206216

207-
By default the SimpleLink CC26x2 SDK will install to:
217+
By default the SimpleLink CC13x2 / CC26x2 SDK will install to:
208218

209-
C:\ti\simplelink_cc26x2_sdk_2_30_00_34
219+
C:\ti\simplelink_cc13x2_26x2_sdk_2_40_00_81
210220

211-
If the SimpleLink CC26x2 SDK must be installed to a different location, then
221+
If the SimpleLink CC13x2 / CC26x2 SDK must be installed to a different location, then
212222
see the [FAQ page](docs/faq.md) for IDE specific instructions for changing
213223
environment variables.
214224

215225
## Required Tools
216226

217-
Similar to the SimpleLink CC26x2 SDK, the examples in this repository support
227+
Similar to the SimpleLink CC13x2 / CC26x2 SDK, the examples in this repository support
218228
the CCS and IAR toolchains. Please pay careful attention to versions of these
219229
tools, please refer to the release notes for supported versions.
220230

@@ -228,62 +238,51 @@ related to the ble_examples repo.
228238

229239
## Examples / Demo List
230240

231-
### Full Duplex Bidirectional Audio Demo
232-
233-
**Note: These examples will be deprecated as of the 2.40 SDKs.**
234-
235-
Encode and transmit a full duplex bidirectional audio stream over BLE using two
236-
CC26x2 LaunchPads with CC3200AUDBOOST.
237-
238-
* central\_bidirectional\_audio
239-
* [Documentation](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/central_bidirectional_audio/readme.md)
240-
* [CCS Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/central_bidirectional_audio/tirtos/ccs)
241-
* [IAR Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/central_bidirectional_audio/tirtos/iar)
242-
* [Source](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/central_bidirectional_audio/src)
243-
244-
* peripheral\_bidirectional\_audio
245-
* [Documentation](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/peripheral_bidirectional_audio/readme.md)
246-
* [CCS Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/peripheral_bidirectional_audio/tirtos/ccs)
247-
* [IAR Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/peripheral_bidirectional_audio/tirtos/iar)
248-
* [Source](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/peripheral_bidirectional_audio/src)
249-
250-
### I2S Echo
251-
252-
**Note: These examples will be deprecated as of the 2.40 SDKs.**
253-
254-
Read audio frames in from an external codec and loop them back using I2S.
255-
256-
* i2secho
257-
* [Documentation](examples/rtos/CC26X2R1_LAUNCHXL/drivers/i2secho/README.md)
258-
* [CCS Project Files](examples/rtos/CC26X2R1_LAUNCHXL/drivers/i2secho/tirtos/ccs)
259-
* [IAR Project Files](examples/rtos/CC26X2R1_LAUNCHXL/drivers/i2secho/tirtos/iar)
260-
* [GCC Project Files](examples/rtos/CC26X2R1_LAUNCHXL/drivers/i2secho/tirtos/gcc)
261-
* [Source](examples/rtos/CC26X2R1_LAUNCHXL/drivers/i2secho/)
262-
263-
### Bluetooth 5 Throughput Demo
264-
265-
Showcase a high (near theoretical max) data throughput over Bluetooth 5. The demo
266-
can be run with two CC26x2 Launchpads, or one CC26x2 Launchpad and one smartphone
267-
with the Simplelink Starter app.
268-
269-
* throughput\_peripheral
270-
* [Documentation](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/throughput_peripheral/readme.md)
271-
* [CCS Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/throughput_peripheral/tirtos/ccs)
272-
* [Source](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/throughput_peripheral/src)
273-
* throughput\_central
274-
* [Documentation](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/throughput_central/readme.md)
275-
* [CCS Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/throughput_central/tirtos/ccs)
276-
* [Source](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/throughput_central/src)
241+
### Simple Serial Socket
242+
243+
This is a UART over BLE bridge example where a Simple Serial Socket Client
244+
(SSSC) and Simple Serial Socket Server (SSSS) connect with one another and
245+
exchange UART data over the air. An generic Simple Stream Service is used
246+
making it easy to exchange data sink and source to create a custom serial
247+
socket over BLE implementation.
248+
249+
**Note: this example replaces the SPP over BLE example**
250+
251+
#### For CC1352
252+
253+
* Simple Serial Socket Client
254+
* [Documentation](examples/rtos/CC1352R1_LAUNCHXL/ble5apps/simple_serial_socket_client/readme.md)
255+
* [IAR Project Files](examples/rtos/CC1352R1_LAUNCHXL/ble5apps/simple_serial_socket_client/tirtos/iar)
256+
* [CCS Project Files](examples/rtos/CC1352R1_LAUNCHXL/ble5apps/simple_serial_socket_client/tirtos/ccs)
257+
* [Source](examples/rtos/CC1352R1_LAUNCHXL/ble5apps/simple_serial_socket_client/src)
258+
* Simple Serial Socket Server
259+
* [Documentation](examples/rtosCC1352R1_LAUNCHXL/ble5apps/simple_serial_socket_server/readme.md)
260+
* [IAR Project Files](examples/rtos/CC1352R1_LAUNCHXL/ble5apps/simple_serial_socket_server/tirtos/iar)
261+
* [CCS Project Files](examples/rtos/CC1352R1_LAUNCHXL/ble5apps/simple_serial_socket_server/tirtos/ccs)
262+
* [Source](examples/rtos/CC1352R1_LAUNCHXL/ble5apps/simple_serial_socket_server/src)
263+
264+
#### For CC26x2
265+
266+
* Simple Serial Socket Client
267+
* [Documentation](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_client/readme.md)
268+
* [IAR Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_client/tirtos/iar)
269+
* [CCS Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_client/tirtos/ccs)
270+
* [Source](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_client/src)
271+
* Simple Serial Socket Server
272+
* [Documentation](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_server/readme.md)
273+
* [IAR Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_server/tirtos/iar)
274+
* [CCS Project Files](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_server/tirtos/ccs)
275+
* [Source](examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_server/src)
277276

278277
## References
279278

280279
The following reference pages may be helpful during general Bluetooth Low
281280
Energy development. New users of the SimpleLink CC26x2 platform and Bluetooth
282281
5 development are encouraged to read the
283-
[BLE5-Stack User's Guide](http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC26X2%20SDK%2FDocuments%2FBLE5-Stack%2FBLE5-Stack%20User's%20Guide).
282+
[BLE5-Stack User's Guide](http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC13x2%2026x2%20SDK%2FDocuments%2FBLE5-Stack%2FBLE5-Stack%20User's%20Guide).
284283

285284
As an additional resource, users are encouraged to complete the
286-
[SimpleLink Academy](http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC26X2%20SDK%2FSimpleLink%20Academy)
285+
[SimpleLink Academy](http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC13x2%2026x2%20SDK%2FSimpleLink%20Academy)
287286
training.
288287

289288
Other resources can be found below:
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
2+
Purpose / Scope
3+
===============
4+
5+
This purpose of this example is to demonstrate a simple serial socket using
6+
TI's Simple Stream Server profile. The example showcase an simple UART over
7+
BLE implementation, the project is designed to allow the actual data sink and
8+
source to be easily exchanged for the purpose of creating a generic simple
9+
stream application.
10+
11+
Prerequisites
12+
=============
13+
14+
#### Hardware Requirements
15+
16+
Before running the demo, the user will need the following components:
17+
18+
- 2x [CC13x2 Launchpad](http://www.ti.com/tool/LAUNCHXL-CC1352R1)
19+
- 2x Micro USB cable
20+
21+
#### Firmware Requirements
22+
23+
- [CC13x2 / CC26x2 SDK](http://www.ti.com/tool/SIMPLELINK-CC13X2-26X2-SDK)
24+
25+
Simple Stream Server service
26+
============================
27+
28+
The simple stream service is made to implement a bi-directional data stream
29+
connection over the BLE protocol. The service uses a 128 bit UUID:
30+
F000C0C0-0451-4000-B000-00000000-0000. simple stream server service contains
31+
two characteristics, they are listed below.
32+
33+
| Characteristic | UUID |
34+
|:-----------------:|:-----------------------------------------:|
35+
|DataIn | F000C0C1-0451-4000-B000-00000000-0000 |
36+
|DataOut | F000C0C2-0451-4000-B000-00000000-0000 |
37+
38+
The `DataIn` characteristic implies data coming from client to server while
39+
`DataOut` is data outgoing from server to client.
40+
41+
For more information on the service, see the Simple Serial Socket Server example readme.
42+
43+
Simple Stream Client profile
44+
============================
45+
46+
The simple stream client profile provides an easy to use interface, similar to
47+
that of the simple stream server service, for interaction with a connected
48+
Simple Stream Server peripheral. Following a connection, the service table
49+
provided by the profile has to be populated with service handles before any
50+
data can be sent from the client to the server.
51+
52+
The service table can be easily populated by utilizing the simple service
53+
discovery API available in the example. To see how this API is used during the
54+
discovery process, refer to the `SimpleSerialSocketClient_processGATTDiscEvent`
55+
function found inside `simple_serial_socket_client`.
56+
57+
The profile provided APIs:
58+
* SimpleStreamClient_sendData(uint16_t* data, uint16_t len)
59+
* SimpleStreamClient_processStream()
60+
* SimpleStreamClient_disconnectStream()
61+
* SimpleStreamClient_enableNotifications(uint16_t connHandle)
62+
63+
The Simple Serial Client keeps an internal FIFO list for data sent to the
64+
profile using `SimpleStreamClient_sendData()`. When new data is sent to the
65+
profile, the internal queue will be processed and as much data as possible
66+
will be sent to the server using writes commands (no-respond).
67+
68+
> Note: The Simple Serial Client profile relies on dynamic memory allocated and
69+
> will use the application ICall heap to store the queued data.
70+
71+
If the profile is unable to send all data inside the current connection event,
72+
`SimpleStreamClient_processStream()` can be called in application space to
73+
process the internal queue again at another time.
74+
75+
If the client disconnects from the server, the internal queue can be flushed
76+
by calling `SimpleStreamClient_disconnectStream()`.
77+
78+
To receive incoming data, the client has to enable notifications. To do this,
79+
the `SimpleStreamClient_enableNotifications()` API can be used to enable
80+
notifications given the connection handle.
81+
82+
Running the Demo
83+
================
84+
85+
Running the demo is as simple and compiling and loading the code, then hooking
86+
up to your PC to send a receive data over UART. Please see the steps below:
87+
88+
1. Compile and load the code
89+
- Build LaunchPad #1 with the `simple_serial_socket_client`
90+
cc13x2r1lp_stack-FlashROM_Library project
91+
- Build and load LaunchPad #1 with the `simple_serial_socket_client`
92+
cc13x2r1lp_app-FlashROM_StackLibrary project
93+
- Build LaunchPad #2 with the `simple_serial_socket_server`
94+
cc13x2r1lp_stack-FlashROM_Library project
95+
- Build and load LaunchPad #2 with the `simple_serial_socket_server`
96+
cc13x2r1lp_app-FlashROM_StackLibrary project
97+
98+
2. Connect the Boards to the PC terminal
99+
- You can use the terminal to send data from your PC to the LaunchPad, and
100+
also display the info sent from one device to another.
101+
- You will need to open two instances of the terminal program to, one to
102+
communicate with each board.
103+
- Follow the steps from our [FAQ](faq.md) to connect to the LaunchPad boards
104+
- **Please note that the Simple Serial Socket project uses the default baud
105+
rate of 115200**
106+
107+
3. Power the boards individually and verify they are initialized
108+
- The client will auto connect to the server by looking for an advertisement
109+
containing the SSS service together with a
110+
matching manufacturer ID. The manufacturer ID can be changed in both
111+
projects to allow for multiple devices to run
112+
alongside each other.
113+
- Upon connecting the client and server will light the red LED. When
114+
notifications has been enabled and the stream is ready
115+
for use, the green LED will also be lit.
116+
- At this point you can type into either terminal window and watch it being
117+
echoed to the other terminal via BLE.
118+
119+
Improving UART performance for large data transfers
120+
===================================================
121+
122+
The default board file configures the size of the internal UART ring buffer to
123+
32 bytes. If the amount of data sent over UART to the device exceeds
124+
UART_MAX_READ_SIZE plus the size of the ring buffer, data loss is probable.
125+
This is due to the internal UART ring buffer wrapping before the application
126+
has the chance to process the previous UART buffer. To be able to handle
127+
larger chunks of data, the size of the ring buffer can be increased inside the
128+
board file.
129+
130+
In order to modify the size of the board file, the `board.c` file found inside
131+
the `Startup` folder need to be replaced with copies of the actual board
132+
files. This can be done by performing the following steps:
133+
134+
- Remove the `board.c` file found inside the `Startup` folder.
135+
- Copy the following files from `<SDK DIR>/source/ti/blestack/boards/CC1352R1_LAUNCHXL` directory into the projects `Startup` folder:
136+
- Board.h
137+
- CC1352R1_LAUNCHXL.h
138+
- CC1352R1_LAUNCHXL.c
139+
- CC1352R1_LAUNCHXL_fxns.c
140+
141+
The ring buffer size can now be changed by resizing the uartCC26XXRingBuffer
142+
array found inside `CC1352R1_LAUNCHXL.c`.
143+
144+
It is also possible to modify the shared `CC1352R1_LAUNCHXL.c` file that
145+
`board.c` imports directly instead of coping the board files into the project.
146+
This is however not recommended as changes will propagate to all BLE examples
147+
that depend on the shared file.

0 commit comments

Comments
 (0)