Bird
0
0

An engineer writes this code to enter deep sleep:

medium📝 Analysis Q6 of 15
ARM Architecture - Power Modes
An engineer writes this code to enter deep sleep:
    MRS R0, SCR
    ORR R0, R0, #0x2
    MSR SCR, R0
    WFI
Why might this fail to enter deep sleep mode?
AMSR instruction is invalid
BWFI instruction is missing
CThe wrong bit (0x2) is set; SLEEPDEEP is bit 2 (0x4)
DSCR register cannot be read
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct SLEEPDEEP bit

    SLEEPDEEP is bit 2 (value 0x4), not bit 1 (0x2).
  2. Step 2: Analyze code's bit set

    Setting 0x2 sets the wrong bit, so deep sleep mode is not enabled.
  3. Final Answer:

    The wrong bit (0x2) is set; SLEEPDEEP is bit 2 (0x4) -> Option C
  4. Quick Check:

    Correct bit = 0x4, not 0x2 = D [OK]
Quick Trick: SLEEPDEEP bit is 0x4, not 0x2 [OK]
Common Mistakes:
  • Setting wrong bit for deep sleep
  • Forgetting to execute WFI
  • Assuming SCR is write-only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes