Re: LibusbK Read Pipe timeout but all the

Pradeepa Senanayake <[email protected]> Sun, 27 Nov 2016 07:07:35 +0530
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CA+1tQ72jZ3YT1E+qE4f3EDjnYw_2T7uaXNNqH7iBoABfRguF5g@mail.gmail.com>
Hello Guys,

Thank you very much for your answers. After going through the USB2.0
specification I figured out the changes I need to do.

USB2.0 Specification
Section 5.8.3: Bulk Transfer Packet Size Constraints

An endpoint must always transmit data payloads with a data field less than
or equal to the endpoint’s reported wMaxPacketSize value. When a bulk IRP
involves more data than can fit in one maximum-sized data payload, all data
payloads are required to be maximum size except for the last data payload,
which will contain the remaining data. A bulk transfer is complete when the
endpoint does one of the following:

• Has transferred exactly the amount of data expected
• Transfers a packet with a payload size less than wMaxPacketSize or
transfers a zero-length packet

This is the same thing diabolo suggested.

Now how handle this condition is, if the last packet I send to host is same
as wMaxPacketSize a commit another ZLP to inform the host to terminate the
bulk read.

One thing @diabolo said is incorrect though. The STM32F4 device is not a LS
(Low Speed) device. It is a inherently a FS (Full Speed) device, which can
even work as HS (High Speed) if we can connect separate PHY chip. Please
correct me if I'm wrong.

@Xiaofan's suggestions are also important. But they have already been
addressed in our source.

The issue is fixed now. Thanks again.



Best Regards,
Pradeepa Senanayake.

On Fri, Nov 25, 2016 at 6:45 PM, Xiaofan Chen <[email protected]> wrote:

> On Fri, Nov 25, 2016 at 9:11 PM, Xiaofan Chen <[email protected]> wrote:
> > On Fri, Nov 25, 2016 at 3:53 PM, diabolo <[email protected]> wrote:
> >> I use stm32 with libusbk back-end and I nevr seen this:
> >> But device f/w never send a multiple of 64 byte  youc an do it by
> sending a
> >> zlp after data on te stm32 side
> >> but that's not convenient
> >> I always managed to send short packet and prefer to send one extra byte
> if
> >> payload is  nx64 but if it the max size I ever send (ie 1024 in most of
> my
> >> app)
> >>
> >
> > Not so sure if setting the pipe policy will help.
> >
> > https://msdn.microsoft.com/en-us/library/windows/hardware/
> ff728833(v=vs.85).aspx
> >
> > http://libusbk.sourceforge.net/UsbK3/group__usbk.html#
> ga10f9e367e4241c431edc2cecd1bb827e
> >   UsbK_SetPipePolicy
> >
> > SHORT_PACKET_TERMINATE (0x01)
> > PIPE_TRANSFER_TIMEOUT (0x03)
> >
> Also ALLOW_PARTIAL_READS (0x05).
>
> Ref: http://permalink.gmane.org/gmane.comp.lib.libusbx.devel/1245
>
> --
> Xiaofan
>
> ------------------------------------------------------------
> ------------------
> _______________________________________________
> Libusb-win32-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>

------------------------------------------------------------------------------

_______________________________________________
Libusb-win32-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel