This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Omap-L138 NMI interrupt service routine

Other Parts Discussed in Thread: OMAP-L138

All:

Does the compiler handle "register preservation" on non-maskable interrupt (NMI) for the OMAP-L138?

I am just starting, but it looks like I am not returning from the nmiIsr.

Prior to getting the interrupt, an FPGA sends the NMI to active low condition. The line "Clear NMI driver" will take that active low condition away.

interrupt void nmiIsr(void)
{
   // Set flag.
   nmi_occurred = 1;

   // Clear NMI driver.
   DSP_INT_CLR = 0;
}

Again, do I need to add anything to my ISR to get NMI to work? (I may need to add delay to make sure NMI is not active when I return from the interrupt, but other than that, I am not sure if there is additional ISR code that needs to be added. Some of the documentation hints that there may be additional items...)

 

 

  • I think I found an answer - in an unlikely spot: dsp_exception.c

        /* Note: The NMI/exception handler in StarterWare is defined with the
         * "interrupt" keyword, which means it will try to return to the pointer
         * stored in IRP. Exceptions need to return to NRP instead, so we can
         * "trick" the ISR into branching to the correct return location by copying
         * NRP into IRP. This would cause problems if the exception occurred while
         * an interrupt was already being processed. */
        IRP = NRP;

        /* Use NTSR value for ITSR (see note above) */
        ITSR = NTSR;

    By adding these two instructions to the end of my nmiIsr, I was able to return to the place where the interrupt occurred.

    Question: Does this make sense?

  • Todd,

    Let me have a look at it and get back.
  • Any further information regarding the interrupt service routine for non-maskable interrupt?
  • Hi Todd,

    Sorry for my delayed response as I was held up with some other work.

    Looked into the function, "exception_isr()" in dsp_exception.c and infact ran through the exeption example.
    Your understanding is right.

    Actually the exceptions needs to be returned to NRP and the value of NTSR should be used. as stated in the note, since it is defined with interrupt keyword, it will return to IRP. That's the reason, there is aneccessity to copy the NRP and NTSR.

    Please revert if there are any further questions.