AN4820 Application note

Similar documents
STSW-BLUENRG1-DK. BlueNRG-1, BlueNRG-2 DK SW package

How to configure the BlueNRG-1 and BlueNRG-2 devices in network coprocessor mode. Main components Bluetooth Low Energy wireless system-on-chip

AN4872 Application note

Getting started with STEVAL-IDB007V1 and STEVAL-IDB008V1 evaluation boards

STSW-BNRGUI. BlueNRG GUI SW package. Data brief. Features. Description

AN4869 Application note

STSW-BNRG-Mesh. Mesh over Bluetooth low energy. Features. Description. Applications

The BlueNRG-1, BlueNRG-2 BLE OTA (over-the-air) firmware upgrade

UM2361. Getting started with the ST BlueNRG-Mesh ios application. User manual. Introduction

AN4311 Application note

AN4696 Application note

AN4491 Application note

AN4515 Application note

Bluetooth low energy profiles for the X-CUBE-BLE1 expansion for STM32Cube. Description

RN0084 Release note. ST-LINK/V2 firmware upgrade. About this release note

STSW-STWBCFWDT. STWBC firmware downloader tool. Description. Features

AN4749 Application note

DT0063 Design tip. Bluetooth Low Energy network: time-stamping and sample-rate-conversion. Purpose and benefits. BLE wireless link overview

X-NUCLEO-53L0A1. Ranging and gesture detection sensor expansion board based on VL53L0X for STM32 Nucleo. Description. Features

UM2167 User manual. OrCAD PSpice model usage instructions

STSW-L9960, STSW-L9960T Graphical User Interface (GUI) for EVAL-L9960 & EVAL-L9960T

UM2092 User manual. Basic metrology firmware for the STM32F103RD and the STPM32 devices. Introduction

UM1844 User manual. EVAL-L9958 Graphical user interface (GUI) Introduction

AN5123 Application note

X-NUCLEO-53L1A1. Long distance ranging Time-of-Flight sensor expansion board based on VL53L1X for STM32 Nucleo. Description.

AN3281 Application note

Getting started with MotionPM real-time pedometer library in X CUBE-MEMS1 expansion for STM32Cube

L9958 Evaluation board for high current (8.6A) DC and Stepper Motors. Description

Getting started with the FP-SNS-ALLMEMS1 Bluetooth low energy and sensors software expansion for STM32Cube

UM2255 User manual. SPC58NG-DISP user manual. Introduction

Getting started with the digital MEMS microphone expansion board based on MP34DT01-M for STM32 Nucleo

UM2379. The BlueNRG-1, BlueNRG-2 radio driver. User manual. Introduction

NUCLEO-L496ZG. STM32 Nucleo-144 board. Features. Description

ST10F271B/E, ST10F272B/E Errata sheet

Dynamic Electro-Thermal simulator for VIPower products. Description

A scalable approach to your body, networking and security platforms. Description

EVLKSTCOMET10-1. STCOMET smart meter system-on-chip development kit. Features

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

EVALKITSTKNX. Miniature transceiver STKNX evaluation and development kit. Features

Table 1: Device summary Part numbers Device info (stored in register 0xF0 and 0xF1) Comment SPIRIT1QTR 0x0130 Cut 3.0

Description. July 2016 DocID Rev 2 1/6

SPC584Cx, SPC58ECx. 32-bit Power Architecture microcontroller for automotive ASIL-B applications. Features

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery. Features. Description

Getting started with MotionPM real-time pedometer library in X-CUBE-MEMS1 expansion for STM32Cube

Motor control power board based on the SLLIMM-nano 2 nd series

UM2119 User manual. Graphical user interface (GUI) for EVAL-L9907-H. Introduction

Using the GPIOs and interrupt controller to drive LEDs on STM8 Nucleo-64 boards

ST Payment Secure Solution Java Card platform with up to 100 Kbytes of user NVM for AMEX payment applications

NUCLEO-L433RC-P NUCLEO-L452RE-P

UM2051 User manual. Getting started with the STM32 Nucleo pack for USB Type-C and Power Delivery. Introduction

UM2343 Application note

SPC58NE84E7, SPC58NE84C3

ST25DV-DISCOVERY. Discovery kit for the ST25DV04K dynamic NFC/RFID tag. Features

Getting started with X-CUBE-LED channel LED driver software expansion based on LED1642GW for STM32Cube

P-NUCLEO-IKA02A1. STM32 Nucleo pack: electrochemical toxic gas sensor expansion board with CO sensor. Description. Features

Getting started with the FP-NET-6LPBLE1 function pack for 6LoWPAN IoT node connection to a smartphone via BLE interface

UM2350. Getting started with MotionPW real-time pedometer for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

SPC58EHx,SPC58NHx. A scalable approach for high-end body, networking and security platforms for Automotive. Description. Features

How to upgrade the firmware on the STEVAL-USBC2DP USB Type-C to DisplayPort adapter

TN1234 Technical note

Software GUI user guide for STEVAL-ISV021V1, STEVAL- IDS002V1 and STEVAL-IDS003V1 evaluation boards

AN4045 Application note

UM2330 User manual. ST8500 boot. Introduction

Getting started with MotionMC magnetometer calibration library in X-CUBE-MEMS1 expansion for STM32Cube

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

UM2216 User manual. Getting started with MotionFA fitness activity library in X CUBE MEMS1 expansion for STM32Cube. Introduction

Getting started with the X-CUBE-IKA02A1 multifunctional software expansion for STM32Cube

P-NUCLEO-53L1A1. VL53L1X nucleo pack with X-NUCLEO-53L1A1 expansion board and STM32F401RE nucleo board. Description. Features

Description of STM8 LIN software package (STSW-STM8A-LIN) release 4.1. Table 1. Release information. STM8 LIN package

USB dongle for the Bluetooth class 2 SPBT3.0DP2 module

SPBTLE-1S ArTM. October STMicroelectronics

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery Data brief. Features. Description

This manual provides information for the final user application developer on how to use SPC57S-Discovery microcontroller evaluation board.

UM1893 User Manual. STSW-RFSOL001 STWPLLSim simulation tool for STW81200/STuW Introduction

UM2194. Getting started with MotionAW activity recognition for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

P-NUCLEO-6180X2. Proximity, gesture, ambient light sensor expansion board based on VL6180X for STM32L053R8. Description. Features

SPC584C80C3, SPC58EC80C3

300 ma triple DC-DC converter for powering AMOLED displays. Description. Table 1: Device summary Negative voltage. Auxiliary positive voltage

P-NUCLEO-53L0A1. VL53L0X Nucleo pack with ranging, gesture detection sensor expansion board and STM32F401RE. Description. Features

AN2672 Application note

USB dongle for the Bluetooth class 2 SPBT3.0DP2 module. Description

AN4113 Application note

EV-AUTO-LDOS. L5150GJ-L5300AH7-L4995AK Evaluation Board. Applications. Features. Description

Getting started with osxmotiongc gyroscope calibration library for X-CUBE-MEMS1 expansion for STM32Cube

DT0095 Design tip. Datalogging the SensorTile through a PC. Purpose and benefits. Description

STLC2500D. Bluetooth V2.1 "Lisbon" + EDR. Features. Description

32L476GDISCOVERY. Discovery kit with STM32L476VG MCU. Features. Description

AN2202 Application note

UM1719 User manual. The STPM3x evaluation software. Introduction

AN2667 Application note

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on STUSB1602. Description

Getting started with the X-CUBE-NFC5 high performance HF reader / NFC initiator IC software expansion for STM32Cube

AN4838. Managing memory protection unit (MPU) in STM32 MCUs. Application note. Introduction

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description

32F412GDISCOVERY. Discovery kit with STM32F412ZG MCU. Features. Description

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description

Description. January 2019 DB2381 Rev 3 1/5

Description SPC564A-DISP. March 2014 DocID Rev 3 1/5

Getting started with osxmotionmc magnetometer calibration library for X-CUBE-MEMS1 expansion for STM32Cube

STM32SnippetsL0. STM32L0xx Snippets firmware package. Features. Description

Transcription:

Application note BlueNRG-1 and BlueNRG-2 low power modes Introduction The BlueNRG-1 and BlueNRG-2 are very low power Bluetooth low energy (BLE) single-mode systemson-chip, compliant with Bluetooth specification. The architecture core is a Cortex-M0 32-bit. This application note explains the low power modes for the BlueNRG-1 and BlueNRG-2 devices. Note: The contents of this document are valid for both BlueNRG-1 and BlueNRG-2 devices. Therefore, any reference to the BlueNRG-1 device is also valid for the BlueNRG-2 device. Specific differences have been highlighted whenever needed. July 2017 DocID028870 Rev 2 1/16 www.st.com

Contents AN4820 Contents 1 BlueNRG-1 and BlueNRG-2 HW low power modes... 5 2 BlueNRG-1 and BlueNRG-2 low power mode support... 6 3 BlueNRG-1 and BlueNRG-2 low power mode examples... 9 3.1 Low power SLEEPMODE_RUNNING... 9 3.2 Low power SLEEPMODE_CPU_HALT... 9 3.3 Low power SLEEPMODE_WAKETIMER... 9 3.4 Low power SLEEPMODE_NOTIMER... 10 4 Current consumption measurement test scenarios during BLE 11 5 Revision history... 15 2/16 DocID028870 Rev 2

List of tables List of tables Table 1: BlueNRG-1 current consumption values... 11 Table 2: Document revision history... 15 DocID028870 Rev 2 3/16

List of figures List of figures AN4820 Figure 1: BlueNRG-1 and BlueNRG-2 power save modes... 6 Figure 2: BlueNRG-1 advertising procedure: interval 100 ms... 12 Figure 3: BlueNRG-1 advertising procedure: interval 1000 ms... 12 Figure 4: BlueNRG-1 connection procedure: interval 100 ms... 13 Figure 5: BlueNRG-1 connection procedure: interval 1000 ms... 13 Figure 6: BlueNRG Current Consumption Estimation Tool: advertising scenario power estimation... 14 Figure 7: BlueNRG-1 advertising scenario power consumption... 14 4/16 DocID028870 Rev 2

BlueNRG-1 and BlueNRG-2 HW low power modes 1 BlueNRG-1 and BlueNRG-2 HW low power modes Three low power modes are provided by the BlueNRG-1 and BlueNRG-2 hardware to achieve the best compromise between low power consumption, short startup time and available wakeup sources: CPU-Halt mode In this mode only the CPU is stopped. All the device peripherals continue to operate and they can wake the CPU up when an interrupt/event occurs. This is the lowest power save mode. Sleep mode In this mode the CPU is stopped and all the peripherals are disabled. Only the low speed oscillator block and the external wakeup source block are running. The wakeup source are the wakeup timer or the IO9, IO10, IO11, IO12 and IO13. When the wakeup is triggered by previous listed sources, the system reverts to the run mode with all the peripherals on. Exiting from the sleep mode, the application needs to wait until the high speed oscillator is stable. Standby mode In this mode the CPU is stopped and all the peripherals are disabled. The only wakeup source are IO9, IO10, IO11, IO12 and IO13. Exiting from the standby mode, the application needs to wait until the high speed and low speed oscillators are stable. This mode is the highest power save mode. Refer to BlueNRG-1 and BlueNRG-2 datasheets for current consumption related to all the low power modes. DocID028870 Rev 2 5/16

BlueNRG-1 and BlueNRG-2 low power mode support AN4820 2 BlueNRG-1 and BlueNRG-2 low power mode support The BlueNRG-1_2 DK software package provides software to support all the BlueNRG-1 and BlueNRG-2 hardware low power modes. The low power software combines the low power requests coming from the application with the radio operating mode, choosing the best low power mode applicable in the current scenario. This negotiation between the radio module and the application requests prevents data loss and is performed by the low power software. When the BlueNRG-1 and BlueNRG-2 exit from any low power mode a reset occurs: all the peripheral configuration and the application context are lost. The low power software implements a mechanism to save and restore all the peripheral configuration and the application context when a power save procedure is called. So, from the application point of view, the exit from a low power procedure is fully transparent: when a wakeup from low power occurs, the CPU executes the next instruction after the low power function call. The low power software implements the following power save modes: SLEEPMODE_RUNNING In this low power mode, everything is active and running. In practice this mode is not used, but it is defined for completeness of information: it is not a real power save mode. SLEEPMODE_CPU_HALT This power save mode implements the HW CPU-Halt low power mode. SLEEPMODE_WAKETIMER This power save mode implements the HW Sleep low power mode. SLEEPMODE_NOTIMER This power save mode implements the HW Standby low power mode. Figure 1: BlueNRG-1 and BlueNRG-2 power save modes To enable any low power mode the application calls the function BlueNRG_Sleep(). 6/16 DocID028870 Rev 2

BlueNRG-1 and BlueNRG-2 low power mode support uint8_t BlueNRG_Sleep(SleepModes sleepmode, uint8_t gpiowakebitmask, uint8_t gpiowakelevelmask); Where: sleepmode is the low power mode to enable: SLEEPMODE_RUNNING SLEEPMODE_CPU_HALT SLEEPMODE_WAKETIMER SLEEPMODE_NOTIMER gpiowakebitmask is a bit mask of the IOs that can wake the chip from low power mode: WAKEUP_IO9 WAKEUP_IO10 WAKEUP_IO11 WAKEUP_IO12 WAKEUP_IO13 If this field is zero the gpiowakelevelmask parameter is ignored. gpiowakelevelmask is a bit mask used to set up the active wakeup level for each wakeup source: WAKEUP_IOx_LOW, the system wakes up when IO is low WAKEUP_IOx_HIGH, the system wakes up when IO is high The function returns the status: BLUENRG_SLEEP_CONFIGURATION_ERROR SUCCESS The low power software exports other functions useful for the application: BlueNRG_WakeupSource This function returns the last wakeup source from the low power mode. App_SleepMode_Check() This function allows the application to set its desired sleep mode based on the application power management policy. When the user calls BlueNRG_Sleep(), a negotiation occurs to define the sleep mode and to get specific inputs from the application App_SleepMode_Check() which allows overriding the sleep mode parameter passed by BlueNRG_Sleep(). This function is executed with interrupt masks (using PRIMASK): no interrupt handler can execute and change the application state and, potentially, its desired sleep mode. Therefore, when this function is called, the application software state is frozen. This function could be used in the example below: /* Step 1. Application computes its desired sleep mode */ sleepmode = computesleepmode(); /* Step 2. Application calls BlueNRG_Sleep with its desired sleep mode */ BlueNRG_Sleep(sleepMode,...); If an interrupt occurs between step 1 and step 2, it changes the software state and computesleepmode returns a different value, there is no way for the application to change its power management policy. If the application repeats the check done in step 1 inside the App_SleepMode_Check(), any change between step 1 and step 2 is taken into account. The key difference is that the second check is performed inside DocID028870 Rev 2 7/16

BlueNRG-1 and BlueNRG-2 low power mode support AN4820 BlueNRG_Sleep() with interrupt masks and no change in the application software state occurs before entering the computed sleep mode. Any interrupt occurring after the interrupt mask instruction inside the BlueNRG_Sleep() and the call to WFI instruction will cause WFI behaving as NOP and the system will skip low power mode activation, thus serving the interrupt once re-enabled. If the application wants to use the sleep mode (SLEEPMODE_WAKETIMER or SLEEPMODE_NOTIMER) and starts the sleep procedure with a wakeup source already active, the system does not switch the power management off and remains blocked in the WFI instruction until an interrupt occurs. In this context, if other wakeup sources, set in the BlueNRG_Sleep() API, occur, they will be ignored. The only way to restart the code execution is through an interrupt occurring from any peripheral. So, it is advisable to enable, at NVIC level, the interrupts associated with the wakeup sources. 8/16 DocID028870 Rev 2

BlueNRG-1 and BlueNRG-2 low power mode examples 3 BlueNRG-1 and BlueNRG-2 low power mode examples Some low power modes application use cases are provided in the following sections. 3.1 Low power SLEEPMODE_RUNNING In this low power mode, everything is active and running: it is not a real low power mode. A typical source code is: while(1) /*main loop*/ { /* BLE Stack Tick */ BTLE_StackTick(); /* Application Tick */ APP_Tick(); /* Power Save management */ BlueNRG_Sleep(SLEEPMODE_RUNNING, 0, 0); } This low power mode does not need wakeup sources. 3.2 Low power SLEEPMODE_CPU_HALT In this mode only the CPU is stopped. All peripherals continue to operate and can wake up the CPU when an interrupt occurs. A typical source code is: while(1) /*main loop*/ { /* BLE Stack Tick */ BTLE_StackTick(); /* Application Tick */ APP_Tick(); /* Power Save management */ BlueNRG_Sleep(SLEEPMODE_CPU_HALT, 0, 0); } In this low power mode the only wakeup sources are the peripheral interrupts. If the radio operating mode does not allow this low power request, as it is executing a nonstoppable operation, the low power mode is converted automatically inside the low power software in SLEEPMODE_RUNNING. 3.3 Low power SLEEPMODE_WAKETIMER In this mode the CPU is stopped and all the peripherals are disabled. Only the low speed oscillator block and the external wakeup source block are running. A typical source code is: /* Starts the VTimer 0 with timeout 2 sec. */ HAL_VTimerStart_ms(0, 2000); while(1) /*main loop*/ { /* BLE Stack Tick */ BTLE_StackTick(); /* Application Tick */ APP_Tick(); DocID028870 Rev 2 9/16

BlueNRG-1 and BlueNRG-2 low power mode examples /* Power Save management */ BlueNRG_Sleep(SLEEPMODE_WAKETIMER, WAKEUP_IO13, WAKEUP_IOx_LOW<< WAKEUP_IO13_SHIFT_MASK); } AN4820 The wakeup source is the IO13 with low level sensitive; the application sets a virtual timer to wake up the system when the 2 sec. timeout occurs. In this scenario, the application enables the low power mode WAKETIMER. If the radio operating mode is in connection or advertising state, the stack accepts the low power mode proposed by the application, but, if necessary, the system can be woken up before the application timeout to follow the connection interval time profile or the advertising interval time profile. 3.4 Low power SLEEPMODE_NOTIMER In this low power mode the CPU is stopped and all the peripherals are disabled. Only the external wakeup source block is running. A typical source code is: while(1) /*main loop*/ { /* BLE Stack Tick */ BTLE_StackTick(); /* Application Tick */ APP_Tick(); /* Power Save management */ BlueNRG_Sleep(SLEEPMODE_NOTIMER, WAKEUP_IO13, WAKEUP_IOx_HIGH << WAKEUP_IO13_SHIFT_MASK); } The wakeup source is the IO13 with high level sensitive. In this scenario the application enables the low power mode NOTIMER. If the radio module is in connection state, after the negotiation with the radio stack, the low power software changes the low power mode into WAKETIMER to follow the connection time profile. Instead, if the radio module is in an idle state, the radio stack accepts the low power mode NOTIMER requested from the application and the low power software does not change it. 10/16 DocID028870 Rev 2

Current consumption measurement test scenarios during BLE 4 Current consumption measurement test scenarios during BLE This section shows typical current consumption measurements during BLE advertising and connection times. To take these measurements the following configuration has been used: Hardware: STEVAL-IDB007V1 Firmware: BLE_Power_Consumption test application released in the BlueNRG-1_2 DK software package Power supply: 3.3 V Tx Power: -2 dbm Retention: full RAM retention 24 KB Crystal Startup time: 642 µs Master SCA: 100 ppm Slave SCA: 100 ppm Advertising interval: 100 ms and 1000 ms, with 28 byte packets length Connection interval: 100 ms and 1000 ms, with empty packets The BLE_Power_Consumption test application configures the BlueNRG-1 as a Bluetooth Low Energy (BLE) peripheral. It is included in the BlueNRG-1_2 DK software package (STSW-BLUENRG1-DK), in Project, BLE_Examples folder. The BLE master role is covered by another BlueNRG-1 device configured with the DTM firmware application available in the same folder and running some master scripts provided in the BLE_Power_Consumption test application folder. The scripts allow configuring a BlueNRG-1 device as a BLE master and create a connection with the BlueNRG-1 under test. The scripts run using the BlueNRG-GUI available in the BlueNRG GUI SW package (STSW-BNRGUI). The current consumption measured in these scenarios is related only to the BlueNRG-1. The values are measured connecting a DC power analyzer to the STEVAL-IDB007V1 JP4 probe. Table 1: BlueNRG-1 current consumption values BLE scenario Real current consumption Estimated current consumption Advertising interval 100 ms 136.931 µa 181.8 µa Advertising interval 1000 ms 15.342 µa 18.99 µa Connection interval 100 ms 50.423 µa 48.81 µa Connection interval 1000 ms 7.059 µa 6.95 µa The third column values are calculated using the BlueNRG Current Consumption Estimation Tool (STSW-BNRG001). The following pictures show the advertising procedure snapshots for both intervals (the packet length is 28 bytes). DocID028870 Rev 2 11/16

Current consumption measurement test scenarios during BLE Figure 2: BlueNRG-1 advertising procedure: interval 100 ms AN4820 Figure 3: BlueNRG-1 advertising procedure: interval 1000 ms The following pictures show the connection procedure snapshots for both intervals (with empty packet). 12/16 DocID028870 Rev 2

Current consumption measurement test scenarios during BLE Figure 4: BlueNRG-1 connection procedure: interval 100 ms Figure 5: BlueNRG-1 connection procedure: interval 1000 ms The following pictures compare the the DC power analyzer current waveform measured during the advertising procedure and the estimated waveform calculated via the BlueNRG Current Consumption Estimation Tool (1000 ms advertising interval and 28 bytes packet length). DocID028870 Rev 2 13/16

Current consumption measurement test scenarios during BLE Figure 6: BlueNRG Current Consumption Estimation Tool: advertising scenario power estimation AN4820 Figure 7: BlueNRG-1 advertising scenario power consumption 14/16 DocID028870 Rev 2

Revision history 5 Revision history Table 2: Document revision history Date Version Changes 29-Jun-2016 1 Initial release. 12-Jul-2017 2 Added references to BlueNRG-2 throughout text. Updated: Introduction, Section 2: "BlueNRG-1 and BlueNRG-2 low power mode support", Section 3.1: "Low power SLEEPMODE_RUNNING", Section 3.2: "Low power SLEEPMODE_CPU_HALT", Section 3.3: "Low power SLEEPMODE_WAKETIMER" and Section 3.4: "Low power SLEEPMODE_NOTIMER". Added: Section 4: "Current consumption measurement test scenarios during BLE" DocID028870 Rev 2 15/16

IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products. No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product. ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces information previously supplied in any prior versions of this document. 2017 STMicroelectronics All rights reserved 16/16 DocID028870 Rev 2