5 Power controller (PWR)
5 Power controller (PWR)
This section applies to the whole STM32F4xx family, unless otherwise specified.
9%$7
%DFNXSFLUFXLWU\
9%$7 3RZHU 26&.57&
WR9 VZLWFK :DNHXSORJLF
%DFNXSUHJLVWHUV
EDFNXS5$0
/HYHOVKLIWHU
287
,2
*3,2V
/RJLF
,1
9&$3B .HUQHOORJLF
î) 9&$3B &38GLJLWDO
5$0
9'' 9''
9ROWDJH
îQ) 966 UHJXODWRU
î)
%<3$66B5(* )ODVKPHPRU\
5HVHW
3'5B21 FRQWUROOHU
9''
9''$
95()
95()
$QDORJ
Q) Q) 95() $'& 5&V
) ) 3//
966$
069
"ACKUP CIRCUITRY
6"!4 0O WER SWI TCH /3#+ 24#
TO 6 7AKEUP LOGIC
"ACKUP REGISTERS
BACKUP 2!-
/54
,EVEL SHIFTER
)/
'0 )/S ,OGIC
). +ERNEL LOGIC
#05
6#!0?
6#!0? DIGITAL
§ & 2!-
6$$
6$$ 6OLTAGE
REGULATOR
§ N& 633
§ &
62%&
62%&
-36
If no external battery is used in the application, it is recommended to connect the VBAT pin to
VDD with a 100 nF external decoupling ceramic capacitor in parallel.
When the backup domain is supplied by VDD (analog switch connected to VDD), the
following functions are available:
• PC14 and PC15 can be used as either GPIO or LSE pins
• PC13 can be used as a GPIOas the RTC_AF1 pin (refer to Table 37: RTC_AF1 pin for
more details about this pin configuration)
Note: Due to the fact that the switch only sinks a limited amount of current (3 mA), the use of PI8
and PC13 to PC15 GPIOs in output mode is restricted: the speed has to be limited to 2 MHz
with a maximum load of 30 pF and these I/Os must not be used as a current source (e.g. to
drive an LED).
When the backup domain is supplied by VBAT (analog switch connected to VBAT because
VDD is not present), the following functions are available:
• PC14 and PC15 can be used as LSE pins only
• PC13 can be used as the RTC_AF1 pin (refer to Table 37: RTC_AF1 pin for more
details about this pin configuration)
• PI8 can be used as RTC_AF2
Backup SRAM
The backup domain includes 4 Kbytes of backup SRAM addressed in 32-bit, 16-bit or 8-bit
mode. Its content is retained even in Standby or VBAT mode when the low-power backup
regulator is enabled. It can be considered as an internal EEPROM when VBAT is always
present.
When the backup domain is supplied by VDD (analog switch connected to VDD), the backup
SRAM is powered from VDD which replaces the VBAT power supply to save battery life.
When the backup domain is supplied by VBAT (analog switch connected to VBAT because
VDD is not present), the backup SRAM is powered by a dedicated low-power regulator. This
regulator can be ON or OFF depending whether the application needs the backup SRAM
function in Standby and VBAT modes or not. The power-down of this regulator is controlled
by a dedicated bit, the BRE control bit of the PWR_CSR register (see Section 5.4.2: PWR
power control/status register (PWR_CSR) for STM32F405xx/07xx and
STM32F415xx/17xx).
The backup SRAM is not mass erased by an tamper event. When the Flash memory is read
protected, the backup SRAM is also read protected to prevent confidential data, such as
cryptographic private key, from being accessed. When the protection level change from
level 1 to level 0 is requested, the backup SRAM content is erased.
3RZHUVZLWFK /3YROWDJHUHJXODWRU
9ROWDJHUHJXODWRU !9
!9
9GRPDLQ
%DFNXS65$0 %DFNXS65$0
LQWHUIDFH 9
57& /6(+]
%DFNXSGRPDLQ
069
regulator can be put either in main regulator mode (MR) or in low-power mode (LPR).
The programmed voltage scale remains the same during Stop mode:
The programmed voltage scale remains the same during Stop mode (see
Section 5.4.1: PWR power control register (PWR_CR) for STM32F405xx/07xx
and STM32F415xx/17xx).
• In Standby mode, the regulator is powered down. The content of the registers and
SRAM are lost except for the Standby circuitry and the backup domain.
Note: For more details, refer to the voltage regulator section in the STM32F405xx/07xx and
STM32F415xx/17xx datasheets.
Table 22. Voltage regulator configuration mode versus device operating mode(1)
Voltage regulator
Run mode Sleep mode Stop mode Standby mode
configuration
Example of sequence 2:
1. Select HSI or HSE as system clock source.
2. Disable the peripheral clocks that are not generated by the System PLL (I2S clock,
LCD-TFT clock, SAI1 clock, USB_48MHz clock,....).
3. Reset the ODSW bit in the PWR_CR register to switch back the voltage regulator to
Normal mode. The system clock is stalled during voltage switching.
4. Wait for the ODWRDY flag of PWR_CSR to be reset.
5. Reset the ODEN bit in the PWR_CR register to disable the Over-drive mode.
Note: During step 3, the ODEN bit remains set and the Over-drive mode is still enabled but not
active (ODSW bit is reset). If the ODEN bit is reset instead, the Over-drive mode is disabled
and the voltage regulator is switched back to the initial voltage.
0$2
M6
HYSTERESIS 0$2
4EMPORIZATION
T2344%-0/
2ESET
-36
2ESET
-36
39'WKUHVKROG P9
K\VWHUHVLV
39'RXWSXW
069
In addition, the power consumption in Run mode can be reduce by one of the following
means:
• Slowing down the system clocks
• Gating the clocks to the APBx and AHBx peripherals when they are unused.
Only enabled NVIC interrupts with sufficient priority will wakeup and interrupt the MCU.
ON or in low- power
mode (depends on
PWR power control
register (PWR_CR)
for
STM32F405xx/07x
x and
PDDS and LPDS STM32F415xx/17x
bits + Any EXTI line (configured x and PWR power
Stop SLEEPDEEP bit in the EXTI registers, control register
+ WFI, Return internal and external lines) (PWR_CR) for
from ISR or WFE HSI and STM32F405xx/07x
All 1.2 V domain HSE x and
clocks OFF oscillator STM32F415xx/17x
s OFF xPWR power
control register
(PWR_CR) for
STM32F42xxx and
STM32F43xxx
WKUP pin rising edge,
RTC alarm (Alarm A or
PDDS bit +
Alarm B), RTC Wakeup
SLEEPDEEP bit
Standby event, RTC tamper OFF
+ WFI, Return
events, RTC time stamp
from ISR or WFE
event, external reset in
NRST pin, IWDG reset
Peripheral clock gating is controlled by the AHB1 peripheral clock enable register
(RCC_AHB1ENR), AHB2 peripheral clock enable register (RCC_AHB2ENR), AHB3
peripheral clock enable register (RCC_AHB3ENR) (see Section 7.3.10: RCC AHB1
peripheral clock enable register (RCC_AHB1ENR), Section 7.3.11: RCC AHB2 peripheral
clock enable register (RCC_AHB2ENR), Section 7.3.12: RCC AHB3 peripheral clock
enable register (RCC_AHB3ENR) for STM32F405xx/07xx and STM32F415xx/17xx, and
Section 6.3.10: RCC AHB1 peripheral clock register (RCC_AHB1ENR), Section 6.3.11:
RCC AHB2 peripheral clock enable register (RCC_AHB2ENR), and Section 6.3.12: RCC
AHB3 peripheral clock enable register (RCC_AHB3ENR) for STM32F42xxx and
STM32F43xxx).
Disabling the peripherals clocks in Sleep mode can be performed automatically by resetting
the corresponding bit in RCC_AHBxLPENR and RCC_APBxLPENR registers.
STOP MR
0 0 HSI RC startup time
(Main regulator)
Note: If the application needs to disable the external clock before entering Stop mode, the HSEON
bit must first be disabled and the system clock switched to HSI.
Otherwise, if the HSEON bit is kept enabled while the external clock (external oscillator) can
be removed before entering stop mode, the clock security system (CSS) feature must be
enabled to detect any external oscillator failure and avoid a malfunction behavior when
entering stop mode.
Table 27. Stop mode entry and exit (for STM32F405xx/07xx and STM32F415xx/17xx)
Stop mode Description
Table 27. Stop mode entry and exit (for STM32F405xx/07xx and STM32F415xx/17xx)
Stop mode Description
STOP MR
- 0 - 0 0 HSI RC startup time
(Main Regulator)
HSI RC startup time +
STOP MR- FPD - 0 - 0 1 Flash wakeup time from power-
down mode
In Stop mode, the following features can be selected by programming individual control bits:
• Independent watchdog (IWDG): the IWDG is started by writing to its Key register or by
hardware option. Once started it cannot be stopped except by a Reset. See
Section 21.3 in Section 21: Independent watchdog (IWDG).
• Real-time clock (RTC): this is configured by the RTCEN bit in the Section 7.3.21: RCC
Backup domain control register (RCC_BDCR)
• Internal RC oscillator (LSI RC): this is configured by the LSION bit in the
Section 7.3.22: RCC clock control & status register (RCC_CSR).
• External 32.768 kHz oscillator (LSE OSC): this is configured by the LSEON bit in the
RCC Backup domain control register (RCC_BDCR).
The ADC or DAC can also consume power during the Stop mode, unless they are disabled
before entering it. To disable them, the ADON bit in the ADC_CR2 register and the ENx bit
in the DAC_CR register must both be written to 0.
Note: Before entering Stop mode, it is recommended to enable the clock security system (CSS)
feature to prevent external oscillator (HSE) failure from impacting the internal MCU
behavior.
Table 29. Stop mode entry and exit (STM32F42xxx and STM32F43xxx)
Stop mode Description
Debug mode
By default, the debug connection is lost if the application puts the MCU in Stop or Standby
mode while the debug features are used. This is due to the fact that the Cortex®-M4 with
FPU core is no longer clocked.
However, by setting some configuration bits in the DBGMCU_CR register, the software can
be debugged even when using the low-power modes extensively. For more details, refer to
Section 38.16.1: Debug support for low-power modes.
5.3.7 Programming the RTC alternate functions to wake up the device from
the Stop and Standby modes
The MCU can be woken up from a low-power mode by an RTC alternate function.
The RTC alternate functions are the RTC alarms (Alarm A and Alarm B), RTC wakeup, RTC
tamper event detection and RTC time stamp event detection.
These RTC alternate functions can wake up the system from the Stop and Standby low-
power modes.
The system can also wake up from low-power modes without depending on an external
interrupt (Auto-wakeup mode), by using the RTC alarm or the RTC wakeup events.
The RTC provides a programmable time base for waking up from the Stop or Standby mode
at regular intervals.
For this purpose, two of the three alternate RTC clock sources can be selected by
programming the RTCSEL[1:0] bits in the Section 7.3.21: RCC Backup domain control
register (RCC_BDCR):
• Low-power 32.768 kHz external crystal oscillator (LSE OSC)
This clock source provides a precise time base with a very low-power consumption
(additional consumption of less than 1 µA under typical conditions)
• Low-power internal RC oscillator (LSI RC)
This clock source has the advantage of saving the cost of the 32.768 kHz crystal. This
internal RC oscillator is designed to use minimum power.
RTC alternate functions to wake up the device from the Stop mode
• To wake up the device from the Stop mode with an RTC alarm event, it is necessary to:
a) Configure the EXTI Line 17 to be sensitive to rising edges (Interrupt or Event
modes)
b) Enable the RTC Alarm Interrupt in the RTC_CR register
c) Configure the RTC to generate the RTC alarm
• To wake up the device from the Stop mode with an RTC tamper or time stamp event, it
is necessary to:
a) Configure the EXTI Line 21 to be sensitive to rising edges (Interrupt or Event
modes)
b) Enable the RTC time stamp Interrupt in the RTC_CR register or the RTC tamper
interrupt in the RTC_TAFCR register
c) Configure the RTC to detect the tamper or time stamp event
• To wake up the device from the Stop mode with an RTC wakeup event, it is necessary
to:
a) Configure the EXTI Line 22 to be sensitive to rising edges (Interrupt or Event
modes)
b) Enable the RTC wakeup interrupt in the RTC_CR register
c) Configure the RTC to generate the RTC Wakeup event
RTC alternate functions to wake up the device from the Standby mode
• To wake up the device from the Standby mode with an RTC alarm event, it is necessary
to:
a) Enable the RTC alarm interrupt in the RTC_CR register
b) Configure the RTC to generate the RTC alarm
• To wake up the device from the Standby mode with an RTC tamper or time stamp
event, it is necessary to:
a) Enable the RTC time stamp interrupt in the RTC_CR register or the RTC tamper
interrupt in the RTC_TAFCR register
b) Configure the RTC to detect the tamper or time stamp event
• To wake up the device from the Standby mode with an RTC wakeup event, it is
necessary to:
a) Enable the RTC wakeup interrupt in the RTC_CR register
b) Configure the RTC to generate the RTC wakeup event
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VOS FPDS DBP PLS[2:0] PVDE CSBF CWUF PDDS LPDS
Res. Reserved
rw rw rw rw rw rw rw w w rw rw
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VOS
BRE EWUP BRR PVDO SBF WUF
Res RDY Reserved Reserved
r rw rw r r r r
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ODSWE
UDEN[1:0] ODEN
Reserved N
rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VOS[1:0] ADCDC1 MRUDS LPUDS FPDS DBP PLS[2:0] PVDE CSBF CWUF PDDS LPDS
Res.
rw rw rw rw rw rw rw rw rw rw rw rc_w1 rc_w1 rw rw
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Table 31. PWR - register map and reset values for STM32F405xx/07xx and STM32F415xx/17xx
Offset Register
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
10
11
9
8
7
6
5
4
3
2
1
0
CWUF
PDDS
PVDE
FPDS
CSBF
LPDS
VOS
DBP
PWR_CR PLS[2:0]
0x000 Reserved Reserved
Reset value 1 0 0 0 0 0 0 0 0 0 0
VOSRDY
EWUP
PVDO
WUF
BRR
BRE
SBF
PWR_CSR
0x004 Reserved Reserved Reserved
Reset value 0 0 0 0 0 0 0
Table 32. PWR - register map and reset values for STM32F42xxx and STM32F43xxx
Offset Register
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
10
11
9
8
7
6
5
4
3
2
1
0
UDEN[1:0]
ODSWEN
ADCDC1
VOS[1:0]
MRUDS
LPUDS
Reserved
CWUF
ODEN
PDDS
PVDE
CSBF
FPDS
LPDS
DBP
PWR_CR PLS[2:0]
0x000 Reserved
Reset value 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0
UDRDY[1:0]
ODSWRDY
VOSRDY
ODRDY
EWUP
Reserved
PVDO
WUF
BRR
BRE
SBF
PWR_CSR
0x004 Reserved Reserved Reserved
Reset value 0 0 0 0 0 0 0 0 0 0 0
Refer to Section 2.3: Memory map for the register boundary addresses.