An4746 Optimizing Power and Performance With stm32l4 and stm32l4 Series Microcontrollers Stmicroelectronics
An4746 Optimizing Power and Performance With stm32l4 and stm32l4 Series Microcontrollers Stmicroelectronics
Application note
Introduction
The STM32L4 and STM32L4+ Series microcontrollers are designed using an innovative architecture to reach best-in-class,
ultra-low-power figures thanks to their high flexibility and advanced set of peripherals.
The STM32L4 Series devices are based on the Cortex®-M4 with FPU core. They can operate at up to 80 MHz and achieve
100 DMIPS performance at 80 MHz, thanks to the integration of the ART Accelerator, while maintaining the smallest possible
dynamic power consumption. The STM32L4+ Series stepped up the performance by 50%, going to 120 MHz and 150 DMIPS.
Both STM32L4 and STM32L4+ Series feature the FlexPowerControl function, which increases flexibility in power mode
management, while at the same time reducing the overall application consumption.
In order to maximize the battery life and/or reduce its cost, the selection of the processor working mode is critical. In
addition to power consumption considerations, the application constraints also have to be taken into account. Consequently
the microcontroller needs to offer a wide range of working modes in order to support all applications, while always providing
close-to-optimum power performance.
In many ultra-low-power applications the microcontroller is used with long periods of sleep time followed by very short periods of
dense processing.
This application note provides qualitative and quantitative information in order to be able to configure different parameters
(such as frequency, range, and low-power mode), before starting the implementation and optimization. All the computations are
performed with typical data from the product datasheet and at ambient temperature, unless otherwise specified.
This application note uses the industry-standard ULPMark™ benchmark from EEMBC as a reference case to correlate the
computations and simulations with the measurements.
1 General information
STM32L4 and STM32L4+ Series microcontrollers are built around an Arm® Cortex®-M4 with FPU and DSP
instruction set.
Note: Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
Related documents
STM32L4/L4+ Series core documentation and in particular:
[1] STM32L47xxx, STM32L48xxx, STM32L49xxx and STM32L4Axxx advanced Arm®-based 32-bit MCUs reference manual
(RM0351)
[2] STM32L41xxx/42xxx/43xxx/44xxx/45xxx/46xxx advanced Arm®-based 32-bit MCUs reference manual (RM0394)
[3] STM32L4 and STM32L4+ ultra-low-power features overview application note (AN4621)
[4] STM32L4 datasheets
[5] Design recommendations for STM32L4xxxx with external SMPS, for ultra-low-power applications with high performance
application note (AN4978)
[6] EEMBC organization, http://www.eembc.org
[7] STM32L4+ Series advanced Arm®-based 32-bit MCUs reference manual (RM0432)
[8] STM32 cross-series timer overview application note (AN4013)
In applications where the battery lifetime is a concern, the system must be optimized to provide maximum
performance and reactivity at the minimal power consumption.
This type of application contains generally two different phases:
• Process phase, in which some sensor or radio information needs to be processed at either regular time
intervals (RTC) or on external events (GPIO, interrupts..).
• Inactive phase, in which the system is sleeping and waiting for either RTC or GPIO wakeup.
TPERIOD
Process
Inactive
STM32L49xxx/L4Axx 64 374
STM32L47xxx/L48xxx 32 230
STM32L45xxx/L46xxx 32 250
STM32L43xxx/L44xxx 16 200
64 615
STM32L4P5xx/L4Q5xx(1)
4 230
STM32L41xxx/L42xxx 8 100
STM32L4Rxxx/L4Sxxx 64 385
Pull-up and pull-down can individually be applied on each I/O during the Standby mode, allowing the external
device configuration to be kept.
A wakeup from this mode is done thanks to one of the five wakeup pins, the reset pin or the independent
watchdog. The RTC clocked by the low-speed oscillators (LSE or LSI) is also functional in this mode, with wakeup
capability.
This curve can be translated into power efficiency by dividing the current consumption, multiplied by supply
voltage to get power figure, by the CPU frequency, see the following figure.
A simplified application model has been considered, where the application wakes up every TPERIOD and performs
some processing that is always the same and seen as a constant number of instructions (no waiting loops, no
data dependencies). This allows to make the following approximations:
• The Process phase duration (TPROCESS) can be defined in terms of the number of cycles (NOC) to be
executed at each period. Defining FCLK as the CPU system clock frequency, the duration of the Process
phase is equal to TPROCESS = NOC / FCLK. The average current consumption during this phase is equal to
IPROCESS.
• The Inactive phase duration is TPERIOD - TPROCESS, and its average current consumption is IINACTIVE.
TPERIOD
TPROCESS
Process
Inactive
Clock
NOC NOC
In order to get the average current consumption, both consumptions during the Process phase and during the
Inactive phase have to be summed up.
1,000.00
Run mode
Range 2
MSI 24 MHz
100.00
IDD average consumption (µA)
LP sleep
10.00 Stop 1
Stop 2
Standby
Shutdown
1.00
0.10
100 1,000 10,000 100,000 1,000,000
Average number of processing cycle per second
The previous figure shows that, for applications requiring some data retention, the Standby low-power mode gives
the best performance, whatever the number of cycles to be executed. It shows also that when the duty cycle
increases (> 1 Mega cycles per second), Stop 2 gives almost the same results as Standby.
The Shutdown mode has been discarded (dotted line) because it does not present enough data retention
capability for this type of application.
However the choice of low-power mode is not only dictated by the overall power consumption figure, but also
by other wakeup considerations linked to the application. The previous figure also shows that the STM32L4/L4+
Series Stop 2 mode is very close to the Standby low-power mode while presenting a much more powerful and
simpler setup for waking-up.
Figure 8. STM32L476 influence of Run mode and frequency on average current consumption
4.00
3.50
Avergae current consumption (µA)
3.00
LP run
Range 2
Range 1
2.50
2.00
1.50
0.1 1 10 100
SYSCLK frequency (MHz)
This figure corresponds to 10 K cycles of processing during the Process phase. The three different segments
correspond to the LP run (left part of the graph), the Range 2 (middle part) and the Range 1 (right part).
The figure above confirms that the Range 2 at 26 MHz gives the best performance. However, the STM32L4/L4+
Series present very similar performances from 1 MHz up to 80 MHz, thanks to the three (or four) run modes (up to
120 MHz in STM32L4+ Series Boost mode). Simulations have been performed with other number of cycles (from
100 to 10 M) giving the same optimum point.
- TPERIOD(1)
Unit
Cycles per second 1 ms 5 ms 10 ms 50 ms 100 ms 500 ms 1s 5s 10 s
1. All consumption values are typical TA = 25°C, VDD = 3.0 V based on STM32L476 datasheet [4].
- TPERIOD(1)
Unit
Cycles per second 1 ms 5 ms 10 ms 50 ms 100 ms 500 ms 1s 5s 10 s
1. All consumption values are typical TA = 25°C, VDD = 3.0 V based on STM32L476 datasheet [4]
The next figure gives the ratio between the two tables presented above:
180%
160%
140%
120%
1000
100% 10000
100000
1000000
80%
10000000
60%
40%
20%
0%
0.001 0.01 0.1 1 10
Wakeup period (second)
Note: When the temperature increases the advantage provided by the Standby increases as well, for example the
crossing point is 20 ms at 25 °C but become only 2 ms at 85 °C (and 70 ms at -20 °C).
The horizontal axis corresponds to the system wakeup period, the vertical axis corresponds to the ratio between
the average consumption of the Stop 2 case and that of the Standby with SRAM2 case. The different curves,
correspond to the number of cycles for the Process phase.
If the wakeup period is below 20 ms Stop 2 is more interesting than Standby. If the number of cycles in the
Process phase is high (for example 1 million and above) the interest of Standby decreases, as the consumption is
then mainly driven by the Run mode used during the Process phase.
A similar computation has been performed for Shutdown versus Standby, the crossing point is in the range of 2
seconds.
Figure 10. STM32L476 comparison Standby without SRAM2 retention versus Shutdown
120%
Average power consumption ratio (Standby / Shutdown)
100%
80%
60%
1000
10000
100000
1000000
40% 10000000
20%
0%
0.001 0.01 0.1 1 10
Wakeup period (second)
Note: In this theoretical study the number of instructions to reload the context is assumed to be taken into account in
the Process phase. In a real implementation it requires more instructions to restart from Shutdown and Standby
than Stop modes.
Figure 11. STM32L476 Run mode correction with voltage and temperature
1.14
1.12
1.10
1.08
Correcting factor
1.06
25 °C
1.04 105 °C
1.02
1.00
0.98
0.96
1.8 2 2.2 2.4 2.6 2.8 3 3.2 3.4 3.6
VDD (V)
The low-power modes have a stronger dependency on the voltage and temperature.
The figure below shows the correction factor to apply to the consumption for different low-power modes and
supply voltage:
1.50
1.40
1.30
1.20
Correcting factor
1.10
Stop1
1.00
Stop2
Standby
0.90 Shutdown
0.80
0.70
0.60
0.50
1.8 2 2.2 2.4 2.6 2.8 3 3.2 3.4 3.6
VDD (V)
The figure hereafter gives the correction factor to apply to the consumption for different low-power modes and
temperatures, for 1.8 V and 3.0 V supply:
1.00
0 20 40 60 80 100 120 140
Temperature (°C)
Above 45 °C, a good approximation is to consider that the low-power mode consumption doubles every 17 °C.
A similar theoretical optimization analysis has been performed over the whole range of temperature. The
conclusion remains unchanged.
Reducing the voltage does not decrease significantly the current consumption in Process phase (2 % gain for
1.8 V compared to 3.0 V). Nevertheless voltage reduction should be considered for following reasons:
• The Inactive phase current is significantly lower (almost 30 % for Standby).
• As the power consumed by the system is the product of the current by the voltage, the power consumption is
at least 40 % lower (1.8 V versus 3.0 V).
In the example above, the consumption in the Process phase is 60 % of the overall consumption. If the voltage is
reduced from 3.0 V to 1.8 V:
• The current consumption is reduced by 12 %.
• The overall power consumption is reduced by 53 %.
The PCC tool allows to simulate the consumption of the STM32L4/L4+ Series device using an external SMPS.
The user can enter its SMPS main characteristics such as:
• Quiescent current
• Efficiency
• Off current
• Output voltage
Figure 16. ULPMark-CP STM32L476 measurements versus Run mode and frequency
160
150
140
ULPBench™ score
HSI+PLL
130
MSI
MSI_LPrun
HSI16
120
110
100
0.1 1 10 100
SYSCLK frequency (MHz)
The above curves correspond to the Range 2 at 24 MHz MSI mode, it clearly shows the advantages of a voltage
reduction.
8000
7000
6000 Run2_24MHz
Run2_16MHz
Run2_8MHz
Peak current (µA)
Run1_48MHz
5000
Run1_32MHz
Run1_24MHz
Run2_4MHz
4000
LPRun_2MHz
LPRun_1MHz
Run2_2MHz
3000
LPRun_800kHz
Run1_80MHz_pll
Run1_64MHz_pll
2000 Run1_48MHz_pll
Run1_32MHz_pll
Run2_16MHz_HSI
1000
0
100 110 120 130 140 150 160
ULPBench™ score
The above measurements have been performed on Nucleo-L476RG board assuming an impedance source of
200 Ω for frequencies below 48 MHz and 100 Ω for frequencies above. If the source impedance is lower, the peak
current increases up to the corresponding Run mode maximum.
Note: The peak current drawn from the battery system depends a lot on the battery internal resistance as well as the
decoupling capacitors placed on the PCB. Aged batteries or extreme temperature conditions could significantly
increase this resistance, making the peak factor a decisive choice for the selection of the optimum mode.
An easy way to reduce the peak current is to increase the input decoupling capacitance. On the Nucleo-L476RG
board a maximum of 4.7 µF of tank capacitor can be used.
360
340
320
300
280
Equivalent score
260
STM32L433
240 STM32L433-SMPS
220
200
180
160
140
120
100
1.8 2 2.2 2.4 2.6 2.8 3 3.2 3.4 3.6 3.8 4 4.2 4.4 4.6
It clearly shows the advantages of using an external SMPS when the supply voltage is high.
All of the STM32L4/L4+ Series devices have the capability to support an external SMPS, the following figure plots
the obtained performance for each of them.
300
280
260
STM32L433
240 STM32L452
Equivalent score
STM32L476
STM32L496
220
200
180
160
140
2 2.2 2.4 2.6 2.8 3 3.2 3.4 3.6 3.8 4 4.2 4.4
Note that the STM32L476 and STM32L496 measurements have been performed on a Nucleo144 board, while
the STM32L433 and STM32L452 have been performed on a Nucleo 64 board. Each board having the same
SMPS devices allowing the operation down to 2.1 V and also a dedicated SMPS to produce the 1.8 V needed for
the VDD and IO.
7 Conclusion
The STM32L4/L4+ Series offers a large choice of options for optimizing both performance and power
consumption, whatever the application.
This document provides guidelines based on experiments and quantitative results in order to help quickly
selecting the best running modes and low-power modes, according to the characteristics and constraints of the
end-user application.
In the case of the ULPBench™ benchmark, with a wakeup period of 1 second and a processing load of about 10
Kcycles per period, the optimum choice is to use the Standby low-power mode for the Inactive phase associated
with the Range 2 mode at 24 MHz (from the MSI) for the Process phase. Other frequencies in the range 1 to 80
MHz give also very good results. Power efficiency of STM32L4+ Series boost mode is again slightly lower, but still
a viable option, for example for short burst-data processing.
For a real application, the following rules apply, depending on the wakeup period:
• If the wakeup period is longer than some tens of ms, an implementation using Standby provides better
consumption.
• If the wakeup period is shorter, an implementation with Stop 2 provides better results.
• If the temperature is high, the Standby mode should be preferred.
The selection of the low-power modes depends not only on the power consumption but also on the wakeup time
requirement (system reactivity) and the requirement for data retention.
For STM32L4/L4+ Series, if the processing can accommodate a frequency below 24 MHz, the optimum points are
(in decreasing power efficiency order):
• Standby mode: if wakeup transition time can be longer than 20 µs and retention area can be as small as
16/32/64 Kbytes.
• Stop 2: if wakeup transition time can be longer than 8 µs and the application needs more than
16/32/64 Kbytes of retention.
In the second case, the consumption penalty is less than 1.8 times the first case.
In any case, decreasing the VDD voltage improves the power consumption.
The usage of an external SMPS, when the VDD voltage is higher than 2 V, can significantly improve the power
performance of the overall application.
Ultimately if the wakeup period is longer than a few seconds and the retention memory is not needed, the
Shutdown mode provides the best power performance. In this case the wakeup time is typically 256 µs.
To help the customer to fine tune his application and make his own choice STMicroelectronics provides a power
consumption calculator (PCC) module within the STM32CubeMX that is available for free download from http://
www.st.com/stm32cube.
Note: This document is using ULPBench™ results that are updated regularly, refer to the official score stored at http://
www.eembc.org (search for ULPBench™).
Revision history
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Low-power application profile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1 Key parameters to consider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
List of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
List of figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
List of tables
Table 1. SRAM2 retained content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Table 2. Impact of wakeup energy on Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Table 3. Impact of wakeup energy on Stop 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Table 4. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
List of figures
Figure 1. Application profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Figure 2. STM32L476 Run mode current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 3. STM32L4R5 Run mode current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 4. STM32L476 Run mode power efficiency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 5. STM32L4R5 Run mode power efficiency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 6. Application sequence and parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 7. STM32L476 influence of low-power mode on average current consumption . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 8. STM32L476 influence of Run mode and frequency on average current consumption . . . . . . . . . . . . . . . . . . . 12
Figure 9. STM32L476 comparison Stop 2 versus Standby with SRAM2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 10. STM32L476 comparison Standby without SRAM2 retention versus Shutdown . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 11. STM32L476 Run mode correction with voltage and temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 12. STM32L476 low-power mode correction with VDD voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 13. STM32L476 low-power mode correction with temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 14. Zoom on ULPBench™ sequence showing transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 15. PCC simulation of ULPBench™ sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 16. ULPMark-CP STM32L476 measurements versus Run mode and frequency . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 17. Equivalent score as a function of supply voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 18. ULPMark-CP score versus temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 19. ULPMark-CP score versus STM32L476 peak current measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 20. Equivalent score with and without external SMPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 21. STM32L4 Series devices comparison using external SMPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26