ARM Technical Support Knowledge Articles

Difference of behavior between Cortex-M7 and Cortex-M3/M4 or Cortex-M33 around event registering when in SLEEP mode.

Applies to: Cortex-M3, Cortex-M33, Cortex-M4, Cortex-M7

Answer

WFE (and WFI) should always be placed in a loop which will allow correct operation if the processor wakes up unexpectedly. The processor can wake up unexpectedly for various reasons - for example, if an RXEV pulse has already been received before the WFE command is executed, or if a Debug event takes place while the processor is asleep.

There is a slight difference between the Cortex-M3/M4 or Cortex-M33 and Cortex-M7 with regard to the registering of the events when the processor is sleeping. For the Cortex-M3/M4 or Cortex-M33, if the processor is in SLEEP mode when the event occurs, it doesn't register the event since the event is consumed in the wake up event, whereas for Cortex-M7 the event both wakes up the processor and sets the event register.

Cortex-M3/M4 or Cortex-M33
--------------------------------
- Processor is in SLEEP mode
- RXEV input is asserted
- Processor exits SLEEP mode and the event register is CLEAR
- Execution continues with no further event taking place
- If another WFE instruction is executed, the processor enters SLEEP mode again

Cortex-M7
------------
- Processor is in SLEEP mode
- RXEV input is asserted
- Processor exits SLEEP mode and the event register is SET
- Execution continues with no further event taking place
- If another WFE instruction is executed, the processor DOES NOT enter SLEEP mode but the event register now becomes CLEAR

The behavior of Cortex-M7 regarding the event register is within the limits of what's defined in the ARMv7-M ARM. This should not cause any real problem as long as the software follows the guideline in putting WFE in a loop.

Article last edited on: 2016-11-11 14:50:30

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential