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.

DSP/BIOS 6 and NMI

Other Parts Discussed in Thread: SYSBIOS

Hello,

 

How do I use the NMI with DSP/BIOS 6?

Is there a special event ID for it?

 

Thanks,

Arya.

  • Arya,

    Which device family are you using? C2800?

    Regards,

    Shreyas

  • C6000 (Specifically, C6472)

  • Arya,

    The C6000 NMI interrupt (intId = 1) cannot be plugged directly using the ti.sysbios.family.c64p.Hwi module because this interrupt is internally used by BIOS for exception handling via the ti.sysbios.family.c64p.Exception module. You will get an error if you attempt to use this interrupt using the Hwi module.

    However, you can harness the Exception module to call your own function to be called when an NMI interrupt is received.  The Exception module determines the reason for the NMI.  If it's an exception, the details of the exception will be printed (i.e. register dump and reason for the exception).  If it is an NMI interrupt, the user's 'nmiHook' function will be called.

    You can add the following code to your application's .cfg file to accomplish this:

        var Exception = xdc.useModule('ti.sysbios.family.c64p.Exception');

        Exception.nmiHook = '&myNmiHookFxn';

    Regards,

    Shreyas

  • Note: the previous post was edited.

    Shreyas

  • Hi Shreyas,

    I have a similar question for you.

    I'm using SYSBIOS 6.40 with the TMS320F28377.  

    I understand from the API reference guide, (and a similar theme from your post) that: 

    "On the C28x, DSP/BIOS does not support returning from an NMI interrupt when the PIE is enabled and
    other interrupts are using the dispatcher." 

    This explains behaviour that I see in my code.   I try to Force an NMI (while I'm in a Timer 0 Swi) and then clear it.  However, I can't return to my code.  I either go to "void abort(void)" in "Exit.c" or I get a message - I forget exactly what the message says but it contain an address.   

    If an NMI occurs I would like to detect it and shutdown my system hardware in a safe manner and do some logging functions before the software exits.    

    So you pretty much answered the question for the C6000 family.  How do I call some code to shutdown and log stuff if an NMI occurs on the 28377 architecture with SYSBIOS?  Also, is there any application code or documentation that I can follow?

    Thanks,

    Rick