AnsweredAssumed Answered

What happens when an interrupt occurs?  (KV10 - Thumb Processor)

Question asked by Michael Liebert on Sep 23, 2016
Latest reply on Sep 25, 2016 by xiangjun.rong

More specifically where do I go to learn about what the processor does when it recognizes an enabled interrupt?


I'm using a FRDM-KV10Z so my first choice reference is the KV10 Sub-Family Reference Manual.  But there's not much in there that I see about interrupts.  It refers one to the ARM Cortex-M0+ Technical Reference Manual for a "full description" of the NVIC.  But the full description turns out to be a few mostly blank pages with a reference to the ARMv6-M Architecture
Reference Manual.  The problem here is that this document seems to be describing ARM architecture rather than Thumb architecture.


My understanding is that the KV10 is Thumb only.  Assuming this to be true I'd like to know how this Thumb processor reacts when it acknowledges an interrupt. What gets saved where?  Are further interrupts disabled and if they are, how can I re-enable within the interrupt handler?  What does the processor do when it returns from an interrupt?  Why don't I have to somehow acknowledge an interrupt?


Also please consider this disassembly of the entry point of some 'C' code I have written to process a UART interrupt:


00000648:   push {r3, r4, r7, lr}
0000064a:   add r7, sp, #0
 165          s1 = *UART0_S1&0xaf;
0000064c:   ldr r3, [pc, #96]       ; (0x6b0 <UART0_IRQHandler+104>)
0000064e:   ldr r3, [r3, #0]
00000650:   ldrb r3, [r3, #0]
00000652:   movs r2, #80    ; 0x50
00000654:   bics r3, r2
00000656:   uxtb r4, r3


What I see here is that four registers are being saved, but r2 is not one of them; and r2 is being modified.  What is going on here?


Thanks in advance for any replies.