Messages per Month
|Xiaofan Chen||Apr 3, 2007 11:54 am|
|Hans Petter Selasky||Apr 3, 2007 12:26 pm|
|Xiaofan Chen||Apr 3, 2007 1:34 pm|
|Hans Petter Selasky||Apr 3, 2007 2:42 pm|
|Xiaofan Chen||Apr 3, 2007 11:55 pm|
|Hans Petter Selasky||Apr 4, 2007 7:37 am|
|Xiaofan Chen||Apr 4, 2007 11:34 am|
|Xiaofan Chen||Jul 4, 2007 5:32 pm|
|Hans Petter Selasky||Jul 5, 2007 3:24 pm|
|Xiaofan Chen||Jul 8, 2007 12:25 am|
|M. Warner Losh||Jul 8, 2007 5:11 am|
|Xiaofan Chen||Jul 8, 2007 1:16 pm|
|Xiaofan Chen||Jul 8, 2007 4:31 pm|
|M. Warner Losh||Jul 8, 2007 8:00 pm|
|Hans Petter Selasky||Jul 9, 2007 4:35 pm|
|Xiaofan Chen||Jul 10, 2007 1:27 am|
|Xiaofan Chen||Jul 13, 2007 10:32 pm|
|Hans Petter Selasky||Jul 15, 2007 9:18 am|
|Xiaofan Chen||Jul 16, 2007 3:44 pm|
|Hans Petter Selasky||Jul 17, 2007 5:55 am|
|Xiaofan Chen||Aug 11, 2007 4:45 am|
|Xiaofan Chen||Sep 22, 2007 3:47 am|
|Subject:||libusb usb_interrupt_read hangs under FreeBSD|
|From:||Hans Petter Selasky (hsel...@c2i.net)|
|Date:||Jul 17, 2007 5:55:50 am|
On Monday 16 July 2007 17:44, Xiaofan Chen wrote:
On 7/15/07, Hans Petter Selasky <hsel...@c2i.net> wrote:
2) For the host, how does it know that the buffer data is still correct if the buffer is not cleared?
Clear stall should only clear the data toggle!
You need a second control command to reset the buffers and/or the protocol!
2) What cause the stall to happen in the first place?
It is either a wrong data-toggle bit or a protocol error. The device can send stall at any time!
Thanks a lot for the detailed explanation.
If it is a protocol error for the control endpoint 0 (EP0), the host will not need to send a clear stall feature request to EP0.
Yes, that is correct, because the data toggle is reset to 0 starting at the SETUP packet which uses a separate PID.
Even if it is sent (shall we consider it a bug of the USB stack if that is the case?), the current PICkit 2 firmware will filter out it and ignore it.
No, that is not a bug.
So I think we can narrow it down to the wrong data-toggle bit. I will dig further. I'd like to convince the PICKit 2 firmware developer that something is wrong even though it is now working under FreeBSD. Could we see the reason for the stall from the following USB log?
Imagine you abort your program and start it again. Then outstanding data in the device FIFOs should be removed first! Then you clear the stall. Clearing of stall, should not clear the data in the buffers! These two events are independent!
I am using the alternative stack from Hans and 6.2 Stable version. So maybe there is a difference here.
With some modifications.