I'm testing GIC and ARM A53 connectivity. I can see that GIC is forwarding the IRQ request and ARM core has received it(shows in ISR reg). However, my IRQ handler is not getting called. Here is how I'm registering it..
void main () { ... __enable_irq(); ... } __irq void irqHandler(void) { printf("Hello from the IRQ handler\n"); ... }
void main () {
...
__enable_irq();
}
__irq void irqHandler(void) {
printf("Hello from the IRQ handler\n");
Does the SPSR_EL3 show that you came from EL3 with SP_EL3 selected? (I'm assuming yes, given the vector table entry you said you were at).
If yes, that I think something slightly different happened. Before the interrupt you took a different (synchronous) exception. Taking the exception set the mask bits, masking the later interrupt. As the vector table entry for the synchronous exception was a branch to self, the code looped forever.
It would be worth sanity checking what is actually in memory at the address pointed at by ELR_EL3. Also you could try setting a breakpoint just before the loop in your code, and stepping through a couple of iterations.
Yes, that is correct.
I stepped through iterations for loop in my code. Here's what happens:
1) Control hits loop. ISR = 0, ELR_EL3=0 and SPSR_EL3=0
2) I step for 3-4 iterations.
3) ISR = 0x80 (i.e. ISR.IRQ_PENDING =1)
4) I step once more.
5) ELR_EL3=<address of my loop>, SPSR_EL3=0x6000030D( i.e. A, C, Z, D_E = 1)
I can't figure out what is going wrong here. Thanks a lot for your effort and help.
The SPSR value looks as expected, and it looks like you took the IRQ. Meaning execution should have jumped to "VBAR_EL3 + 0x280", which is the IRQ vector for coming from same EL with ELx selected. But you see it jumpt to "VBAR_EL3 + 0x200" when you stepped to (5)?
Hi Martin. Finally got it working! I was missing a "ALIGN 128" directive at starting of the vector table(as you can see in the code snippet above). It was your last reply that hinted me to check.
Thanks a lot for walking me through this.