AnsweredAssumed Answered

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

Question asked by Stephen Bialkowski on Feb 5, 2018
Latest reply on Feb 16, 2018 by Stephen Bialkowski

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

Outcomes