Spurous Interrupt

Discussion to talk about software related topics only.
Post Reply
roland.ames

Spurous Interrupt

Post by roland.ames »

From the processor (5234, 5270, 5282) manual:

If an interrupt source is being masked in the interrupt controller mask
register (IMR) or a module’s interrupt mask register while the
interrupt mask in the status register (SR) is set to a value lower than
the interrupt’s level, a spurious interrupt may occur. This is because by
the time the status register acknowledges this interrupt, the interrupt
has been masked. A spurious interrupt is generated because the CPU
cannot determine the interrupt source. To avoid this situation for
interrupts sources with levels 1-6, first write a higher level interrupt
mask to the status register, before setting the mask in the IMR or the
module’s interrupt mask register. After the mask is set, return the
interrupt mask in the status register to its previous value. Since level 7
interrupts cannot be disabled in the status register prior to masking,
use of the IMR or module interrupt mask registers to disable level 7
interrupts is not recommended.


The SetIntc() library routine does NOT comply to this behaviour.

The lines from bsp.c in the setintc function

sim.intc[intc].imrh |= mask;

should be

UCOS_ENTER_CRITICAL();
sim.intc[intc].imrh |= mask;
UCOS_EXIT_CRITICAL();

similarly for imrl

Any other library source code that set bits in sim.intc[].imr or sim.intc[].imh also should be bracketed by UCOS_ENTER_CRITICAL(); and UCOS_EXIT_CRITICAL();

The same applies for accesses to the interrupt mask bits in each module that can generate interrupts.



I have worked around this by
USER_ENTER_CRITICAL();
SetIntc(....);
USER_EXIT_CRITICAL();
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: Spurous Interrupt

Post by tod »

Did you open a ticket on this with tech support? While I know several of the NB team try to monitor this forum, it appears that when they get busy, a lot of posts don't get noticed by them.
roland.ames

Re: Spurous Interrupt

Post by roland.ames »

tod wrote:Did you open a ticket on this with tech support? While I know several of the NB team try to monitor this forum, it appears that when they get busy, a lot of posts don't get noticed by them.
No I did not open a tech support ticket, at the time, my support ticket had already expired, and I had a workaround.

I only posted this info for other people who may have had problems, and in the hope that someone from NB would look at it and make some comment or maybe change any future releases.

Similarly for viewtopic.php?f=5&t=1117
Post Reply