4 Replies Latest reply on Oct 14, 2018 8:52 PM by anks

    Terminating a USB bulk OUT transfer

    user_274994191

      I am a USB device. My host is sending me a large amount of data. But I've read everything I need, so I need to tell it to stop. How?

       

      Simply disabling the endpoint won't work, because the host will assume I'm busy and will just keep waiting for me to reenable the port. If it waits long enough, it'll time out, but that's a lousy user experience and I don't want to do that.

       

      The USB spec talks about stalling the endpoint to indicate an error condition, but I can't find any API to do this in the Cypress code. Plus, this isn't really an error condition, just an end of file. I did try this:

       

      USBFS_SIE_EP_BASE.sieEp[ep].epCr0 = USBFS_MODE_STALL_DATA_EP;

       

      ...but it just caused the entire USB connection to crash and burn as everything got out of sync.

       

      What I can't do is tell the host upfront how much data to send, because I don't know (this all depends on external hardware). So what should I be doing?