The Cortex-M4 Processor
ARM DUI 0553A
Copyright © 2010 ARM. All rights reserved.
2-32
ID121610
Non-Confidential
2.5
Power management
The Cortex-M4 processor sleep modes reduce power consumption. The sleep modes your
device implements are implementation-defined. The modes can be one or both of the following:
•
sleep mode stops the processor clock
•
deep sleep mode stops the system clock and switches off the PLL and flash memory.
If your device implements two sleep modes providing different levels of power saving, the
SLEEPDEEP bit of the SCR selects which sleep mode is used, see
. For more information about the behavior of the sleep modes see the documentation
supplied by your device vendor.
This section describes the mechanisms for entering sleep mode, and the conditions for waking
up from sleep mode.
2.5.1
Entering sleep mode
This section describes the mechanisms software can use to put the processor into sleep mode.
The system can generate spurious wakeup events, for example a debug operation wakes up the
processor. Therefore software must be able to put the processor back into sleep mode after such
an event. A program might have an idle loop to put the processor back to sleep mode.
Wait for interrupt
The
Wait For Interrupt
instruction,
WFI
, causes immediate entry to sleep mode unless the
wake-up condition is true, see
Wakeup from WFI or sleep-on-exit
processor executes a
WFI
instruction it stops executing instructions and enters sleep mode. See
for more information.
Wait for event
The
Wait For Event
instruction,
WFE
, causes entry to sleep mode depending on the value of a
one-bit event register. When the processor executes a
WFE
instruction, it checks the value of the
event register:
0
The processor stops executing instructions and enters sleep mode.
1
The processor clears the register to 0 and continues executing instructions without
entering sleep mode.
for more information.
If the event register is 1, this indicates that the processor must not enter sleep mode on execution
of a
WFE
instruction. Typically, this is because an external event signal is asserted, or a processor
in the system has executed an
SEV
instruction, see
. Software cannot access
this register directly.
Sleep-on-exit
If the SLEEPONEXIT bit of the SCR is set to 1, when the processor completes the execution of
all exception handlers it returns to Thread mode and immediately enters sleep mode. Use this
mechanism in applications that only require the processor to run when an exception occurs.