Bill Hart

CMX/ColdFire USB Stuck In Loop(s)

Discussion created by Bill Hart on Dec 16, 2008
Latest reply on Feb 16, 2011 by David Veerman
I am using a JM128 and have found two instances where the CMX code will hang in a loop.  One example is in Host mode performing a read when the client has no data.  The device hangs in this loop     while((MCF_USB_INT_STAT & (MCF_USB_INT_STAT_TOK_DNE | MCF_USB_INT_STAT_STALL | MCF_USB_INT_STAT_ERROR)) ==0)    {
as neither a Token Done, Stall or Error event occur.
 
I've added a timeout which lets me exit (similar to a pipe policy timeout on a WinUSB read) but I have yet to add any USB SIE clean up code.  Specifically, I've not found any reference to "turning off" or terminating a pending Token in the data sheet.
 
I assume I must write something to the Token register (although the data sheet says only IN, OUT and SETUP Tokens are valid) then clear the own bit for the descriptor in question.  However, you know, when you assume you make a ...........
 
Has anyone had the need to terminate an active token?  If so, can you share how you went about cleaning up the USB SIE once you timed out?
 
I've had a similar problem with IN transactions in client mode where I get stuck in a waiting on client Tx to complete.  I got past this problem by nuking the client services all together which is a bit silly but it worked.
 
Thanks,
Bill

Outcomes