Decoding Exception Entry & Exit on ARM Cortex-Mx
dev.to·9h·
Discuss: DEV
📊Linux Perf Events
Preview
Report Post

Introduction: Why This Post Exists

Interrupt handling on ARM Cortex-Mx looks simple on paper, but becomes confusing the moment you open a debugger. You see:

  • PC value changes mysteriously
  • registers appearing in stack memory
  • LR holding strange values like 0xFFFFFFFD
  • and some registers never showing up on the stack

This post breaks down what the hardware actually does, what the compiler does, and what the debugger hides, using real debugging screenshots and memory inspection.

ARM Cortex-M Exception Model

Before diving into stack dumps and registers, it’s important to understand one thing: On Cortex-Mx, exception entry and exit are largely hardware-controlled. The CPU:

  • decides when an interrupt is taken
  • saves a fixed architectural context
  • switches modes and s…

Similar Posts

Loading similar posts...