Hi Chris
- The Rx interrupt is putting characters into the receive buffer - it can cause an XOFF to be sent if the buffer were getting full but I don't think that this is happening since the throughput is high (especially to the USB link). [This is something that I will look into though]
- I have just compared the data recording of the last error case with the one posted on the other forum. It does look to be the same in the UART0 Tx sense but a bit different in the other direction (but still similar).
- The UART speed is 115k (USB speed virtual). I can't go higher with the terminal emulator but I could go lower.
I just did a 'standard' Spurious interrupt test and the result is not good:
1) I removed the UART driver, disconnected USB and Ethernet cables so that they didn't generate any interrupts and started a 50us interrupt from PIT1 with Level 1/priority 5. This means that only this and a 50ms TICK on PIT0 are active.
2) After this was started I put the code into a forever loop:
while (1) { IC_IMRH_0 |= (PIT_1_PIF_INT_H); // mask interrupt source IC_IMRH_0 &= ~(PIT_1_PIF_INT_H); // unmask interrupt source }
This is doing exactly that which one must avoid and it does indeed cause a spurious interrupt to take place within quite a short time.
3) These are the results:
SP = 2104 (reflecting the PIT1 interrupt level as expected !)
The values saved on entry to the spurious interrupt routine:
IC_IPRH_0 = 0x01000000 (as expected showing the PIT1 pending !)
IC_IPRL_0 = 0x00000000
IC_IMRH_0 = 0xff7fffff (as expected showing that the mask is set, causing the spurious interrupt)
IC_IMRL_0 = 0xf77ffffc
IC_IRLR_0 = 0
IC_IACKLPR_0
IC_SWIACK_0
IC_L1IACK_0..IC_L7IACK_0 = 0x18
The values displayed by the debugger after it has run the while for a short time
IC_IPRH_0 = 0x01800000 (PIT0, the system TICK, has now fired too)
IC_IPRL_0 = 0x00000000
IC_IMRH_0 = 0xff7fffff
IC_IMRL_0 = 0xf77ffffc
IC_IRLR_0 = 0
IC_IACKLPR_0
IC_SWIACK_0x77 (the PIT0 waiting)
IC_L1IACK_0 = 0x18
IC_L2IACK_0 = 0x77 (PIT0 is at level 2)
IC_L3IACK..IC_L7IACK_0 = 0x18
I repeated with the UART driver active and sending a test message just before the while was entered. The result was the same apart from the fact that the debugger showed the UART0 TX DMA interrupt pending too in the debug register view.
Therefore this shows the mechanism involved in the stress test case not to be a typical spurious interrupt based on the fact that the spurious interrupt is almost certainly originating from the UART Rx (level corresponds) but the interrupt is not pending when it happens.
Any possible explanations???
Regards
Mark