BT Powersave#

1. Purpose / Scope#

This application demonstrates the process of configuring the device in power save in BT connected mode in bt_power_save example.

2. Prerequisites / Setup Requirements#

Before running the application, the user will need the following things to setup.

2.1 Hardware Requirements#

Setup Diagram for BT PowerSave ExampleSetup Diagram for BT PowerSave Example

2.2 Software Requirements#

  • WiSeConnect SDK

  • Embedded Development Environment

  • Download and install the Silicon Labs Bluetooth SPP manager in the android smart phones for testing BT applications. Users can also use their choice of BT apps available in Android/iOS smart phones.

3. Application Build Environment#

3.1 Platform#

The Application can be built and executed on below Host platforms

3.2 Host Interface#

  • By default, the application is configured to use the SPI bus for interfacing between Host platforms(STM32F411 Nucleo / EFR32MG21) and the RS9116W EVK.

  • This application is also configured to use the SDIO bus for interfacing between Host platforms(EFM32GG11) and the RS9116W EVK.

3.3 Project Configuration#

The Application is provided with the project folder containing Keil and Simplicity Studio project files.

  • Keil Project

    • The Keil project is used to evaluate the application on STM32.

    • Project path: <SDK>/examples/snippets/bt/bt_power_save/projects/bt_power_save-nucleo-f411re.uvprojx

  • Simplicity Studio

    • The Simplicity Studio project is used to evaluate the application on EFR32MG21.

    • Project path:

      • If the Radio Board is BRD4180A or BRD4181A, then access the path <SDK>/examples/snippets/bt/bt_power_save/projects/bt_power_save-brd4180a-mg21.slsproj

      • If the Radio Board is BRD4180B or BRD4181B, then access the path <SDK>/examples/snippets/bt/bt_power_save/projects/bt_power_save-brd4180b-mg21.slsproj

        • User can find the Radio Board version as given below

EFR Radio BoardsEFR Radio Boards

  • EFM32GG11 platform

    • The Simplicity Studio project is used to evaluate the application on EFM32GG11.

      • Project path:<SDK>/examples/snippets/bt/bt_power_save/projects/bt_power_save-brd2204a-gg11.slsproj

3.4 Bare Metal/RTOS Support#

This application supports bare metal and RTOS environment. By default, the application project files (Keil and Simplicity Studio) are provided with bare metal configuration.

4. Application Configuration Parameters#

The application can be configured to suit your requirements and development environment. Read through the following sections and make any changes needed.

4.1 rsi_bt_power_save_profile.c file and update/modify following macros.

  1. RSI_BT_LOCAL_NAME - Name of the Wyzbee (Master) device

  2. PIN_CODE - Four-byte string required for pairing process.

  3. PSP_TYPE – Power save profile type.

Note: 1. PSP_TYPE is only valid RSI_SLEEP_MODE_2. 2. RSI_MAXRSI_MAX_PSP is only valid in case of BT._PSP is only valid in case of BT.

  1. SNIFF_MAX_INTERVAL - Sniff Maximum interval value

  2. SNIFF_MIN_INTERVAL – Sniff Minimum interval value

  3. SNIFF_ATTEMPT - Sniff Attempt Value

  4. SNIFF_TIME_OUT – Sniff Timeout Value

  5. To Enable Power Save

PSP_MODE refers power save profile mode. The WiSeConnect device supports following power modes in BT

RSI_ACTIVE (0): In this mode, the module is active and power save is disabled.

RSI_SLEEP_MODE_2 (1): This mode is applicable when the module is connected state. In this sleep mode, SoC will go to sleep based on GPIO handshake or Message exchange, therefore handshake is required before sending data to the module.

RSI_SLEEP_MODE_8 (8): In this power mode, the module goes to power save when it is in the unassociated state with the remote device. In this sleep mode, SoC will go to sleep based on GPIO handshake or Message exchange, therefore handshake is required before sending the command to the module.

#define PSP_MODE                                      RSI_SLEEP_MODE_2

Note: For RSISLEEP_MODE_2 and RSI_SLEEP_MODE_8 modes***,*** GPIO or Message based handshake can be selected using RSI_HAND_SHAKE_TYPE macro which is defined in rsi_bt_config.h

Note: In this example, user can verify RSI_SLEEP_MODE_2 with Message based handshake. If the user wants to verify other power modes, the user has to change the application as well as GPIO handshake signals

PSP_TYPE refers power save profile type. The WiSeConnect device supports following power save profile types in BT mode,

RSI_MAX_PSP (0): In this mode, the WiSeConnect device will be in Maximum power save mode. i.e. Device wakes up for every DTIM beacon and does data Tx and Rx.

#define PSP_TYPE                                      RSI_MAX_PSP

4.2 Open rsi_bt_config.h file and update/modify following macros,

#define RSI_FEATURE_BIT_MAP                           FEAT_SECURITY_OPEN
#define RSI_TCP_IP_BYPASS                             RSI_DISABLE
#define RSI_TCP_IP_FEATURE_BIT_MAP                    TCP_IP_FEAT_DHCPV4_CLIENT
#define RSI_CUSTOM_FEATURE_BIT_MAP                    FEAT_CUSTOM_FEAT_EXTENTION_VALID
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP                (EXT_FEAT_LOW_POWER_MODE\|EXT_FEAT_XTAL_CLK_ENABLE\|RAM_LEVEL_NWP_ALL_MCU_ZERO)

RSI_HAND_SHAKE_TYPE is used to select GPIO or Message based handshake in RS_SLEEP_MODE_2 and RSI_SLEEP_MODE_8 modes**.**

#define RSI_HAND_SHAKE_TYPE                           GPIO_BASED

5. Testing the Application#

Follow the steps below for the successful execution of the application.

5.1 Loading the RS9116W Firmware#

Refer Getting started with PC to load the firmware into RS9116W EVK. The firmware binary is located in <SDK>/firmware/

5.2 Building the Application on the Host Platform#

5.2.1 Using STM32#

Refer STM32 Getting Started

  • Open the project <SDK>/examples/snippets/bt/bt_power_save/projects/bt_power_save-nucleo-f411re.uvprojx in Keil IDE.

  • Build and Debug the project

  • Check for the RESET pin:

    • If RESET pin is connected from STM32 to RS9116W EVK, then user need not press the RESET button on RS9116W EVK before free run.

    • If RESET pin is not connected from STM32 to RS9116W EVK, then user need to press the RESET button on RS9116W EVK before free run.

  • Free run the project

  • Then continue the common steps from Section 5.3

5.2.2 Using EFX32#

Refer EFx32 Getting Started, for settin-up EFR & EFM host platforms

  • Import the project from <SDK>/examples/snippets/bt/bt_power_save/projects

  • Select the appropriate .slsproj as per Radio Board type mentioned in Section 3.3

  • Compile and flash the project in to Host MCU

  • Debug the project

  • Check for the RESET pin:

    • If RESET pin is connected from EFX32 to RS9116W EVK, then user need not press the RESET button on RS9116W EVK before free run

    • If RESET pin is not connected from EFX32 to RS9116W EVK, then user need to press the RESET button on RS9116W EVK before free run

  • Free run the project

  • Then continue the common steps from Section 5.3

5.3 Common Steps#

  1. After the program gets executed, Silicon Labs module initializes the SPP profile and waits for the incoming connection.

  2. Open Bluetooth SPP manager app on mobile and do the scan until Silicon Labs module (Ex: "SPP_SLAVE") gets present in the scan list

Scan on Bluetooth SPP manager appScan on Bluetooth SPP manager app
3. After the successful scan, select the device and initiate pairing to Silicon Labs module.

  1. After initiating pairing, Pairing request will pop-up at smartphone side and issue secret key which is given at Silicon Labs module (PIN_CODE) side.

Pairing request pop-up at smartphone sidePairing request pop-up at smartphone side

  1. After successful pair, initiate SPP connection to Silicon Labs module and give the secret key for receiving pairing request at remote device side.

Initiate SPP connection to Silicon Labs moduleInitiate SPP connection to Silicon Labs module

  1. After successful SPP Connection, Module go to sleep depending on the selected type of PSP TYPE.

  2. Send some data (Ex: "Silicon Labs") from the remote device to Silicon Labs device and same data will send back from Silicon Labs device to remote device. Refer the given image for sending and receiving data from the remote device.

Send some data from the remote device to Silicon Labs deviceSend some data from the remote device to Silicon Labs device

  1. Note down power measurement by connecting the module to Agilent Power Meter.

6. Compressed Debug Logging#

To enable the compressed debug logging feature please refer to Logging User Guide