From: diabolo <dia...@ya...> - 2016-11-25 07:53:57
|
STM32F4 is a LS device so it's packet size is 64 byte.SO if your Host request (read pipe) is are less than what the device is sending but is nx64 it is normal that it time out An usb bulk request only end if all the requested data is received (request 128 and get 128 ) or the last receive packet is less than 64 or 0 (is a short or ZLP)ie if your request is 1024 long but device send 64,128,... it will time out if thsiis what happen the issue is how your f/w and app communicates 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) From: Pradeepa Senanayake <pra...@gm...> Subject: [Libusb-win32-devel] LibusbK Read Pipe timeout but all the data is received To: lib...@li... Message-ID: <CA+1tQ70hKGTk=LRS...@ma...> Content-Type: text/plain; charset="utf-8" Hello All, I have been using libusbK with WinUSB for a long time now. Recently we found out a bug which had slipped away from us and has been in the source for 2 years. The issue is, when we call ReadPipe to read a bulk in endpoint sometimes we get a timeout. When we investigated more we found out that the issue comes only when our reply data amount is a multiple of 64 bytes. Nevertheless, when we get a timeout if I checked the transferred byte amount and the content, it has all the data the device had committed. I'm a bit perplexed at the moment due to this behavior. We have a STM32F4 IC in the device. It seems like it's committing all the data to the USB controller properly. Is there any one who had faced something similar? Or if this is a known issue can someone suggest a workaround? Thank you, Best Regards, Pradeepa Senanayake. |