On Fri, Jun 26, 2015 at 5:01 AM, Jayan John <jayanjohn79@xxxxxxxxx> wrote: > Thanks Alex. I appreciate you introducing me to Peter. Any help is appreciated. > > On the host (Wandboard iMX6q) the test app opens /dev/hidraw0 and > write 64 bytes with report ID (1). The HID device has no Interrupt OUT > ep, therefore uses control endpoint ep0 for the 64 bytes transfer to > gadget (Wandboard iMX6q) using set_report. > > The setup phase is OK and the 64 bytes is written to gadget. However > the chipidea interrupt (ci_irq()) and resulting udc interrupt > (udc_irq()) is invoked. This indicates that the 64 bytes transaction > is not completed over ep0 from host to gadget. > > **this issue is reproducible for all data transfers that aligns on 64 bytes** > > ~jayan > Hi Jayan, This sounds like a Zero Length Transfer issue. This applies to any endpoint including EP0. A ZLT is needed to end any transfer IFF the length is not already known by the protocol. So if the hid URB requests say 1024 bytes and the gadget only has 64, it must first send the 64 byte maxpacket and then send a zero length packet. This way the host knows the transfer is complete. If there is no ZLT, the host hardware will keep requesting the rest of the message and the gadget which thinks it is done will keep NAKing.... Forever. If however the transfer is known to be exactly some multiple (1, 2 ...) of the maxpacketsize, no ZLT is needed since the host will ask for exactly that size. I believe for HID the packet size is determined by the report size in the HID descriptor. Good Luck, Steve -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html