AnsweredAssumed Answered

USB gadgetfs not reading multiples of wMaxpacketsize data

Question asked by Amol Kulkarni on Jun 4, 2015
Latest reply on Jun 22, 2015 by Daiane Angolini
Branched to a new discussion

I am using imx35 with ltib linux 2.6.31.

 

I am using the OTG in the device mode and configured the device using gadgetfs, connected to linux ubuntu host

USB device configurations:

wMaxpacketsize is 64 bytes.

 

 

I am issuing the gadgetfs read with buffer length of 1024 and writing 511 bytes from ubuntu, gadgetfs unblocks immediately and read returns 511 bytes.

but when i send 512 bytes of data from ubuntu gadgetfs does not unblock or read the the data sent from host until another 512 bytes are sent from host that is till read buffer (1024) gets full.

I tried the sending 64 bytes of data from ubuntu, and gadgetfs does not read until 1024 buffer is full that is i have to send 64 bytes of data 16 times.

but when i send 63  bytes of data, gadgetfs reads 63 bytes immediately. And when i send 65  bytes of data, gadgetfs reads 65 bytes immediately.

 

Please help us understand why this is happening.

Thanks in advance for help.

Outcomes