From: diabolo <dia...@ya...> - 2016-11-28 07:37:38
|
Good that you figure out things ;) those are just usb basic > 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. Right some STM32F4 device have dual usb controller 1st HS+FS capable with ext phy and second one FS only but some STM32F4 has FS onlyAnyway based on the issue it was obvious you were in case FS ;) Note that to be 100% the packet size issue 64, 512 or 1024 could show even for SS or HS device plug behind a "slower" hub if device is ok to work in such configuration. Typically if you plug an USB3.0 device on a USB 2 or usb 2 or 3 dev on usb 1 hub So both host s/w and device f/w shall take this into account it's ie take car of running config and look at ep descriptor instead of hardcoding value of 64,512 or 1024. Le Dimanche 27 novembre 2016 13h09, "lib...@li..." <lib...@li...> a écrit : Send Libusb-win32-devel mailing list submissions to lib...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel or, via email, send a message with subject or body 'help' to lib...@li... You can reach the person managing the list at lib...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Libusb-win32-devel digest..." Today's Topics: 1. Re: LibusbK Read Pipe timeout but all the (Pradeepa Senanayake) ---------------------------------------------------------------------- Message: 1 Date: Sun, 27 Nov 2016 07:07:35 +0530 From: Pradeepa Senanayake <pra...@gm...> Subject: Re: [Libusb-win32-devel] LibusbK Read Pipe timeout but all the To: lib...@li... Message-ID: <CA+...@ma...> Content-Type: text/plain; charset="utf-8" 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 <xia...@gm...> wrote: > On Fri, Nov 25, 2016 at 9:11 PM, Xiaofan Chen <xia...@gm...> wrote: > > On Fri, Nov 25, 2016 at 3:53 PM, diabolo <dia...@ya...> 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 > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ------------------------------------------------------------------------------ ------------------------------ _______________________________________________ Libusb-win32-devel mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel End of Libusb-win32-devel Digest, Vol 118, Issue 8 ************************************************** |