Skip to content
Permalink
c930e72473
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

CYW208xx Low Power

This example demonstrates low power modes on CYW20819 and CYW20820 using ModusToolbox™.

Requirements

ModusToolbox™

Programming Language: C

Associated Parts: CYW20819, CYW20820

Supported Kits & Documentation

Simply pick the supported kit in the IDE's New Application wizard. When you select a supported kit in the new application wizard the example is reconfigured automatically to work with the kit.

To work with a different supported kit, use the middleware selector to choose the BSP for the supported kit. You can also just start the process again and select a different kit.

If you want to use the application for a kit not listed here, you may need to update source files. If the kit does not have the required resources, the application may not work.

Hardware Setup

This example uses the kit's default configuration. Refer to the kit guide to ensure the kit is configured correctly.

Software Setup

This code example consists of two parts: a client and a server. For the client, download and install the LightBlue App for iOS or Android.

Scan the following QR codes from your mobile phone to download the LightBlue App.

AppQR

This example uses a terminal emulator. Install one if you don't have one. The instructions use Tera Term.

This example requires no additional software or tools.

Using the Code Example

In the ModusToolbox™ IDE

  1. Click the New Application link in the Quick Panel (or, use File > New > ModusToolbox™ Application).
  2. Pick your kit. You must use a kit or device supported by the code example. Some application settings (e.g. which pin controls an LED) may be adjusted automatically based on the kit you select.
  3. In the Starter Application window, choose the example.
  4. Click Next and complete the application creation process.

If you are unfamiliar with this process, see ModusToolbox™ Quick Start Guide for all the details.

In Command Line Tools

Ensure that the development environment is set up correctly.

  1. Download and unzip this repository onto your local machine, or clone the repository.
  2. Open the Cygwin terminal and navigate to the application folder.
  3. Import required libraries by executing the command make getlibs.

Operation

  1. Connect the kit to your PC using the provided USB cable through the USB connector.

  2. If you want to measure power consumption, connect an ammeter across J15.1 and J15.2, and a second ammeter across J8.2 and J8.4 to measure current in VDDIO and VBAT domains respectively as shown in Figure 1. If you don't have 2 ammeters, then measure current on one domain at a time. Note that the VPA_BT power domain is not used on this kit and hence there is no need to measure current on this domain.

Figure 1. CYW920819EVB-02 Jumpers to measure Current

MeasureCurrent

  1. Remove jumpers J14 and J18 to disable unused peripherals on the evaluation kit.

  2. The USB Serial interface on the kit provides access to the two UART interfaces of the device - "WICED HCI UART", and "WICED Peripheral UART" (PUART). The HCI UART is used only for downloading the application code in this code example and the PUART is used for printing the Bluetooth® stack and application trace messages. Open your terminal software and select the PUART COM port, with a baud rate setting of 115200 bps. If you want to disable the trace messages, then comment out the following line in low_power_208xx.c: wiced_set_debug_uart( WICED_ROUTE_DEBUG_TO_PUART );

  3. Program the board.

    Using the ModusToolbox™ IDE
    1. Select the application project in the Project Exporer
    2. In the Quick Panel, scroll down, and click <App Name> Program.
    Using CLI
    1. From the Cygwin terminal, execute the command make build to build the program for the default target. You can specify a tool chain as well (e.g. make TOOLCHAIN=GCC_ARM .)
    2. Execute command make qprogram to program the built application to the board.

Note: If the download fails, it is possible that a previously loaded application is preventing programming. For example, the application may use a custom baud rate that the download process does not detect or the device may be in low-power mode. In that case, it may be necessary to put the board in recovery mode, and then try the programming operation again from the IDE. To enter recovery mode, first, press and hold the Recover button (SW1), press and release the Reset button (SW2), and then release the Recover button (SW1).

  1. After the programming is complete, the device will boot up and enter ePDS mode. Give the device a few seconds (~5) to enter ePDS mode. Note the current readings from ammeters. These are the current consumed in ePDS mode with no Bluetooth® activity.

Figure 2. Bootup Log

BootUp

  1. Press switch SW3 on the evaluation kit. The application will get a button callback and it will start advertising. Note the current readings on the ammeters. This is the average current in ePDS mode with advertisement.

Figure 3. Start Advertisement Log

ADV

Test the connection using the LightBlue mobile app

  1. Turn ON Bluetooth® on your Android or iOS device.

  2. Launch the LightBlue app.

  3. Do the following on the LightBlue app:

    1. Swipe down on the LightBlue app home screen to start scanning for low Power. Your device appears in the LightBlue app home screen.

    2. Select your device to establish a Bluetooth® LE connection.

    3. Once the device is connected, read the current numbers from the ammeters. These are the currents in ePDS mode with a connection at a connection interval of 100 ms.

    4. Select the Battery level characteristic under the Battery service.

    5. Select select Subscribe (for Android) / select Listen for notifications (for iOS). The device will start sending GATT notifications to the LightBlue app.

    6. Note the current readings on the ammeters. These are the current in ePDS mode with a connection at a connection interval of 100 ms and notifications being sent every 5 seconds.

    7. Disconnect the Bluetooth® connection by pressing SW3 on the kit or by backing out from the mobile app. The device will enter HID-Off mode.

Figure 4. Connection, Pairing, and Connection Parameters Update Messages

Connection

Figure 5. Disconnection, HID-Off, and Restart Trace Messages

Disconnection

Design and Implementation

This code example implements a GATT Server and GAP Peripheral role on CYW920819EVB-02/CYW920820EVB-02. Once the device is powered on, it boots up, configures sleep, initializes the Bluetooth® stack, registers a button interrupt and GATT database, and then enters ePDS mode. You need to press switch SW3 on the kit to start low-duty advertisement. The device is still in ePDS mode. You can now connect to the device using a GAP Central device. Upon connection, the device will request connection parameters to be updated (specifically, the connection interval to 100 ms). If the request is accepted, the connection interval changes to 100 ms. The device remains in ePDS mode and maintains the connection by sending empty packets. The GAP Central device can now discover all attributes and enable GATT notifications. The peripheral will start sending a dummy battery level value every 5 seconds. The GATT Server implements a Battery Service with a Battery Level characteristic. This characteristic is readable and notifiable. The application code and the Bluetooth® stack runs on the Arm® Cortex®-M4 core of the SoC. The application-level source files for this code example are listed in Table 1.

Table 1. Code Example File Structure

File Name Comments
low_power_208xx.c Contains the application_start() function, which is the entry point for execution of the user application code after device startup. It also has the sleep callback function used by the PMU. The contents in this file can be referenced to implement low-power modes in other applications.
app_bt_cfg.c, app_bt_cfg.h These files contain the runtime Bluetooth® stack configuration parameters such as device name and advertisement/connection settings.
cycfg_bt.h, cycfg_gatt_db.c, cycfg_gatt_db.h These files reside in the GeneratedSource folder under the application folder. They contain the GATT database information generated using the Bluetooth® Configurator tool.
low_power_208xx_ble.c This file contains the Bluetooth® events callback function along with other functions to service Bluetooth® events. It also contains the button callback function.

Application Flow

The following diagrams show the flow of the application code.

  • Figure 6 shows the flow of the application when it boots up.
  • Figure 7 shows the flow of the button callback.
  • Figure 8 shows the flow of Bluetooth® stack management event callbacks.

Figure 6. Application Flow After Bootup

AppFlow

Figure 7. Button Callback Flow

ButCB

Figure 8. Bluetooth® Stack Management Callback Flow

BTStack

Current Measurements

The instantaneous current consumed by the device is not a steady-state value, but varies depending on the state of the chip that dynamically changes with power mode transitions, making it practically impossible to measure each individual instantaneous current with a handheld multimeter because the duration of these current bursts is very small. Therefore, you should use a multimeter that provides the option to set the "aperture" of the measurement. The aperture is the period "T" during which the multimeter measures the instantaneous currents, integrates them, and then displays the average current for the period "T". For accurate measurements, the aperture of the multimeter should be set to be the same as the advertising or the connection interval. The following tables gives the current values for VBAT and VDDIO in various scenarios. Note that the current is averaged over 10 second intervals.

Table 2. CYW20819 Current in Different Modes

State ePDS Enabled VDDIO ePDS Enabled VBAT ePDS Disabled VDDIO ePDS Disabled VBAT
No Bluetooth® activity 2.1 uA 7.7 uA 47.9 uA 0.97 mA
ADV (2.56 seconds interval) 2.3 uA 26.1 uA 47.9 uA 0.98 uA
Connection (100 ms connection interval) 3.2 uA 147.2 uA 47.9 uA 1.02 mA
Notifications (5 s interval) 3.3 uA 148.3 uA 47.9 uA 1.02 mA

Table 3. CYW20819 Current in HID-Off Mode

State VDDIO VBAT
HID-Off 2.2 uA 0.7 uA

Table 4. CYW20819 Current in Different Connection Intervals

Connection Interval ePDS Enabled VDDIO ePDS Enabled VBAT ePDS Disabled VDDIO ePDS Disabled VBAT
7.5 ms 14.5 uA 1.49 mA 47.9 uA 1.58 mA
10 ms 11.3 uA 1.16 mA 47.9 uA 1.43 mA
11.25 ms 10.2 uA 1.03 mA 47.9 uA 1.38 mA
12.5 ms 9.4 uA 0.89 mA 47.9 uA 1.34 mA
13.75 ms 9.9 uA 0.96 mA 47.9 uA 1.31 mA
15 ms 9.4 uA 0.89 mA 47.9 uA 1.28 mA
25 ms 6.6 uA 0.54 mA 47.9 uA 1.17 mA
50 4.4 uA 0.27 mA 47.9 uA 1.08 mA
100 3.2 uA 0.14 mA 47.9 uA 1.03 mA
500 2.31 uA 0.04 mA 47.9 uA 0.98 mA
1000 ms 2.2 uA 0.02 mA 47.9 uA 0.98
2000 ms 2.2 uA 0.02 mA 47.9 uA 0.98 mA
4000 ms 2.1 uA 0.02 mA 47.9 uA 0.97 mA

Table 5. CYW20820 Current in Different Modes

State ePDS Enabled VDDIO ePDS Enabled VBAT ePDS Disabled VDDIO ePDS Disabled VBAT
No Bluetooth® activity 2.45 uA 6.21 uA 48.62 uA 0.98 mA
ADV (2.56 seconds interval) 2.65 uA 20.65 uA 45.08 uA 0.99 uA
Connection (100 ms connection interval) 3.89 uA 137.8 uA 45.11 uA 1.02 mA
Notifications (5 s interval) 4.15 uA 142.54 uA 45.23 uA 1.02 mA

Table 6. CYW20819 Current in HID-Off Mode

State VDDIO VBAT
HID-Off 2.2 uA 0.7 uA

Table 7. CYW20820 Current in Different Connection Intervals

Connection Interval ePDS Enabled VDDIO ePDS Enabled VBAT ePDS Disabled VDDIO ePDS Disabled VBAT
7.5 ms 21.31 uA 1.71 mA 45.22 uA 1.56 mA
10 ms 16.5 uA 1.3 mA 45.23 uA 1.42 mA
11.25 ms 14.95 uA 1.16 mA 45.23 uA 1.37 mA
12.5 ms 13.69 uA 1.05 mA 45.2 uA 1.37 mA
13.75 ms 11.88 uA 0.92 mA 45.19 uA 1.29 mA
15 ms 11.23 uA 0.85 mA 45.19 uA 1.27 mA
25 ms 7.89 uA 0.51 mA 445.2 uA 1.15 mA
50 5.28 uA 0.26 mA 45.19 uA 1.07 mA
100 3.93 uA 0.13 mA 45.14 uA 1.02 mA
500 2.8 uA 0.035 mA 45.21 uA 0.99 mA
1000 ms 2.63 uA 0.021 mA 45.18 uA 0.98
2000 ms 2.61 uA 0.017 mA 45.16 uA 0.98 mA
4000 ms 2.56 uA 0.011 mA 45.07 uA 0.98 mA

Note that these current values also include some leakage current on the board because some GPIOs connected to the on-board components draw current. For accurate current numbers, see the device datasheet.

Resources and Settings

This example uses the default device configurator settings i.e., when this example is imported to ModusToolbox™, the IDE creates the file design.modus file that is used for design configuration with default settings for the kit. Note that in the design.modus file, the SPI and I2C modules are enabled, but because these are not used in the application, they will not cause any current leakage. It also provides the GATT database files so you don't have to generate the files.

Reusing This Example

This example is designed in a way so that you can use the low-power functions from this example in your own example with minimal changes.

Related Resources

Application Notes
AN225684 - Getting started with AIROC™ CYW20819/20/35 Bluetooth® & Bluetooth® LE Describes the CYW20819/CYW20820 devices and demonstrates how to build your first ModusToolbox™ project
Code Examples
Visit the Infineon GitHub repo for a comprehensive collection of code examples using ModusToolbox™
Tools Documentation
ModusToolbox™ The ModusToolbox™ cross-platform IDE simplifies development for IoT designers. Look in /docs.

Other Resources

Infineon provides a wealth of data at www.infineon.com to help you to select the right device, and quickly and effectively integrate the device into your design.

BTSTACK version

BTSDK AIROC™ chips contain the embedded AIROC™ Bluetooth® stack, BTSTACK. Different chips use different versions of BTSTACK, so some assets may contain variant sets of files targeting the different versions in COMPONENT_btstack_vX (where X is the stack version). Applications automatically include the appropriate folder using the COMPONENTS make variable mechanism, and all BSPs declare which stack version should be used in the BSP .mk file, with a declaration such as:

COMPONENTS+=btstack_v1
or:
COMPONENTS+=btstack_v3

Common application settings

Application settings below are common for all BTSDK applications and can be configured via the makefile of the application or passed in via the command line.

BT_DEVICE_ADDRESS

Set the BDA (Bluetooth® Device Address) for your device. The address is 6 bytes, for example, 20819A10FFEE. By default, the SDK will set a BDA for your device by combining the 7 hex digit device ID with the last 5 hex digits of the host PC MAC address.

UART

Set to the UART port you want to use to download the application. For example 'COM6' on Windows or '/dev/ttyWICED_HCI_UART0' on Linux or '/dev/tty.usbserial-000154' on macOS. By default, the SDK will auto-detect the port.

ENABLE_DEBUG

For HW debugging, configure ENABLE_DEBUG=1. See the document AIROC™-Hardware-Debugging for more information. This setting configures GPIO for SWD.

  • CYW920819EVB-02/CYW920820EVB-02: SWD signals are shared with D4 and D5, see SW9 in schematics.

  • CYBT-213043-MESH/CYBT-213043-EVAL/CYBT-253059-EVAL: SWD signals are routed to P12=SWDCK and P13=SWDIO. Use expansion connectors to connect VDD, GND, SWDCK, and SWDIO to your SWD Debugger probe.

  • CYBT-223058-EVAL/CYW920835M2EVB-01/CYBT-243053-EVAL/CYBLE-343072-EVAL-M2B/CYBLE-333074-EVAL-M2B/CYBLE-343072-MESH/Vela-IF820-INT-ANT-DVK/Vela-IF820-EXT-ANT-DVK: SWD signals are routed to P02=SWDCK and P03=SWDIO. Use expansion connectors to connect VDD, GND, SWDCK, and SWDIO to your SWD Debugger probe.

  • CYBT-263065-EVAL/CYBT-273063-EVAL: SWD signals are routed to P02=SWDCK and P04=SWDIO. Use expansion connectors to connect VDD, GND, SWDCK, and SWDIO to your SWD Debugger probe.

  • CYBT-343026-EVAL/CYBT-353027-EVAL/CYBT-333047-EVAL: SWD signals are routed to P11=SWDCK and P15=SWDIO. Use expansion connectors to connect VDD, GND, SWDCK, and SWDIO to your SWD Debugger probe.

  • CYBT-413055-EVAL/CYBT-413061-EVAL: SWD signals are routed to P16=SWDCK and P17=SWDIO. Use expansion connectors to connect VDD, GND, SWDCK, and SWDIO to your SWD Debugger probe.

  • CYW989820EVB-01: SWDCK (P02) is routed to the J13 DEBUG connector, but not SWDIO. Add a wire from J10 pin 3 (PUART CTS) to J13 pin 2 to connect GPIO P10 to SWDIO.

  • CYW920719B2Q40EVB-01: PUART RX/TX signals are shared with SWDCK and SWDIO. Remove RX and TX jumpers on J10 when using SWD. PUART and SWD cannot be used simultaneously on this board unless these pins are changed from the default configuration.

  • CYW920721M2EVK-02/CYW920721M2EVB-03: The default setup uses P03 for SWDIO and P05 for SWDCK. Check the position of SW15 if using JLink with the DEBUG connector.

  • CYW920706WCDEVAL: SWD debugging requires fly-wire connections. The default setup P15 (J22 pin 3 or J24 pin 1) for SWDIO and P11 (J23 pin 5 or J22 pin 4) for SWDCK.

  • CYW920736M2EVB-01: SWD hardware debugging requires fly-wire connections. The only option is using P14 for SWDCK and P15 for SWDIO. These route to Arduino header J2, A1 and A0. These can be fly-wired to Arduino header J4, D4 and D5. From there the signals connect to the KitProg3 SWD bridge. In addition, the debug macros (SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED and BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED) are placed in sparinit.c in code common to all applications for this device. Most applications for this device call bleprofile_GPIOInit() in subsequent code, overwriting the SWD pin configuration. To use hardware debugging after the call to bleprofile_GPIOInit(), place the debug macros in code after that call.

  • CYW943012B2EVK-01: SWD signals are shared with D4 and D5.

  • CYW920820M2EVB-01 & CYW920819M2EVB-01: The default setup uses P03 for SWDIO and P02 for SWDCK. Check the position of SW15 if using JLink with the DEBUG connector.

  • CYW989820M2EVB-01: SWD hardware debugging requires a fly-wire connection to use P14 for SWDIO. P2 is connected directly to SWDCK / ARD_D4. Fly-wire P14 / ARD_D8 on J3.10 to J4.3 / ARD_D5 to connect SWDIO.

  • SWD hardware debugging is not supported on the following:

    • CYW920721M2EVK-01
    • CYW920835REF-RCU-01
    • CYW9M2BASE-43012BT
    • CYBT-423054-EVAL
    • CYBT-423060-EVAL
    • CYBT-483056-EVAL
    • CYBT-483062-EVAL
    • CYW955572BTEVK-01
    • CYW943022BTEVK-01
DIRECT_LOAD

BTSDK chips support downloading applications either to FLASH storage or to RAM storage. Some chips support only one or the other, and some chips support both.

If a chip only supports one or the other, this variable is not applicable, applications will be downloaded to the appropriate storage supported by the device.

If a chip supports both FLASH and RAM downloads, the default is to download to FLASH, and the DIRECT_LOAD make variable may be set to 1 in the application makefile (or in the command line make command) to override the default and download to RAM.

Currently, the following chips support both FLASH and RAM download and can set DIRECT_LOAD=1 if desired:

  • CYW20835
  • CYW20706

Building and downloading code examples

Using the ModusToolbox™ Eclipse IDE

  1. Install ModusToolbox™ 2.4.1 (or higher).
  2. In the ModusToolbox™ Eclipse IDE, click the New Application link in the Quick Panel (or, use File > New > ModusToolbox IDE Application).
  3. Pick your board for BTSDK under AIROC™ Bluetooth® BSPs.
  4. Select the application in the IDE.
  5. In the Quick Panel, select Build to build the application.
  6. To program the board (download the application), select Program in the Launches section of the Quick Panel.

Using command line

  1. Install ModusToolbox™ 2.4.1 (or higher).
  2. On Windows, use Cygwin from \ModusToolbox\tools_2.x\modus-shell\Cygwin.bat to build apps.
  3. Use the tool 'project-creator-cli' under \ModusToolbox\tools_2.x\project-creator\ to create your application.

    project-creator-cli --board-id (BSP) --app-id (appid) -d (dir)
    See 'project-creator-cli --help' for useful options to list all available BSPs, and all available apps per BSP.
    For example:
    project-creator-cli --app-id mtb-example-btsdk-empty --board-id CYW920706WCDEVAL -d .

  4. To build the app call make build. For example:

    cd mtb-examples-btsdk-empty
    make build

  5. To program (download to) the board, call:

    make qprogram

  6. To build and program (download to) the board, call:

    make program

    Note: make program = make build + make qprogram

If you have issues downloading to the board, follow the steps below:

  • Press and hold the 'Recover' button on the board.
  • Press and hold the 'Reset' button on the board.
  • Release the 'Reset' button.
  • After one second, release the 'Recover' button.

Note: this is only applicable to boards that download application images to FLASH storage. Boards that only support RAM download (DIRECT_LOAD) such as CYW9M2BASE-43012BT or CYW943022BTEVK-01 can be power cycled to boot from ROM.

Over The Air (OTA) Firmware Upgrade

Applications that support OTA upgrade can be updated via the peer OTA app in:

<Workspace Dir>\mtb_shared\wiced_btsdk\tools\btsdk-peer-apps-ota

See the readme.txt file located in the above folder for instructions.
To generate the OTA image for the app, configure OTA_FW_UPGRADE=1 in the app makefile, or append OTA_FW_UPGRADE=1 to a build command line, for example:

make PLATFORM=CYW920706WCDEVAL OTA_FW_UPGRADE=1 build

This will the generate <app>.bin file in the 'build' folder.

SDK software features

  • Dual-mode Bluetooth® stack included in the ROM (BR/EDR and LE)
  • Bluetooth® stack and profile level APIs for embedded Bluetooth® application development
  • AIROC™ HCI protocol to simplify host/MCU application development
  • APIs and drivers to access on-board peripherals
  • Bluetooth® protocols include GAP, GATT, SMP, RFCOMM, SDP, AVDT/AVCT, LE Mesh
  • LE and BR/EDR profile APIs, libraries, and sample apps
  • Support for Over-The-Air (OTA) upgrade
  • Device Configurator for creating custom pin mapping
  • Bluetooth® Configurator for creating LE GATT Database
  • Peer apps based on Android, iOS, Windows, etc. for testing and reference
  • Utilities for protocol tracing, manufacturing testing, etc.
  • Documentation for APIs, datasheets, profiles, and features
  • BR/EDR profiles: A2DP, AVRCP, HFP, HSP, HID, SPP, MAP, PBAP, OPP
  • LE profiles: Mesh profiles, HOGP, ANP, BAP, HRP, FMP, IAS, ESP, LE COC
  • Apple support: Apple Media Service (AMS), Apple Notification Center Service (ANCS), iBeacon, Homekit, iAP2
  • Google support: Google Fast Pair Service (GFPS), Eddystone
  • Amazon support: Alexa Mobile Accessories (AMA)

Note: this is a list of all features and profiles supported in BTSDK, but some AIROC™ devices may only support a subset of this list.

List of boards available for use with BTSDK

Folder structure

All BTSDK code examples need the 'mtb_shared\wiced_btsdk' folder to build and test the apps. 'wiced_btsdk' includes the 'dev-kit' and 'tools' folders. The contents of the 'wiced_btsdk' folder will be automatically populated incrementally as needed by the application being used.

dev-kit

This folder contains the files that are needed to build the embedded Bluetooth® apps.

  • baselib: Files for chips supported by BTSDK. For example CYW20819, CYW20719, CYW20706, etc.

  • bsp: Files for BSPs (platforms) supported by BTSDK. For example CYW920819EVB-02, CYW920706WCDEVAL etc.

  • btsdk-include: Common header files needed by all apps and libraries.

  • btsdk-tools: Build tools needed by BTSDK.

  • libraries: Profile libraries used by BTSDK apps such as audio, LE, HID, etc.

tools

This folder contains tools and utilities need to test the embedded Bluetooth® apps.

  • btsdk-host-apps-bt-ble: Host apps (Client Control) for LE and BR/EDR embedded apps, demonstrates the use of AIROC™ HCI protocol to control embedded apps.

  • btsdk-host-peer-apps-mesh: Host apps (Client Control) and Peer apps for embedded Mesh apps, demonstrates the use of AIROC™ HCI protocol to control embedded apps, and configuration and provisioning from peer devices.

  • btsdk-peer-apps-ble: Peer apps for embedded LE apps.

  • btsdk-peer-apps-ota: Peer apps for embedded apps that support Over The Air Firmware Upgrade.

  • btsdk-utils: Utilities used in BTSDK such as BTSpy, wmbt, and ecdsa256.

See README.md in the sub-folders for more information.

Software Tools

The following tool applications are installed on your computer either with ModusToolbox™, or by creating an application in the workspace that can use the tool.

BTSpy:

BTSpy is a trace viewer utility that can be used with AIROC™ Bluetooth® platforms to view protocol and application trace messages from the embedded device. The utility is located in the folder below. For more information, see readme.txt in the same folder.
This utility can be run directly from the filesystem, or it can be run from the Tools section of the ModusToolbox™ QuickPanel, or by right-clicking a project in the Project Explorer pane and selecting the ModusToolbox™ context menu.
It is supported on Windows, Linux and macOS.
Location: <Workspace Dir>\wiced_btsdk\tools\btsdk-utils\BTSpy

Bluetooth® Classic and LE Profile Client Control:

This application emulates host MCU applications for LE and BR/EDR profiles. It demonstrates AIROC™ Bluetooth® APIs. The application communicates with embedded apps over the "WICED HCI UART" interface. The application is located in the folder below. For more information, see readme.txt in the same folder.
This utility can be run directly from the filesystem, or it can be run from the Tools section of the ModusToolbox™ QuickPanel, or by right-clicking a project in the Project Explorer pane and selecting the ModusToolbox™ context menu.
It is supported on Windows, Linux, and macOS.
Location: <Workspace Dir>\wiced_btsdk\tools\btsdk-host-apps-bt-ble\client_control

LE Mesh Client Control:

Similar to the above app, this application emulates host MCU applications for LE Mesh models. It can configure and provision mesh devices and create mesh networks. The application is located in the folder below. For more information, see readme.txt in the same folder.
This utility can be run directly from the filesystem, or it can be run from the Tools section of the ModusToolbox™ QuickPanel (if a mesh-capable project is selected in the Project Explorer pane), or by right-clicking a mesh-capable project in the Project Explorer pane and selecting the ModusToolbox™ context menu.
The full version is provided for Windows (VS_ClientControl) supporting all Mesh models.
A limited version supporting only the Lighting model (QT_ClientControl) is provided for Windows, Linux, and macOS.
Location: <Workspace Dir>\wiced_btsdk\tools\btsdk-host-peer-apps-mesh\host

Peer apps:

Applications that run on Windows, iOS or Android and act as peer Bluetooth® apps to demonstrate specific profiles or features, communicating with embedded apps over the air.
LE apps location: <Workspace Dir>\wiced_btsdk\tools\btsdk-peer-apps-ble
LE Mesh apps location: <Workspace Dir>\wiced_btsdk\tools\btsdk-host-peer-apps-mesh\peer
OTA apps location: <Workspace Dir>\wiced_btsdk\tools\btsdk-peer-apps-ota

Device Configurator:

Use this GUI tool to create source code for a custom pin mapping for your device. Run this tool from the Tools section of the ModusToolbox™ QuickPanel, or by right-clicking a project in the Project Explorer pane and selecting the ModusToolbox™ context menu.
It is supported on Windows, Linux and macOS.
Note: The pin mapping is based on wiced_platform.h for your board.
Location: <Install Dir>\tools_2.x\device-configurator

Note: Not all BTSDK chips support Device Configurator. BSPs using the following devices do not currently support Device Configurator: CYW20706, CYW20736

Bluetooth® Configurator:

Use this GUI tool to create and configure the LE GATT Database and the BR/EDR SDP Database, generated as source code for your application.
Run this tool from the Tools section of the ModusToolbox™ QuickPanel, or by right-clicking a project in the Project Explorer pane and selecting the ModusToolbox™ context menu.
It is supported on Windows, Linux and macOS.
Location: <Install Dir>\tools_2.x\bt-configurator

Tracing

To view application traces, there are 2 methods available. Note that the application needs to configure the tracing options.

  1. "WICED Peripheral UART" - Open this port on your computer using a serial port utility such as TeraTerm or PuTTY (usually using 115200 baud rate for non-Mesh apps, and 921600 for Mesh apps).
  2. "WICED HCI UART" - Open this port on your computer using the Client Control application mentioned above (usually using 3M baud rate). Then run the BTSpy utility mentioned above.

Using BSPs (platforms)

BTSDK BSPs are located in the \mtb_shared\wiced_btsdk\dev-kit\bsp\ folder by default.

a. Selecting an alternative BSP

The application makefile has a default BSP. See "TARGET". The makefile also has a list of other BSPs supported by the application. See "SUPPORTED_TARGETS". To select an alternative BSP, use Library Manager from the Quick Panel to deselect the current BSP and select an alternate BSP. Then right-click the newly selected BSP and choose 'Set Active'. This will automatically update TARGET in the application makefile.

b. Custom BSP

To create a custom BSP from a BSP template for BTSDK devices, see the following KBA article: KBA238530

Using libraries

The libraries needed by the app can be found in in the mtb_shared\wiced_btsdk\dev-kit\libraries folder. To add an additional library to your application, launch the Library Manager from the Quick Panel to add a library. Then update the makefile variable "COMPONENTS" of your application to include the library. For example:
COMPONENTS += fw_upgrade_lib

Documentation

BTSDK API documentation is available online

Note: For offline viewing, git clone the documentation repo

BTSDK Technical Brief and Release Notes are available online


The Bluetooth® word mark and logos are registered trademarks owned by Bluetooth SIG, Inc., and any use of such marks by Infineon is under license.