Académique Documents
Professionnel Documents
Culture Documents
Introduction
Flexibility
High Performance
Mature solution
TI first to market (2010)
>7000kits shipped
Leading market share (IMS/ABI)
Powerful
>1 year battery life with
CR2032
97dB link budget
Flexible configuration
Central/Peripheral role switching
Combo Roles
Over-the-air SW update
Boot Image Manager (BMI)
Ultra-low power
Very low-power sleep modes
Short transition times between
operating modes
Ref.design with dc-dc
(TPS62730)
Support
www.ti.com/ble
Most active BLE community
(www.ti.com/ble-forum)
All information publicly available
Nokia
Lifesense
Proximity tag
Precious Tag
UnderArmor
Heart Rate Monitor
Ruwido/Swisscom
Remote Control
Kwikset
Schneider
Notebook protector
Misfit Wearable's
KEEO
Smart Key
UniKey
LifeTrak
Parrot
TetherCell
BACTrack
Bluetrek
Polar
ZOMM
Recon
Schneider
Ace Sensor
MonBaby
IDT
SoundOfMotion
Griffin
Citizen
Tom Tom
TI track record
July 2010
Bluetooth 4.0
standard adopted by
Bluetooth SIG
Oct. 2010
CC2540 was the first
single-mode Bluetooth
low energy IC
Aug 2011
TI BLE stack 1.1
released, including
support for all profiles
released to date
July 2011
TPS63730
companion DC/DC
released, enhancing
battery life by 20%
Feb 2012
CC2541 released,
providing 33%
improvement in
power consumption
Jan 2012
First Bluetooth low
energy product.
Recon Instruments
releases ski goggles
with BLE remote control
July 2012
BLE stack 1.2
released, including
support for switching
between master and
slave roles
May 2012
5000 development
kit sold
"As shown with its certifications, new profile offerings and updated Bluetooth low energy stack, we are
pleased to see TI playing a critical role in delivering Bluetooth v4.0 with low energy capabilities to new
places from health monitoring to fitness equipment, alert notifications and more.
Mike Foley, Ph. D., Executive Director, Bluetooth SIG
Dec 2012
BLE stack 1.3
released, including
support for Over-theAir download
TI Hardware
10
CC2540
Flash SoC
USB
CC2541
Flash SoC
I2C
CC2541S
Flash WNP
One-Chip Solution
Two-Chip Solution
(Network Processor)
CC2540
CC2541
MCU
CC2540
CC2541
CC2541S
Application + Profiles
BLE Stack
Serial
11
CC2540
Flash SoC
USB
CC2541
Flash SoC
I2C
CC2541S
Flash WNP
Development Kits
CC2540DK-MINI
CC2541DK-MINI
BOOST-CC2541S
CC2540DK
CC2541EMK
CC2541DK-SENSOR
CC2541DK-RC
BoosterPack for
MSP430, Stellaris
and C2000
Targiting Smart
Phone App
developers.
Provides sensor data
from 6 sensors
Operates as a
mouse, keyboard
and consumer
remote using
HOGP
12
Download
Order Kit
Order
Kit
Download
SW Stack
Software Solution
14
Application
HAL
Apps
GAP Role
Profile
GATT Service
Profile
...
Library
Other Profiles
Attribute Protocol
Security Manager
Stack
HCI
Link Layer
Physical Layer
OSAL = Operating System Abstraction Layer (Prioritized task handling loop)
HAL = Hardware Abstraction Layer (Drivers and API for LEDs, Buttons etc)
Full API to access all stack functionality in the stack (Library) from the Application and Profiles
15
Sniffer
Capture Bluetooth low energy
communication live with full
overview.
Flash Programmer
Program CC254x devices
Read and write IEEE addresses
16
Online documentation
TI BLE Product Page (www.ti.com/ble)
TI BLE Wiki (www.ti.com/ble-wiki)
Online Support
TI BLE E2E forum
Data Sheets
User Guides
Reference Designs
Application Notes
Application Examples
Walkthrough
Step by Step guides
FAQ
17
18
GAP - Roles
GAP
PHY
19
GAP
PHY
20
General
Heart Rate
Glucose
HID Keyboard
Etc.
SimpleBLEPeripheral
SimpleBLECentral
SimpleBLEBroadcaster
SimpleBLEObserver
- Certified
- Certified
- Certified
- Certified
- Certified
- Certified
- Certified
- Certified
- Certified
- Certified
- Certified
Proprietary Profile
Uses GATT Architecture for easy implementation
(www.ti.com/ble-stack)
(www.ti.com/ble-wiki)
(www.uuidgenerator.com)
(www.bluetooth.org)
Faster implementation
Ensure interoperability
TI base UUID
F000XXXX-0451-4000-B000-000000000000
22
Flash [KBytes]
RAM [KBytes]
SimpleBLEPeripheral
114
6.2
SimpleBLECentral
123
7.2
SimpleBLEObserver
43
3.3
SImpleBLEBroadcaster
39
3.3
KeyFobDemo
116
6.4
Heart Rate
112
6.1
151
7.5
Profiles
Flash [KBytes]
RAM [KBytes]
1.068
0.176
0.678
0.078
Battery Service
0.846
0.053
Proximity
0.984
0.094
23
24
Embedded Software
Development
Application
HAL
Apps
GAP Role
Profile
GATT Service
Profile
...
Other Profiles
Source
Library
Attribute Protocol
Security Manager
Stack
HCI
Link Layer
Physical Layer
OSAL = Operating System Abstraction Layer (Prioritized task handling loop)
HAL = Hardware Abstraction Layer (Drivers and API for LEDs, Buttons etc)
Full API to access all stack functionality in the stack (Library) from the Application and Profiles
25
Developers resources
User Application
HAL
Other
Profiles
HAL
Some are very specific to our boards/ICs
APP
User application
Specific drivers
PROFILES
Adopted (Battery, Proximity)
Proprietary (Accelerometer, SimpleKeys)
26
ID
Task
Link Layer
HAL
HCI
L2CAP
GAP
GATT
SM
GAP Role
10
GATT Server
11
Application
27
Key APIs:
osal_init_system
osal_start_system
Initializes OSAL
Starts the OSAL main loop
osal_set_event
osal_start_timerEx
osal_stop_timerEx
osal_msg_allocate
osal_msg_send
osal_msg_deallocate
osal_mem_alloc
osal_mem_free
Additional information on the OSAL can be found in the OSAL API guide:
C:\Texas Instruments\BLE-CC2540\Documents\osal\OSAL API.pdf
28
Board init,
Tasks init()
Task n++
has events
n > tasks
n=0
Yes
No
Call task ns
ProcessEvent CB
Schedule wakeup.
Sleep.
osal_run_system()
29
simpleBLEperipheral.c (application)
ISR
(set debounce timer)
OSAL
osal_set_timer
SimpleBLEPeripheral_ProcessEvent
1
ProcessOSALMsg
osal_msg_send
performPeriodicTask
(update a value)
osal_run_system
handleKeys
(Send notification)
hal_drivers.c
peripheralStateNotificationCB
(Write to LCD)
Hal_ProcessEvent
(send keypress msg to app)
2
peripheral.c
GAPRole_ProcessEvent
GATTServApp (LIB)
simpleGATTprofile.c
simpleProfile_WriteAttrCB
30
ADC
UART
SPI
Flash
Timers
Sleep
Keys
LED
LCD
Additional details on HAL functions can be found in the HAL API Guide:
C:\Texas Instruments\BLE-CC2540\Documents\hal\HAL Driver API.pdf
31
OAD Profile
Over the Air Download
32
OAD Target
Application
OAD Image
OAD Image
Binary image
over BLE
OAD Image
BIM
34
Application
OAD Image
OADManager
Use SBL Tool towards a SmartRF05+EM that runs OADManager
MultiTool
Runs on an iOS Device
Device Monitor
Runs on PC and utilizes CC2540USB Dongle
35
OAD Target
OAD Image A
OAD Image B
BIM
Memory Architecture
37
38
{
//
//
//
//
//
00:00:00:7C:41:41:41:41
Version
Length
User Defined ID
OAD Resources
41
Device Monitor
Debugging and Features
42
43
Device Monitor
Easy to download image
But it takes some time...
44
45
C Compiler
Assembler
Library Builder
Support for Hardware Debugger
Go to definition
If you ever wonder what a function
does, how and where a macro or
variable is defined:
1. Right click on a symbol you want
to follow
2. Press Go to definition of...
APP/keyfobdemo.c
2
HAL/Target/CC2540EB/Drivers/hal_led.c
3
4
47
2. Press CTRL+SHIFT+F
3
Declaration
Definition
Calls to function
48
1,2
3. Download,
4. Run,
5. Step Over,
Ctrl+D or
F5 or
F10 or
Note that breaking the code during a connection will terminate the connection
49
Hairline fracture
Right click on a breakpoint
Choose Edit Breakpoint...
Dont break the code until its helpful
Skip a number of breaks
Break on a condition
50
51
2
1
3
52
Watch Out
Avoid compiling with optimization when debugging is on the Menu
Variables are often Unavailable with optimization on
Add volatile to the declaration, i.e. volatile uint8 variable;
If that doesnt work, move the declaration outside the function.
Single stepping (F11) will sometimes behave oddly or break IAR.
Assembly code is moved around and changed with optimization, so if
debugging features are unavailable, try turning optimizations off.
53
54
TI BLE Subsystems
TI BLE Subsystem
QDID
Include
Controller
Host
Profile
B016552
B017183
B020954
HCI
Link Layer
RF PHY
GAP
GATT
ATT
SMP
L2CAP
HCI
SensorTag
Evaluation
56
6 sensors
Temperature
Humidity
Pressure
Accelerometer
Gyroscope
Magnetometer
Push
Buttons
Debug
CC2541
LEDs
Ez430
I2C
KTXJ9
IMU-3000
T5400
SHT21
MAG3110
TMP006
Acceleration
Rotation
Pressure
Humidity
Magnetic Field
Temperature
58
IR Temperature
sensor
Accelerometer
Gyroscope
Interface Connector
For EZ430 battery packs
(optional)
User
Buttons
Debug Header
MCU + BLE Transciever
LEDs
Airflow for
Humidity Sensor
DCDC
Converter
PCB Antenna
CR2032 Coincell
Battery Holder
Pairing Button
Humidity sensor
Hands-On: SensorTag
Pre-requisites
BLE Device Monitor (http://www.ti.com/lit/zip/swrc258)
Packet Sniffer
(http://www.ti.com/tool/packet-sniffer)
62
System Overview
Bluetooth
low energy
Central Device
Peripheral Device
Master
Client (wants data)
Slave
Server (has data)
BLE Sniffer
63
64
65
66
67
68
69
Select Monitoring
Select the sensors
Click on Start
71
Evaluation of CC2541DK-MINI
72
CC2541DK-MINI Unboxing
Quick Start Guide
Keyfob Casing
CC2541 Keyfob
CC2540USB Dongle
CC Debugger
OR
Setup PC environment
1. Insert CC2540 USB Dongle
2. Install driver, located at ..\BLE-CC254x-1.3\Accessories\Drivers
3. Start BTool
1.
2.
75
Evaluate CC2541DK-MINI
Device information
Message Log
Device Control
76
77
BEEP
78
79
80
81
Profile in yellow,
Services in orange
82
Legend, properties
Notification
Read
Write
WriteNoRsp
Battery
service
Scan
Param.
Service
HID
Service
HID Keyboard IN
HID Consumer Control IN
HID LED OUT
Boot Keyboard IN
Boot Keyboard OUT
Boot Mouse IN
Feature report
IN = To host
OUT = To device
Typical
dataflow
Scan keys on ISR
hal_motion.c
MOVEA library
AIR_MOTION_LIB_3G3A-Banked.r51
X + Y Mickeys
Application callback
Application callback
hidAdvRemote.c : KeyCback
hidAdvRemote.c : MotionSensorCback
X + Y Mickeys
hidAdvRemote.c :hid[Key|CC]SendReport
hidAdvRemote.c : hidMouseSendReport
Queue report
hidDev.c : HidDev_Report
Send report
hidDev.c : hidDevSendReport
GATT Notification
BLE Stack
84
* Application turns off polling when idle, then restarts on Acc ISR if applicable
86
87
Using Xcode
iOS apps are separated* into Model, View and Controller (MVC).
In our example, CoreBluetooth callbacks are in the ViewControllers, and
some CoreBt functions are wrapped for convenience in BLEUtility
88
*ideally
89
91
References
Getting started with iOS development
Setting up account and development environment (Xcode)
Developing, installing and testing an app
Distributing on the appstore (pretty complicated)
https://developer.apple.com/programs/ios/gettingstarted/
Objective-C and iOS
If you are familiar with C:
http://en.wikipedia.org/wiki/Objective-C (very helpful)
Your first iOS app
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/ipho
ne101/Articles/00_Introduction.html
BLE Blog by Ole Andreas Torvmark (TI Contractor in Oslo)
http://ble.stalliance.no/
93
94
Thank You
95
TI BLE-Stack
http://www.ti.com/ble-stack
http://www.ti.com/sensortag
96