QSG126: Bluetooth Developer Studio Quick-Start Guide

Similar documents
EFM8 Laser Bee Family QSG110: EFM8LB1-SLSTK2030A Quick Start Guide

EFM32 Pearl Gecko Family QSG118: EFM32PG1 SLSTK3401A Quick- Start Guide

QSG123: CP2102N Evaluation Kit Quick- Start Guide

EFM8 Universal Bee Family EFM8UB2 Errata

QSG144: CP2615-EK2 Quick-Start Guide

AN125 INTEGRATING RAISONANCE 8051 TOOLS INTO THE S ILICON LABS IDE. 4. Configure the Tool Chain Integration Dialog. 1. Introduction. 2.

UG365: GATT Configurator User s Guide

QSG114: CPT007B SLEX8007A Kit Quick- Start Guide

EFM32 Happy Gecko Family EFM32HG-SLSTK3400A Quick-Start Guide

AN999: WT32i Current Consumption

EFM8 Busy Bee Family EFM8BB2-SLSTK2021A Quick Start Guide

QSG107: SLWSTK6101A/B Quick-Start Guide

AN1160: Project Collaboration with Simplicity Studio

QSG155: Using the Silicon Labs Dynamic Multiprotocol Demonstration Applications

SMBus. Target Bootloader Firmware. Master Programmer Firmware. Figure 1. Firmware Update Setup

QSG107: SLWSTK6101A/B Quick-Start Guide

QSG107: SLWSTK6101A Quick-Start Guide

QSG119: Wizard Gecko WSTK Quick-Start Guide

QSG153: Micrium s μc/probe Tool Quick- Start Guide

EFM32 EFM32GG11 Giant Gecko Family QSG149: EFM32GG11-SLSTK3701A Quick-Start Guide

AN976: CP2101/2/3/4/9 to CP2102N Porting Guide

QSG159: EFM32TG11-SLSTK3301A Quick- Start Guide

Figure 1. Precision32 AppBuilder

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

AN888: EZR32 Quick Start Guide

The process also requires the use of the following files found in the Micriµm Quick Start Package for the FRDM-KL46Z:

Software Release Note

UG254: CP2102N-MINIEK Kit User's Guide

CP2103-EK CP2103 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup USBXpress Driver Development Kit

CP2104-EK CP2104 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup USBXpress Driver Development Kit

Figure 1. CP2108 USB-to-Quad UART Bridge Controller Evaluation Board

µc/probe on the Freescale FRDM-KL05Z without an RTOS

UG369: Wireless Xpress BGX13P SLEXP8027A Kit User's Guide

WT12 EVALUATION KIT DATA SHEET. Monday, 09 September Version 1.7

CP2105-EK CP2105 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup USBXpress Driver Development Kit

UG313: Thunderboard Sense 2 Bluetooth Low Energy Demo User's Guide

UG366: Bluetooth Mesh Node Configuration User s Guide

UG345: Si72xx Eval Kit User's Guide

AN888: EZR32 Simple TRX Application Quick Start Guide

Si1146 UVIRSlider2EK Demo Kit

Date CET Initials Name Justification

Humidity/Temp/Optical EVB UG

Wireless Development Suite (WDS) is a software utility used to configure and test the Silicon Labs line of ISM band RFICs.

QSG139: Bluetooth Development with Simplicity Studio

AN1083: Creating and Using a Secure CoAP Connection with ARM s mbed TLS

Translate HCSL to LVPECL, LVDS or CML levels Reduce Power Consumption Simplify BOM AVL. silabs.com Building a more connected world. Rev. 0.

EFM8 Universal Bee Family EFM8UB1 Errata

AN719 PRECISION32 IDE AND APPBUILDER DETAILED TUTORIAL AND WALKTHROUGH. 1. Introduction. Figure 1. Precision32 IDE and AppBuilder Walkthrough Overview

Date CET Initials Name Justification

EFR32 Mighty Gecko Family EFR32MG1 with Integrated Serial Flash Errata History

AN1117: Migrating the Zigbee HA Profile to Zigbee 3.0

UG294: CPT213B SLEXP8019A Kit User's Guide

BRD4300B Reference Manual MGM111 Mighty Gecko Module

AN1143: Using Micrium OS with Silicon Labs Thread

AN1023: HTTP SERVER EXAMPLE

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

μc/probe on the RIoTboard (Linux)

CP2114 Family CP2114 Errata

UG271: CP2615-EK2 User's Guide

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

UG322: Isolated CAN Expansion Board User Guide

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

μc/probe on the element14 BeagleBone Black

UG235.01: Developing Code with Silicon Labs Connect

AN1083: Creating and Using a Secure CoAP Connection with ARM s mbed TLS

UG103.13: Application Development Fundamentals: RAIL

EFM8 Busy Bee EFM8BB1 Errata

QSG166: WF200 Wi-Fi Development Kit Quick Start Guide

Router-E and Router-E-PA Wireless Router PRODUCT MANUAL

AN324 ADVANCED ENCRYPTION STANDARD RELEVANT DEVICES. 1. Introduction. 2. Implementation Potential Applications Firmware Organization

EFR32MG13, EFR32BG13 & EFR32FG13 Revision C and Data Sheet Revision 1.0

AN1139: CP2615 I/O Protocol

8-Bit MCU C8051F85x/86x Errata

EFM32 Zero Gecko EFM32ZG Errata

AN1106: Optimizing Jitter in 10G/40G Data Center Applications

AN1053: Bluetooth Device Firmware Update over UART for EFR32xG1 and BGM11x Series Products

Si1140-DK. Si1140 DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. Figure 1. Si1143 Evaluation Board

UG274: Isolated USB Expansion Board User Guide

C8051F411-EK C8051F411 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Kit Overview. 3. Evaluation Board Interface LCD User Interface

USBXpress Family CP2102N Errata

Table 1. Kits Content. Qty Part Number Description. Si4010 Simplified Key Fob Demo Kit 868 MHz

AN0059.1: UART Flow Control

Bluegiga WF111 Software Driver Release Notes

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

ETRX3DVK Development Kit Quick-Start Guide

AN1114: Integrating Silicon Labs Bluetooth Applications with the Micrium RTOS

Date CET Initials Name Justification

UG352: Si5391A-A Evaluation Board User's Guide

2. Key Points. F93x F92x F91x F90x. Figure 1. C8051F93x-C8051F90x MCU Family Memory Size Options

QSG108: Getting Started with Silicon Labs Bluetooth Software

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

AN1095: What to Do When the I2C Master Does Not Support Clock Stretching

C8051F36x-DK. C8051F36x DEVELOPMENT KIT USER S GUIDE. 1. Relevant Devices. 2. Kit Contents. 3. Hardware Setup Using a USB Debug Adapter

Also available for purchase separately are socket daughter boards for the QFN-11 and QFN-10 packages.

UG103.7: Tokens Fundamentals

The Si50122-Ax-EVB is used to evaluate the Si50122-Ax. Table 1 shows the device part number and corresponding evaluation board part number.

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

Si7005USB-DONGLE. EVALUATION DONGLE KIT FOR THE Si7005 TEMPERATURE AND HUMIDITY SENSOR. 1. Introduction. 2. Evaluation Kit Description

Figure 1. Traditional Biasing and Termination for LVPECL Output Buffers

AN1119: Using RAIL for Wireless M-Bus Applications with EFR32

Transcription:

QSG126: Bluetooth Developer Studio Quick-Start Guide Bluetooth Developer Studio (BTDS) is a graphical GATT-based development framework that facilitates building Bluetooth-enabled applications on EFR32 devices using the Silicon Labs Bluetooth stack. BTDS will auto-generate the skeleton project for any standard Bluetooth profile configuration, which can be integrated into Silicon Labs Software Development environment and tools. KEY FEATURES OR KEY POINTS Getting started with BTDS. Generating a project from BTDS. Generating a project from BTDS. For most of the profiles the generated code will be ready for compilation and flashing, although generally the code should be customized further to fit user requirements. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5

Introduction 1. Introduction The Bluetooth Developer Studio (BTDS) is a desktop development framework provided by the Bluetooth SIG. It facilitates 70% less development time by providing a library of all standard Bluetooth Profiles that can be quickly customized using a GUI (Graphical User Interface). This interactive development kit enables developers to learn Bluetooth development up to 50% faster by providing drag and drop functionality for a growing list of Bluetooth profiles. BTDS Code Plugin Framework allows code generation based on the GATT configuration that was created in the GUI. Silicon Labs provides three BTDS Plugins that auto-generate the skeleton project for various integration development environments for any standard Bluetooth GATT configuration. This Quick Start Guide describes how to generate a BTDS project based on the Silicon Labs Bluetooth stack and an EFR32 device. Prerequisites: You are familiar with most important terms of the Bluetooth protocol. Terms are described in 1.2 Definitions. You plan to develop Bluetooth code on the Silicon Labs EFR32 microcontroller using the Silicon Labs Bluetooth stack. You are using the IAR toolchain for development and have an IAR license, or you are developing in the BGScript programming language. You have downloaded and installed IAR Embedded Workbench or Simplicity Studio. You have installed the Silicon Labs Bluetooth SDK 2.0.x or 2.1.0 containing the BTDS Plugins. You have downloaded and installed BTDS from www.bluetooth.com. Because automatic part detection is not possible using BTDS, all generated project files assume the EFR32BG1B232F256GM48 part (for example, BGM111 Blue Gecko Module kit). If you are working with a different part, change the project settings after generation. An alternative tool to BTDS is Simplicity Studio's GATT Editor, which also enables graphical GATT table editing and basic code skeleton generation when you select an SOC-Empty project as a starting point. The project generated with that tool will support any Silicon Labs radio board and part. For more information please refer to QSG139: Bluetooth Development with Simplicity Studio. 1.1 Silicon Labs Plugins The following Plugins are currently available. C-Project generation: Simplicity Studio Project Generator: Auto-generates the skeleton for Simplicity Studio projects (IAR Toolchain). For more information about Simplicity Studio, see AN0822: Simplicity Studio User Guide. Simplicity Studio also contains a handful of more sophisticated kit- and part-aware example applications implementing the most popular Bluetooth Profiles. These can be taken as a reference without using Bluetooth Developer Studio. If you are starting development immediately from Simplicity Studio, see the following documents: QSG108: Getting Started with Silicon Labs Bluetooth Software UG136: Silicon Labs Bluetooth C Application Developer's Guide IAR Project Generator: Auto-generates the skeleton for IAR Embedded Workbench projects. BGScript Project generation: BGScript Project Generator: Auto-generates the skeleton for BGScript projects. These projects can be built and flashed using BGTool. For more information about BGScript, see UG173: Blue Gecko BGScript Developer's Guide. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 1

Introduction 1.2 Definitions In Bluetooth, the following terms are used: GATT: Generic Attribute Profile, High-level Stack layer in Bluetooth Architecture, which defines attributes as basic structures of transferrable data and organizes attributes into Profiles, Services, Characteristics, and Descriptors. Characteristic: A set of data including a value and properties such as declarations and descriptors. Service: A collection of characteristics and relationships to other services that encapsulate the behavior of a part of a device. Profile: A high-level definition that determines how services are used to enable an application or use case. Bluetooth profiles specify general behaviors that Bluetooth-enabled devices use to communicate with other Bluetooth devices. At a minimum, each Bluetooth profile contains information on the following topics: Dependencies on other profiles Suggested user interface formats Specific parts of the Bluetooth protocol stack used by the profile To perform its task, each profile uses particular options and parameters at each layer of the stack. Device: A combination of hardware and software that operates according to a Bluetooth profile. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 2

Generating a Project 2. Generating a Project 2.1 Import the Silicon Labs Plugins into BTDS If you have not yet done so, copy the Plugin folder from app\<bluetooth_x.y>\btds\plugins into the BTDS installation s Plugin folder (for example, c:\program Files (x86)\bluetooth SIG\Bluetooth Developer Studio\Plugins\). The Plugins are now ready to use from BTDS. Each Bluetooth SDK comes with its own Bluetooth Developer Studio plugins, as the plugins may need to be updated for each Bluetooth SDK. Make sure the Bluetooth developer Studio plugins you use correspond to your selected Bluetooth SDK. 2.2 Create a New Project 1. Open BTDS. The BTDS Dashboard should appear. If not, select File > New. 2. In the BTDS Dashboard, click [New]. Complete the form for a new project, and click [OK]. The Project View opens. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 3

Generating a Project 2.3 Create the GATT Database 1. In Project view, drag an element from one of the available Profiles/Services tabs on the left to the workspace on the right to create the visual representation of the GATT database. You can add arbitrary Characteristics to or remove them from these Services, and add arbitrary Descriptors to or remove them from these Characteristics. 2. The workspace populates with the profile and other information. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 4

Generating a Project 3. (optional) Click a characteristic name to open the Characteristic view. To remove an optional or unnecessary characteristic, click [Remove]. 4. (optional) Click [GAP] above the workspace to open GAP Settings dialog. Here you can set the Device name and Appearance value, which appears in the GATT xml file. If you don t modify the default Bluetooth_Device_Name Device name, it is shortened to BLE Device in the GATT XML database to fit on most smart phone screens when testing. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 5

Generating a Project 2.4 Generate Application Code Silicon Labs provides three Plugins to generate code from BTDS. Select the one that corresponds to the type of project you want to create: Simplicity Studio Project Generator IAR Project Generator BGScript Project Generator 1. In the Main Menu, select Tools > Generate Code. 2. In the Generate Code dialog window, choose the correct path for plugin output. Select the following path: app\<bluetooth_x.y>\examples_btds\<project_folder>\. This is important because the Bluetooth Stack s and tool s paths are generated relative to this root folder in the project files. Modify the Plugin generation folder, if necessary, and click [Generate]. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 6

Generating a Project 2.5 Customize Application Code After generation, Bluetooth Developer Studio plugins create projects that use the Silicon Labs Bluetooth stack to implement the designed GATT table. This can be tested with ios or Android applications right away for most of the profiles. Using standard Bluetooth Client smart phone apps, a connection can be made to the EFR Device, its attributes can be discovered, read, written, and so on (if characteristic properties allow for the specific operation). The generated project s source and XML files contain a small number of TODOs, which you should replace with your code to customize the project. Handling of notifications, indications, and user-specific read and write operations should be done in the <service>.c/<service>.bgs files. Note: The Bluetooth stack automatically handles characteristic Read and Write operations without special handling in the <service>.c file. To add a user-specific Read or Write action, the service must be looked up in the gatt.xml database and a type=user tag must be added to that service. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 7

Working with Generated Projects 3. Working with Generated Projects 3.1 Simplicity Studio Project Generator When you use the Simplicity Studio Project Generator Plugin to generate code, an.slsproj file is generated along with the source files. This allows easy integration of the project into Simplicity Studio. For more details about the Bluetooth C-SDK and Simplicity Studio, see QSG108: Getting Started with Silicon Labs' Bluetooth Software, QSG139: Bluetooth Development with Simplicity Studio, and UG136: Silicon Labs Bluetooth C Application Developer's Guide. Please be advised, that the generated project will support BGM111 only, and no Hardware Configurator will be available to support migration of project to a different board. If you want to take advantage of Simplicity Studio's hardware detection, Hardware Configurator, and Gatt Editor please refer to QSG139. Generation creates the following files in the specified Plugin output location: ble_device.slsproj Simplicity Studio project file. bledemo.icf IAR linker configuration file. BGBUILD/ bgbuild/gatt.bgproj bgbuild/gatt.xml gatt_db.c gatt_db.h Contains the GATT database. C code for the GATT database is created from this XML-based description before compilation as a prebuild step in gatt_db.c and gatt_db.h. This XML and.bgproj file are automatically populated by BTDS, but it is also possible to modify them manually according to the instructions in UG118: Blue Gecko Bluetooth Profile Toolkit Developer User's Guide, to add more services and characteristics. SRC/ main.c InitDevice.c InitDevice.h ble_att_handler.c ble_att_handler.h <service_name>.c <service_name>.h Main application file, which contains a bit switch-case structure handling all anticipated stack events. Device initialization file, which contains initialization code for all peripherals. Header file for InitDevice.c. Handles long characteristic reads and writes. Header file for ble_att_handler.c. Implementation of a standard GATT service. Header file for <service_name>.c silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 8

Working with Generated Projects 1. Open Simplicity Studio. If you are using a Silicon Labs Kit, connect it to your PC by an USB cable and wait until Simplicity Studio detects it. If this is a new installation, follow the instructions in QSG108: Getting Started with Silicon Labs Bluetooth Software until the Launcher is displayed. 2. Open the Simplicity IDE. If the control is not displayed in the upper right, select it from the Tools menu. 3. Select File > Import. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 9

Working with Generated Projects 4. Select Simplicity Studio > MCU Project. 5. Navigate to the generated.slsproj file (ignore the warning about editing files in the SDK). silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 10

Working with Generated Projects 6. Select the correct Kit, Part, and SDK. Click [Next >] and then [Finish]. The project is now imported into Simplicity Studio. You can now modify, build, and debug the project from Simplicity Studio. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 11

Working with Generated Projects 3.2 IAR Project Generator This Plugin generates an IAR Embedded Workbench project using the Silicon Labs Bluetooth SDK. The project links the stack as IAR precompiled libraries to the application code, which can be customized, debugged, and flashed on the EFR32 device right away for most profiles. The.eww workspace file is located in <project_name>/iar/ble_workspace.eww. Generation creates the following files in the specified Plugin output location: BGBUILD: bgbuild/gatt.bgproj bgbuild/gatt.xml Contains the GATT database. C code for the GATT database is created from this XML-based description before compilation as a prebuild step in gatt_db.c and gatt_db.h. This XML and.bgproj file are automatically populated by BTDS, but it is also possible to modify them manually according to the instructions in UG118: Blue Gecko Bluetooth Profile Toolkit Developer User's Guide, to add more services and characteristics. IAR/ ble_device.ewd ble_device.ewp ble_device.eww bledemo.icf IAREW Debugger settings file. IAREW Project file. IAREW Workspace file. IAREW linker configuration file. SRC/ main.c InitDevice.c InitDevice.h ble_att_handler.c ble_att_handler.h <service_name>.c <service_name>.h Main application file, which contains a bit switch-case structure handling all anticipated stack events. Device initialization file, which contains initialization code for all peripherals. Header file for InitDevice.c. Handles long characteristic reads and writes. Header file for ble_att_handler.c. A skeleton file is created for each service where a custom Property GENERATECODE was added with a value of 1. Header file for <service_name>.c. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 12

Working with Generated Projects 3.3 BGScript Project Generator This Plugin generates a skeleton project in BGScript programming language. BGScript projects can be built and flashed using the BGTool, which can be found in the Simplicity Studio Tools menu. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 13

Working with Generated Projects Generation creates the following files in the specified Plugin output location: main.bgs Main application file, which contains the event handler for all anticipated stack events. hardwre.xml gatt.xml ble_device.bgproj ble_att_handler.bgs <service_name>.bgs Hardware configuration XML file. GATT configuration XML file. BGScript Project file. BGScript file handling long characteristic reads and writes. BGScript file handling service-related callbacks. After generation, use BGTool to navigate to the BGTool file, build the project, and upload it to your device. For information about the BGScript programming language, see UG173: Blue Gecko BGScript Developer s Guide. silabs.com Smart. Connected. Energy-friendly. Rev. 0.5 14

Simplicity Studio One-click access to MCU and wireless tools, documentation, software, source code libraries & more. Available for Windows, Mac and Linux! IoT Portfolio www.silabs.com/iot SW/HW www.silabs.com/simplicity Quality www.silabs.com/quality Support and Community community.silabs.com Disclaimer Silicon Labs intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Labs products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Labs reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Labs shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products are not designed or authorized to be used within any Life Support System without the specific written consent of Silicon Labs. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Labs products are not designed or authorized for military applications. Silicon Labs products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons. Trademark Information Silicon Laboratories Inc., Silicon Laboratories, Silicon Labs, SiLabs and the Silicon Labs logo, Bluegiga, Bluegiga Logo, Clockbuilder, CMEMS, DSPLL, EFM, EFM32, EFR, Ember, Energy Micro, Energy Micro logo and combinations thereof, "the world s most energy friendly microcontrollers", Ember, EZLink, EZRadio, EZRadioPRO, Gecko, ISOmodem, Precision32, ProSLIC, Simplicity Studio, SiPHY, Telegesis, the Telegesis Logo, USBXpress and others are trademarks or registered trademarks of Silicon Labs. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders. Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 USA http://www.silabs.com