From owner-freebsd-usb@FreeBSD.ORG Thu Jul 5 15:24:35 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F63816A469 for ; Thu, 5 Jul 2007 15:24:35 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe10.swip.net [212.247.155.33]) by mx1.freebsd.org (Postfix) with ESMTP id 0E0BE13C484 for ; Thu, 5 Jul 2007 15:24:34 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [194.248.135.20] (account mc467741@c2i.net HELO laptop.lan) by mailfe10.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 368612849; Thu, 05 Jul 2007 17:24:32 +0200 From: Hans Petter Selasky To: "Xiaofan Chen" Date: Thu, 5 Jul 2007 17:24:30 +0200 User-Agent: KMail/1.9.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707051724.30175.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: libusb usb_interrupt_read hangs under FreeBSD X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2007 15:24:35 -0000 On Wednesday 04 July 2007 19:05, Xiaofan Chen wrote: > > On 4/4/07, Hans Petter Selasky wrote: > > > On Wednesday 04 April 2007 01:55, Xiaofan Chen wrote: > > > > On 4/3/07, Hans Petter Selasky wrote: > > > > > Hi, > > > > > > > > > > I think that your device is broken, and goes bad when it receives a > > > > > clear-stall request for the interrupt pipe. That is not very > > > > > uncommon. > > > > > > > > Could you be more clearer? I'd like to communicate this problem > > > > to the firmware developer of PICKit 2 inside Microchip. Thanks. > > > > > > The chip does not handle a clear-stall request on the control pipe to > > > clear-stall on the interrupt pipe. The result is that the interrupt > > > pipe stops, or at least all buffers are cleared. > > > > > > I could be more detailed, but I think the developers will understand > > > what I mean. > > Sorry to dig out this again. I read a bit more on the firmware source code > and I found the following. Seems a bit dubious. The USB controller used > is Microchip 18F2550. > > Any comments? Thanks in advance. > This pre-condition does not always hold: > * > * PreCondition: A STALL packet is sent to the host by the SIE. > * Usually the clear-stall is specific to an endpoint, which is stored in the lower byte of "wIndex". Where does this "wIndex" end up? > if(UEP0bits.EPSTALL == 1) > { > USBPrepareForNextSetupTrf(); // Firmware Work-Around > UEP0bits.EPSTALL = 0; > } > UIRbits.STALLIF = 0; > }//end USBStallHandler > > Maybe this code path has never been taken before? --HPS