Open JacobChrist opened 10 years ago
Jacob, I'd like to fix this. Could you post a MPIDE version that this fails with, along with a test sketch that shows it failing?
Any news?
My guess is that this is still an issue. If I can find some time I will put together a sample sketches.
I was using attachCoreTimerService to add an interrupt to my sketch.
The attached interrupt appears to be starving the USB interrupt. To see the effect add a delayMicroseconds(350); into your attached interrupt. This delay is so big that the USB will not get a chance to be serviced.
Next (at the suggestion of Mike S.) we tried a different interrupt (Timer3). The sample code Mike gave me was IPL3, we ran it fast and the USB did not crash.
Next we bumped the IPL on Timer3 up to 7 and reran. Sure enough USB broke with heavy communications.
I don't understand PIC32, USB or the chipKIT core enough to full grasp what is going on but here is my theory.
Since attaching an interrupt to the core timer is an advertised feature (as it USB) and one can break the other I think this needs to be addressed.
My suggested solution would be to make the CoreTimerService slightly lower priority than USB.