From owner-freebsd-usb@FreeBSD.ORG Sat Apr 26 02:25:29 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2515C1065676 for ; Sat, 26 Apr 2008 02:25:29 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by mx1.freebsd.org (Postfix) with ESMTP id 082088FC13 for ; Sat, 26 Apr 2008 02:25:28 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so5931692waf.3 for ; Fri, 25 Apr 2008 19:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=QsXwi9+XlTI0e5fqA62wLSlLNR4bijIuatOCGF+hqJw=; b=fqHnyzNSMd0dpv0bzRErsk1A4mfyZCkGw7Qp/aFrj0tEh0ZRPQMhWyfvF8TZPWx3m7PNqjzezd4PqtTBMt5o+v+fY1ckFeCGgMvTvhfSwjFllgn5R2/CMNVQJMCRLSGIenYYLnNpG4YRwgSjURxaLIrTqztM7kOM1KlCOt9YkVw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jZqHyOBU/vOP5UeGca7hEDtYtje8v5wtWGDbjQlhXY6jSCuUMnWBps5D9buxEuYGBcALAuKU+Pp4S4bR6Mp3CFQUEAiYY/S4Z1ByQTMD5FpUjF6HD4hPEOjXknXUcE0OV94OQW21xtdy0L4ur17VCYeqpnSvCoQt+sX/ncB80TI= Received: by 10.114.149.2 with SMTP id w2mr3948198wad.158.1209176728461; Fri, 25 Apr 2008 19:25:28 -0700 (PDT) Received: by 10.114.39.14 with HTTP; Fri, 25 Apr 2008 19:25:28 -0700 (PDT) Message-ID: Date: Sat, 26 Apr 2008 10:25:28 +0800 From: "Xiaofan Chen" To: "Hans Petter Selasky" In-Reply-To: <200804252354.05828.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200804252354.05828.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: PICDEM FS USB Bootloader 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: Sat, 26 Apr 2008 02:25:29 -0000 On Sat, Apr 26, 2008 at 5:54 AM, Hans Petter Selasky wrote: > On Friday 25 April 2008, Xiaofan Chen wrote: > > This does not work either with 7.0-Release and the HPS USB stack. > > I will update to the latest SVN version of the HPS stack and see if the > > situation will improve. The bootlaoder does work under Linux (as well as > > Windows) fine with libusb (libusb-win32). > I think it is a fault of your USB device. But at the same time I think that we > can do a better job working around faulty USB devices. The most likely cause > of the problem is that your USB device does not requeue data on what in your > case is endpoint 1 when it receives the clear-stall for endpoint 1. That is > what I suspect. Where was the firmware for your device again? This is from the popular PICDEM FS USB demo board firmware from Microchip. It is very popular among hobbyists as well as many customers because of low cost, free C18 C compiler (no code size limit, but only optimization limit), free samples, DIP package USB chips, lots of examples and good support from Microchip. Microchip USB info: http://www.microchip.com/usb Others and I have identified various firmware bugs in the free USB stack Microchip offers. They have also corrected quite some of them. Reference: http://forum.microchip.com/tm.aspx?m=275422 I will see if the latest V2.1 stack has fixed this issue. I think it has not. I think you have pinpointed the potential bugs in the stall handling code. The question is then why you want to clear stall in the first transfer. > > When an USB device is broken or it has no driver: > > First you e-mail the manufacturer and complain. > Then you e-mail usb.org and complain. > Then you call your government and complain. > > Anything I forgot ? > If one has the access to the firmware, try to fix it. ;-) In this case, since I have access to the firmware codes and I am quite familiar with it, I will try to fix the firmware. I can totally understand your point as a USB developer for alternative OS like Linux and FreeBSD. Still you can see a lot of Linux USB efforts are to support quirky USB device. It is not that fun, but it is quite important if you care the user experience. A good example from Linux USB; http://kerneltrap.org/mailarchive/linux-kernel/2007/9/13/259148 "It turns out that USB devices suck when it comes to power management issues :(". So maybe it is also true that USB devices suck when it comes to handling clear stall feature request. Xiaofan