This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

WFE/WFI and pending interrupts?

I'd like to know the behavior of WFE and WFI regarding pending interrupts that occur prior to these instructions, on 2 different Cortex profiles.  In both cases, the goal is to ensure any incoming interrupt will cause a wake-up when interrupts are masked/disabled.

- With Cortex-M and PRIMASK=1, BASEPRI=0, and SEVONPEND=1, when is the Event latch/register is set or cleared for pending interrupts before a WFE?  In other words, is it ok to always leave SEVONPEND set or should it only be set just prior to WFE?


- With Cortex-A and interrupts disabled (CPSR.I=1), will interrupts that become pending prior to a WFI prevent it from suspending execution or does the interrupt have to occur after the WFI instruction has been executed to cause a wake-up event?

Thanks in advance!

Parents
  • ( When interrupts are disabled and then the WFI is executed.)

    In Cortex A series WFI would be executed  and the processor would enter the standby mode.

    Interrupts which are pending would not prevent processor to suspend execution.

    When the processor is in WFI and an interrupt occurs:
    This wakes up the processor  and the processor jumps to the interrupt handler associated with that interrupt.

    But when CPSR.I is disabled  this just wakes up the processor  and the processor starts executing the next instruction from the program counter.

Reply
  • ( When interrupts are disabled and then the WFI is executed.)

    In Cortex A series WFI would be executed  and the processor would enter the standby mode.

    Interrupts which are pending would not prevent processor to suspend execution.

    When the processor is in WFI and an interrupt occurs:
    This wakes up the processor  and the processor jumps to the interrupt handler associated with that interrupt.

    But when CPSR.I is disabled  this just wakes up the processor  and the processor starts executing the next instruction from the program counter.

Children