This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Getting started on Cortex A5 interrupts

I'm new to Cortex A5 and I'm trying to figure out how the interrupts work.

From my understanding, the Cortex A5 starts in secure mode and I don't change it. Now I set up the "secure interrupt controller" (of course only accessible in secure mode) and let it fire an FIQ interrupt. Now, from within the interrupt, should I be able to talk to the "secure interrupt controller", or does that require changing the SCR first, so the FIQ gets me to "monitor mode" instead? Is there any way to access secure peripherals from within FIQs?

Parents Reply Children
  • This is a diagram we use in training to explain this idea:

    Example_interrupt_routing.png

    Consider a couple of scenarios.  First the two easy ones:

    1) You are in Non-secure state and receive a Non-secure interrupt (IRQ).  We want to enter IRQ mode, and handle the interrupt normally.  So while in Non-secure state we want SCR.IRQ==0.

    2) You are in Secure state and receive a Secure interrupt (FIQ).  We want to enter FIQ mode, and handle the interrupt normally. So while in Secure state we want SCR.FIQ==0.

    Now for a trickier one:

    3) You are in Non-secure state and receive a Secure interrupt (FIQ).  We want to enter _Secure_ FIQ mode in order to deal with the interrupt.  But in order to do this, we first need to enter Monitor mode in order to do the world switch.  To achieve this we set SCR.FIQ==1 while in Non-secure state.