Post Go back to editing

NMI and the SSL:adi_int_CECHook, where's the RTN?

Hi

  I'm using the SSL (but not VDK) and successfully so far.  I've reached the point where I'd like to implement the Power-Failure handling and so I'm trying to hook the NMI.

1)  I can't find any description of the NMI pin's behaviour (is it level or edge sensitive?)  Does the handler have to take any action to clear the interrupt and prime it ready for the next NMI?  If the NMI signal is, say 10ms long, can the handler complete and return, before the NMI returns to it's inactive level, without another NMI occuring immediately?

2) Is  adi_int_CECHook() the way to get access to the NMI events?   It certainly works to hook the interrupt and my supplied handler routine (ending with an RTS as descibed) returns to the SSL.  However tracing through the SSL, after an NMI event with the debugger, does not show any RTN instruction and the code never returns to the address it was interrupted out of.   I can see where it came from using the Trace feature and I can see the correct return address in RETN.

3) Should the NestingFlag parameter of adi_int_CECHook be TRUE of FALSE?  What effect will it have on NMI?

FYI: I'm using VDSP 5.0 Update 7. on a BF534, debugging with a HP_USB ICE.

Regards,

Colin Moloney.

  • the datasheet describes NMI signal behavior

    the PRM is pretty clear wrt nesting.  only interrupts (IVG5 - IVG15) can be nested.

  • By datasheet I have to assume you mean "ADSP-BF537 Blackfin Processor Hardware Reference.pdf"

    It only says, quote:

        "It should be noted that emulation, reset, NMI, and exception events, as
        well as hardware error (IVHW) and core timer (IVTMR) interrupt requests,
        enter the interrupt processing chain at the ILAT level and are not affected
        by the system-level interrupt registers (SIC_IWR, SIC_ISR, SIC_IMASK,
        SIC_IARx)."

    While this is rather cryptic, it doesn't relate to the pin behaviour. The rest is related to the watchdog's use of NMI.

    Or "ADSP-BF531_BF532_BF533.pdf" which says, quote:

        "Nonmaskable Interrupt (NMI) – The NMI event can be
        generated by the software watchdog timer or by the NMI
        input signal to the processor. The NMI event is frequently
        used as a power-down indicator to initiate an orderly shut-
        down of the system."

    and

       "NMI I Nonmaskable Interrupt (This pin should be pulled low when not used.)"

    What is a 'PRM' ?  Oh..., is it a programmer's reference manual?

    The "Blackfin Processor Programming Reference, Revision 1.3 (Sep 2008)"  says:

        "If an exception occurs in an event handler that is already servicing
        an Exception, NMI, Reset, or Emulation event, this will trigger a
        double fault condition, and the address of the excepting instruction
        will be written to RETX."

    which obviously means don't nest them, which is why I'm asking about the pin behaviour and how to cope with a long extended NMI assertion and not end up nesting.

    It also discusses how the CEC provides edge sensivity for IVG7..IVG15 but not what the lower ones do.

    Got it! In the "errata for Rev 1.3":

    Chapter: 4 Page: 48
    Reference Number: 40253
    Change
    The last paragraph on the page describing the NMI input pin should include this information:
    The NMI pin is level-sensitive and should always be pulled to its deasserted state if unused. On some derivatives, the NMI input is active high and on some it is active low. Please refer to the specific data sheet for your processor.

    Does this mean that if the NMI assertion is very long, each RTN from the handler will immediately call back into the NMI handler until the NMI goes away?

    I gather that saying "only interrupts (IVG5 - IVG15) can be nested" is answering "no"

    to my question "Is  adi_int_CECHook() the way to get access to the NMI events?"

    The "Device Drivers and System Services Manual for Blackfin Processors (50_dd_ss_proc_man_rev4.0.pdf)" says, quote:

        "In systems that employ Blackfin processors, often there are more potential
        interrupt sources than IVG levels. As stated above, some events (such as
        NMI) map one-to-one to an IVG level. Other events, typically infrequent
        interrupts such as peripheral error interrupts, are often “ganged” in a sin-
        gle IVG level.
        The interrupt manager allows the application to execute complete control
        over how interrupts are handled, whether they are masked or unmasked,
        whether they mapped one-to-one or ganged together, whether the proces-
        sor should be awakened to service an interrupt, and so on"...

    which kind of implies I should use the interrupt manager of the SSL and thence

    adi_int_CECHook() to access the NMI event.

    I gather then that I should re-write the Event Vector Register to my own NMI handler and do the RTN myself?

  • You are correct, there is an issue with the current SSL Interrupt Manager and its handling of NMI.

    The SSL Interrupt Manager allows you to hook IVG2 (NMI). The primary handler returns with an RTI, however, and needs to be modifed such that it returns with an RTN. The SSL Interrupt Manager will be modified in a fture release to address this issue.

    In the meantime, you will need to manage EVT2 outside of the Interrupt Manager Service.

  • This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin