Download Cortex-M0 Devices Generic User Guide

Transcript
The Cortex-M0 Processor
See WFE on page 3-59 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 of the assertion of an external
event signal, or, in a multiprocessor system, because another processor has executed an
SEV instruction, see SEV on page 3-57. 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 an exception handler and returns to Thread mode it immediately enters
sleep mode. Use this mechanism in applications that only require the processor to run
when an interrupt occurs.
2.5.2
Wakeup from sleep mode
The conditions for the processor to wakeup depend on the mechanism that caused 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. 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, see
Exception mask register on page 2-8.
Wakeup from WFE
The processor wakes up if:
ARM DUI 0497A
ID112109
•
it detects an exception with sufficient priority to cause exception entry
•
it detects an external event signal, see The external event signal on page 2-30
•
in a multiprocessor system, another processor in the system executes an SEV
instruction.
Copyright © 2009 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
2-29