USB OUT data lost when waking from USB interrupt (i.MX25)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB OUT data lost when waking from USB interrupt (i.MX25)

676 Views
stephenbialkows
Contributor III

Hello,

We are running into an issue when our target USB device wakes from DOZE mode due to an OUT transfer from the USB host.  The data in first OUT from the host wakes the target.  The bus sniffer shows the first packet is ACK'ed (yes ACK'ed.  Not NACK'ed, stalled, etc).  Yet, the software doesn't see the transfer complete bit until the second OUT is ACK'ed. 

  • Target: i.MX25 (no operating system).  
  • Goal: Target device is in doze mode.  The USB host sends an OUT to wake our target device.  The target should wake up and process the data. 
  • Issue: The target device wakes, but the data in the first OUT is missing.

I don't want to poison the well.  But, it seems the software may not see the transfer complete interrupt for the first OUT because the CPU clock is off when it arrives.  Is this plausible?  Is there a way around this? 

In preparation for doze mode:

  • the USB clocks are left running
  • timer interrupts are temporarily disabled
  • wake interrupts are set so that the target wakes when the user connects the USB cable to a host

Observations:

  • When using a packet sniffer (ellisys USB explorer):
    • The first packet is ACK'ed immediately. 
    • The second packet is NACK'ed for 30ms.
    • This is followed by a successful SETUP sequence. 
    • The second packet is NACK'ed for another 80ms, then finally ACK'ed. 
  • From the software perspective:
    • At the first interrupt after the wake event:
      • we see is the USB error in status register (bit 1); not the transaction completion bit (0) that we usually see after an ACK'ed data packet. 
      • The dTD status bits indicate no error.  Only the active bit is set. 
    • The next interrupt it sees is the transaction complete interrupt.  But we get the data from the second OUT. 

Thanks in advanced!

Stephen

Labels (1)
Tags (1)
0 Kudos
2 Replies

462 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Stephen,

You could take a look at the following Community thread, and application note, in order to verify if this may apply in your case:

https://community.nxp.com/thread/464548

https://www.nxp.com/docs/en/application-note/AN3683.pdf

 

Hope this will be useful for you.

Best regards!

/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

462 Views
stephenbialkows
Contributor III

Carlos,

Thanks for getting back to me.  That was my community post.  The problem was the OTG port hadn't been setup correctly.  The first OUT packet size is 5 bytes.  So I don't think that app note applies.  Other thoughts?

Stephen

0 Kudos