From owner-freebsd-usb@FreeBSD.ORG Tue Oct 16 12:42:38 2007 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 0D20B16A418 for ; Tue, 16 Oct 2007 12:42:38 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by mx1.freebsd.org (Postfix) with ESMTP id 00D0013C469 for ; Tue, 16 Oct 2007 12:42:37 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so2403711waf for ; Tue, 16 Oct 2007 05:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; 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=9DLHRo3saaBAb26pCHKFMZylIbz7bTsLGJmbj3WSa0g=; b=eO9w4sMLsCb66diR+CVxe2DTbtUTFDWf3sIj93LWZb5nZf71r9+y2RObAtuTxJwzqKaONcccNWHvVdaAkZmAKGHdHGaLiaEjgsnoUiP5ah+/eS5Z/uaENP1cYQG13AnQsSCIn73GCxiLZMSjqroBpSVPosh7nINVi5jn8UiQrZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=MLspG+AqwLlAGYHppTamOg3u72ljYA5VQG1FFV1KM34ivhUPjfWwIpuF4x51WutCHFyXch9xkopYg/t9WDkZ23eq2d2nRYB7VdtrRwKMTZYF2HH3lvulcw1wWu95FzBDeHdBFxPcjPtMJCp4uuF1jehlLFsIYJAkyktMXCPMjQk= Received: by 10.114.13.1 with SMTP id 1mr8377764wam.1192538531925; Tue, 16 Oct 2007 05:42:11 -0700 (PDT) Received: by 10.114.176.17 with HTTP; Tue, 16 Oct 2007 05:42:11 -0700 (PDT) Message-ID: Date: Tue, 16 Oct 2007 20:42:11 +0800 From: "Xiaofan Chen" To: "Hans Petter Selasky" In-Reply-To: <200710152303.29294.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200710121912.03585.hselasky@c2i.net> <200710152303.29294.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: PICkit 2 again with HPS stack 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: Tue, 16 Oct 2007 12:42:38 -0000 On 10/16/07, Hans Petter Selasky wrote: > On Saturday 13 October 2007, Xiaofan Chen wrote: > > On 10/13/07, Hans Petter Selasky wrote: > > > Resource temporarily unavailable maps to EAGAIN > > > according to "man errno". From what I can see from the log > > > you have provided this means that the "msleep()" > > > call in "ugenread" timed out. > > > > > > What timeout have you programmed in your PICkit ? > > > > It is 1000ms. I change it to 10000ms but this does not help. > > Do you see this timeout ? Does the code actually wait 10 seconds ? I think so. > In the file "ugen.c" in the function "ugen_open_pipe_read()" you will find > a "case UE_INTERRUPT:". Some lines further down you will find: > > /* first transfer clears stall */ > sce->read_stall = 1; > > This you can set to "0". Then recompile and install the "ugen" module and/or > kernel. > > Does your USB hardware work now ? > Yes with the changes, PICkit 2 is happy again under Linux. ===[mcuee] ~/Desktop/build/mypk2 # sudo python testpk2.py set Configuration 1 claim Interface 0 Turing power on by USB interrupt write Sending version command by USB interrupt write Getting version command by USB interrupt read (2, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) Thanks a lot. So it seems there is still a bug in the firmware. Maybe two. The first one caused the stall (why?). The second one is still related to dealing with clear stall feature request. Right? Regards, Xiaofan