2003-10-29 04:32 AM
2011-05-17 02:56 AM
I've developed an application based on the USB example code from ST.
I've added things like A/D (on an external chip) motor speed control etc. The system runs fine for a while then crashes. Using an USB bus analyser, I can see that all OUT packets are replied to with a NAK. I suspect there is a bug in the code but I can't find it. Anyone else experience anything similar? I used the latest (V1.0.7) code2011-05-17 02:56 AM
Can you please be a little more specific on what do you mean by it crashes? Can you tell which command was it excuting, when the crash occurd? Does it happen only when you have moter speed control enable?
2011-05-17 02:56 AM
I have now solved the problem.
What happens is: The USB interrupts don't always get serviced in time if there are too many other interrupts happening at the same time. Solution: Give the USB interrupts a higher priority than all the others. (Because the USB interrupt can then interrupt another interrupt service routine in progress, care must be exercised if they both access the same data) An incidental question: If I disable an interrupt momentarily then re-enable it, if that interrupt occurrs while it is disabled will it be missed?