cancel
Showing results for 
Search instead for 
Did you mean: 

USB problem with uPSD3234

neil2
Associate II
Posted on October 29, 2003 at 13:32

USB problem with uPSD3234

3 REPLIES 3
neil2
Associate II
Posted on May 17, 2011 at 11:56

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) code
joseph2399
Associate II
Posted on May 17, 2011 at 11:56

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?

neil2
Associate II
Posted on May 17, 2011 at 11:56

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?