Search code examples
interruptinterrupt-handlingcortex-m

cortex-m: where is exception number of interrupted interrupt stored


For NVIC to be able to compare priorities it needs to know them.

That seems simple at first (it can get them from exception number; exception number of current interrupt is in SCB->ICSR bits [5:0]) but what happens when interrupt is interrupted? Where is exception number (or priority) of interrupted interrupt stored?

I've checked Yiu's book but can't find the answer there.


Solution

  • The Interrupt Program Status register contains "contains the exception type number of the current Interrupt Service Routine (ISR)" according to the ARM documentation.