Arm Cortex Processor Sleep Modes
435
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Power Control Manager (PCM)
8.7.1 WFI, Wait for Interrupt
The WFI (wait for interrupt) instruction suspends code execution immediately. To wake from sleep
following a WFI execution, the following conditions must occur:
•
If the priority mask register is cleared (PRIMASK = 0) and an interrupt request occurs with its priority
higher than the current base priority (BASEPRI), the interrupt causes the processor to wake from sleep
and interrupt execution to occur. If the interrupt request priority is lower than the current base priority,
the processor remains asleep and no interrupt execution takes place.
•
If the priority mask register is set (PRIMASK = 1) and an interrupt request occurs with its priority higher
than the current base priority (BASEPRI), the interrupt causes the processor to wake from sleep but
the interrupt request is not serviced. If the interrupt request priority is lower than the current base
priority, the processor remains asleep and no interrupt execution takes place.
8.7.2 WFE, Wait for Event
The WFE (wait for event) instruction suspends code execution immediately if the event latch is cleared. If
the event latch is set when a WFE execution occurs, the event latch is cleared and the processor
continues with the next instruction. The wake from sleep following WFE execution depends also on the
SEVONPEND bit in the SCR register. When SEVONPEND = 0, only enabled interrupts or events can
wake the processor. Disabled interrupts are excluded. When SEVEONPEND = 1, enabled events and all
interrupts, including disabled interrupts, can wake the processor. To wake from sleep following a WFE
execution, the following conditions must occur:
If SEVONPEND = 0:
•
If the priority mask register is cleared (PRIMASK = 0) and an interrupt request occurs with its priority
higher than the current base priority (BASEPRI), the interrupt causes the processor to wake from sleep
and interrupt execution to occur. If the interrupt request priority is lower than the current base priority,
the processor remains asleep and no interrupt execution takes place.
•
If the priority mask register is set (PRIMASK = 1) and an interrupt request occurs with its priority higher
than the current base priority (BASEPRI), the interrupt causes the processor to wake from sleep but
the interrupt request is not serviced. If the interrupt request priority is lower than the current base
priority, the processor remains asleep and also no interrupt execution takes place.
If SEVONPEND = 1:
•
If the priority mask register is cleared (PRIMASK = 0), any interrupt (enabled or disabled) causes the
processor to wake from sleep. Only interrupt requests higher than the current base priority (BASEPRI)
cause interrupt execution to occur.
•
If the priority mask register is set (PRIMASK = 1), any interrupt (enabled or disabled) causes the
processor to wake from sleep. No interrupt execution takes place.
8.7.3 Sleep on Exit
Arm has a mode that allows the processor to automatically go back to sleep after an ISR completes.
Setting SLEEPONEXIT = 1 in the System Control Register (SCR) causes the processor to go back to
sleep when the interrupt service routine of the lowest pending priority interrupt completes. This allows the
processor to be active only when an interrupt request is to be serviced.
8.7.4 SLEEPDEEP
The SCR contains a bit called SLEEPDEEP. This bit is used by Arm to differentiate a normal sleep
(SLEEPDEEP = 0) and a deep sleep (SLEEPDEEP = 1). From the processor perspective, either setting
causes the processor to enter a sleeping state upon sleep entry. However, these settings can be used by
the rest of the system to optimize power under different scenarios. Similarly, the PCM uses these bits to
differentiate LPM0, LPM3, and LPM4 modes. When the application intends to put the device in LPM3 and
LPM4 modes, it must ensure that the SCR register is programmed before executing WFI or WFE.
8.8
Power Mode Requests
The PCM Control 0 (PCMCTL0) register is the primary mechanism for changing power modes. The
PCMCTL0 contains two fields: