You copied the Doc URL to your clipboard.

Difference of behavior between various Cortex-M processors around event registering when in SLEEP mode

Article ID: 103489484

Published date: 10 Apr 2018

Last updated: -

Applies to: Cortex-M

Question

How do various Cortex-M processors behave for event registering when in SLEEP mode?

Answer

WFE and WFI should always be placed in a loop which allows 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-M0, Cortex-M0+, Cortex-M3, Cortex-M4, and Cortex-M33 compared to Cortex-M23 and Cortex-M7 with regard to the registering of the events when the processor is sleeping.

Cortex-M0, Cortex-M0+, Cortex-M3, Cortex-M4, and Cortex-M33

If any of these processors are in SLEEP mode when the event occurs, they do not register the event because the event is consumed in the wake up event.

  • 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-M23 and Cortex-M7

However, for the Cortex-M23 and Cortex-M7 processors, the event both wakes up the processor and sets the event register.

  • 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-M23 and Cortex-M7 regarding the event register is within the limits of what is defined in the ARMv7 Architecture Reference Manual and Arm8-M Architecture Reference Manual. This should not cause any significant issues as long as the software follows the guideline of putting WFE in a loop.

Related information

N/A

Was this page helpful? Yes No