Power Management
115
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Cortex
®
-M4F Processor
1.8.1 Entering Sleep Modes
This section describes the mechanisms software can use to put the processor into one of the sleep
modes.
The system can generate spurious wake-up 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.
1.8.1.1
Wait for Interrupt
The wait for interrupt instruction, WFI, causes immediate entry to sleep mode unless the wake-up
condition is true (see
). When the processor executes a WFI instruction, it stops executing
instructions and enters sleep mode. See the Cortex-M4 instruction set chapter in the
for more information.
1.8.1.2
Wait for Event
The wait for event instruction, WFE, causes entry to sleep mode conditional on the value of a 1-bit event
register. When the processor executes a WFE instruction, it checks the event register. If the register is 0,
the processor stops executing instructions and enters sleep mode. If the register is 1, the processor clears
the register and continues executing instructions without entering sleep mode.
If the event register is 1, the processor must not enter sleep mode when a WFE instruction is executed.
Typically, this situation occurs if an SEV instruction has been executed. Software cannot access this
register directly.
See the Cortex-M4 instruction set chapter in the
Arm Cortex-M4 Devices Generic User Guide
for more
information.
1.8.1.3
Sleep-on-Exit
If the SLEEPEXIT bit of the SYSCTRL register is set, when the processor completes the execution of all
exception handlers, it returns to Thread mode and immediately enters sleep mode. This mechanism can
be used in applications that only require the processor to run when an exception occurs.
1.8.2 Wake Up From Sleep Mode
The conditions for the processor to wake up depend on the mechanism that caused it to enter sleep
mode.
1.8.2.1
Wake Up From WFI or Sleep-on-Exit
Normally, the processor wakes up only when the NVIC detects an exception with sufficient priority to
cause exception entry. Some embedded systems might have to execute system restore tasks after the
processor wakes up and before executing an interrupt handler. Entry to the interrupt handler can be
delayed by setting the PRIMASK bit and clearing the FAULTMASK bit. If an interrupt arrives that is
enabled and has a higher priority than current exception priority, the processor wakes up but does not
execute the interrupt handler until the processor clears PRIMASK. For more information about PRIMASK
and FAULTMASK, see and .
1.8.2.2
Wake Up From WFE
The processor wakes up if it detects an exception with sufficient priority to cause exception entry.
In addition, if the SEVONPEND bit in the SYSCTRL register is set, any new pending interrupt triggers an
event and wakes up the processor, even if the interrupt is disabled or has insufficient priority to cause
exception entry. For more information about SYSCTRL, see
.
1.9
Instruction Set Summary
The processor implements a version of the Thumb instruction set.
lists the supported
instructions.