The Cortex-M4 Processor
ARM DUI 0553A
Copyright © 2010 ARM. All rights reserved.
2-33
ID121610
Non-Confidential
2.5.2
Wakeup from sleep mode
The conditions for the processor to wakeup depend on the mechanism that cause it to enter sleep
mode.
Wakeup from WFI or sleep-on-exit
Normally, the processor wakes up only when it 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 it executes an interrupt handler. To achieve this set the
PRIMASK bit to 1 and the FAULTMASK bit to 0. 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 sets PRIMASK to zero. For more information about
PRIMASK and FAULTMASK see
Wakeup from WFE
The processor wakes up if:
•
it detects an exception with sufficient priority to cause exception entry
•
it detects an external event signal, see
•
in a multiprocessor system, another processor in the system executes an
SEV
instruction.
In addition, if the SEVONPEND bit in the SCR is set to 1, 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 the SCR see
.
2.5.3
The optional Wakeup Interrupt Controller
Your device might include a
Wakeup Interrupt Controller
(WIC), an optional peripheral that can
detect an interrupt and wake the processor from deep sleep mode. The WIC is enabled only
when the DEEPSLEEP bit in the SCR is set to 1, see
.
The WIC is not programmable, and does not have any registers or user interface. It operates
entirely from hardware signals.
When the WIC is enabled and the processor enters deep sleep mode, the power management unit
in the system can power down most of the Cortex-M4 processor. This has the side effect of
stopping the SysTick timer. When the WIC receives an interrupt, it takes a number of clock
cycles to wakeup the processor and restore its state, before it can process the interrupt. This
means interrupt latency is increased in deep sleep mode.
Note
If the processor detects a connection to a debugger it disables the WIC.
2.5.4
The external event input
Your device might include an external event input signal, so that device peripherals can signal
the processor, to either:
•
wake the processor from WFE
•
set the internal WFE event register to one to indicate that the processor must not enter
sleep mode on a later
WFE
instruction.