Hello,
I need expert’s suggestions on usage of Non maskable interrupt (NMI) in TMS320C6748 DSP and CPU reset (exception) we observed when NMI is triggered.
Platform: TMS320C6748
CPU clock: 450MHz
Compiler optimization: -O3
Code location: External SDRAM, cached to L1.
In platform, we have utilized DSP NMI pin to connect external device to generate interrupt after periodic intervals, so it means we are using NMI as a functional interrupt. NMI ISR has small implementation to start UPP peripheral for data capture.
Under normal execution (I will say idle condition), NMI interrupt works perfectly without any issue. But we see abrupt DSP reset when NMI interrupts code piece which is doing some mathematical operations in a loop. We tried to debug this issue with the help of exception registers, but couldn’t find anything, as NMI and Exceptions share same interrupt vector.
Following is the code piece where NMI interrupt works fine,
.
.
.
While (execute_pending_task())
{}
.
.
Following is sample code piece, which when interrupted by NMI, causes DSP reset,
.
.
float mean = Get_Mean_Over_Float_Vector(pData, sampleCount);
float x = ((mean*y) / offset) * (1 - fastA);
.
.
We need help on this scenario, and here are our questions,
- Is it recommended to use NMI interrupt as a functional interrupt in embedded application?
- Can we use NMI interrupt and Exceptions same time, and identify cause of interrupt/Reset using EFR, IERR registers?
- Does interruption to software pipeline (SPLOOP) instructions by NMI can cause some un-desired behavior? And if Yes, is there any precaution/implementation we need to have in place to avoid this situation?
- Can the interrupt latency and variation in latency of normal interrupts be brought down to similar levels as for NMI interrupt latency and variation in latency (e.g. by using compiler options such as --interrupt_threshold)?
We observed typical latencies of ~500 nano seconds for NMI interrupt and ~1 micro seconds latencies for normal interrupts when CPU is clocked at 450MHz.
Thank you.
Shri