AN4515
Application note
Maximizing power efficiency using STM32F411xx Batch Acquisition
Mode (BAM)
Introduction
The STM32F411 line is part of the STM32 Dynamic Efficiency
™
microcontrollers. These
devices are the entry level to the High-performance F4 Series and offer the best balance of
dynamic power consumption and processing performance, while achieving outstanding low-
power consumption in Run, Sleep and Stop modes.
With the new Batch Acquisition Mode (BAM) which allows optimizing power consumption for
data batching, the STM32F411xx microcontrollers brings the Dynamic Efficiency to a new
level.
This application note guides you to achieve the expected power consumptions on
STM32F411xx microcontrollers through an application case. It also provides an example of
how to implement the BAM.
This application note is provided with STSW-STM32154 firmware package.
Table 1. Applicable products and software
Type
Microcontrollers
Software
STM32F411 line
STSW-STM32154
Part numbers
December 2014
DocID026482 Rev 1
1/24
www.st.com
1
Contents
AN4515
Contents
1
Application Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1
1.2
1.3
Hardware high level description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Batch Acquisition Mode (BAM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
BAM use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
How to implement BAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
How to execute code from RAM using Keil® MDK-ARM™ toolchain . . 11
How to execute code from RAM using IAR-EWARM toolchain . . . . . . . 13
2
Application note use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1
2.2
2.3
Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
STM32F411xx used peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3
Application current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1
3.2
3.3
Hardware requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Software settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Measured current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4
5
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2/24
DocID026482 Rev 1
AN4515
List of tables
List of tables
Table 1.
Table 2.
Table 3.
Table 4.
Table 5.
Applicable products and software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Summary of methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Master and sensor board connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Current consumption example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
DocID026482 Rev 1
3/24
3
List of figures
AN4515
List of figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.
Figure 8.
Figure 9.
Figure 10.
Figure 11.
Figure 12.
Figure 13.
Figure 14.
Figure 15.
Figure 16.
Application high level block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Batch Acquisition Mode use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Executing ISRs from RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Executing ISRs from Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Using events to wake up the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
MDK-ARM file placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
MDK-ARM scatter file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
MDK-ARM Options menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Update of EWARM linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Update of EWARM startup file to handle an interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Use case block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Use case state machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Startup and Configuration Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Wait MEMS movement while CPU is Sleep mode
and Flash memory stopped . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Log example when configuration 4 is selected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Hardware environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4/24
DocID026482 Rev 1
AN4515
Application Overview
1
Application Overview
This section gives an overview of the application note use case, details how the user can
implement the BAM and describes each low-power mode involved in the use case
operation.
1.1
Hardware high level description
This document first explains how to assess power consumption in different low-power
modes (Standby, Sleep, Stop and Low-power run) and then highlights the significant power
reduction achieved by using the BAM to transfer sensor (MEMS LSM303DLHC) data
direction (UP or DOWN) to a master STM32F411xx microcontroller.
The data sent by the sensor is received via the I2C interface and transferred by DMA to the
RAM. After processing data, the DMA sends the data direction to the UART. It is then
displayed via the USB virtual comport.
Figure 1
shows a high-level block diagram of the application.
Figure 1. Application high level block diagram
Note:
The next version of this application note will include the X-Nucleo IKS01A1 as sensor
instead of 32F401CDISCOVERY (STM32F401C-DISCO order code).
DocID026482 Rev 1
5/24
23