I am new to ARM development, and have been looking into an odd behavior in a legacy product which uses LPC1837. The USB0 ISR processes ENDPTCOMPLETE but sometimes it is not set at the end of a USB transaction (or there was no interrupt), e.g. SetConfiguration. In the ISR, USB0 interrupt is disabled like this:
Then before leaving the ISR, it is reenabled:
I took USB traces and found no pattern to explain why ENDPTCOMPLETE is sometimes not set. As far as I know, this has only happened during IN transactions. Moving the USB device to a different USB port, or adding an extension USB cable, or adding a hub in between the host and the device could make the problem go away.
Could ENDPTCOMPLETE be affected by the disabling of the IRQ? What is the expected behavior of when ENDPTCOMPLETE is set? Is ENDPTCOMPLETE set for each USB transaction or USB transfer? Any guidance would be greatly appreciated.