From owner-freebsd-usb@FreeBSD.ORG Thu Apr 24 15:24:30 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 EBC0F1065674 for ; Thu, 24 Apr 2008 15:24:30 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.188]) by mx1.freebsd.org (Postfix) with ESMTP id C0D078FC2A for ; Thu, 24 Apr 2008 15:24:30 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by rn-out-0910.google.com with SMTP id j40so1450711rnf.12 for ; Thu, 24 Apr 2008 08:24:30 -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=+jUSkJAStJtYKAf3Rpkteg9wrnPmTE5H7EU++VdshAY=; b=DiI1z+r0rbcCF1G9qQA7DnzmYQjBY6xkkdVOgYpMuBNagC7siNu1H1uLXYzhz7EpZgogkSQyqyvnvHJ+rDbzN4LNDe+6h8sSgQlRYQX/TL75AQ+OlR4sRD7UOffbt+lIO3HF+sd07bnYPU3YgjleZCz5T8w/OfWMNllBSEIgvJA= 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=DzeAKL5cleO8gVnovjt5+/h7G/pUgaV5f5MY7744oNS5HVvHkpsQpbRoxrsovNxOPzD1nMxQ1ZcDEkl+mgJIkJw4ZC4kyObf+glEwuVC6dUI8EziJ4KU/UHyCLBwnTQNn8KIrlh69bBluS3jTP5jy2RDpXj2qy7+DMTSh6qx9hw= Received: by 10.114.106.13 with SMTP id e13mr1882981wac.157.1209049183926; Thu, 24 Apr 2008 07:59:43 -0700 (PDT) Received: by 10.114.39.14 with HTTP; Thu, 24 Apr 2008 07:59:43 -0700 (PDT) Message-ID: Date: Thu, 24 Apr 2008 22:59:43 +0800 From: "Xiaofan Chen" To: "Hans Petter Selasky" In-Reply-To: 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: Thu, 24 Apr 2008 15:24:31 -0000 On Tue, Oct 16, 2007 at 8:42 PM, Xiaofan Chen wrote: > > 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. Sorry now I am facing problems again with the 7.0-RELEASE and the HPS USB stack (I am not able to get the stock kernel to work with interrupt read). $ uname -a FreeBSD freebsd7.MSHOME.net 7.0-RELEASE FreeBSD 7.0-RELEASE #1: Sun Mar 30 16:29:52 SGT 2008 root@freebsd7.MSHOME.net:/usr/obj/usr/src/sys/custom i386 [mcuee@freebsd7 ~/Desktop/build/pyusb]$ 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 write (2, 30, 1, 44, 172, 167, 11, 189, 209, 147, 131, 98, 33, 10, 112, 128, 236, 48, 9, 38, 142, 188, 38, 49, 114, 75, 208, 84, 176, 170, 59, 148, 151, 97, 198, 145, 34, 12, 32, 71, 217, 74, 50, 92, 115, 100, 89, 130, 29, 176, 62, 56, 37, 6, 16, 102, 243, 53, 201, 160, 0, 2, 140, 4) This works. However running pk2 and pk2cmd will result the system to crash immediately. [root@freebsd7 /var/crash]# ls -la total 508352 drwxr-x--- 2 root wheel 512 Apr 24 22:07 . drwxr-xr-x 25 root wheel 512 Apr 25 06:07 .. -rw-r--r-- 1 root wheel 2 Apr 24 22:07 bounds -rw------- 1 root wheel 444 Mar 30 16:19 info.0 -rw------- 1 root wheel 445 Mar 30 16:52 info.1 -rw------- 1 root wheel 446 Apr 24 21:58 info.2 -rw------- 1 root wheel 446 Apr 24 22:07 info.3 -rw-r--r-- 1 root wheel 5 Feb 25 01:53 minfree -rw------- 1 root wheel 61952000 Mar 30 16:19 vmcore.0 -rw------- 1 root wheel 175443968 Mar 30 16:52 vmcore.1 -rw------- 1 root wheel 168951808 Apr 24 21:59 vmcore.2 -rw------- 1 root wheel 163037184 Apr 24 22:07 vmcore.3 [root@freebsd7 /var/crash]# cat info.3 Dump header from device /dev/ad4s4b Architecture: i386 Architecture Version: 2 Dump Length: 163037184B (155 MB) Blocksize: 512 Dumptime: Thu Apr 24 22:04:54 2008 Hostname: freebsd7.MSHOME.net Magic: FreeBSD Kernel Dump Version String: FreeBSD 7.0-RELEASE #1: Sun Mar 30 16:29:52 SGT 2008 root@freebsd7.MSHOME.net:/usr/obj/usr/src/sys/custom Panic String: page fault Dump Parity: 2907024719 Bounds: 3 Dump Status: good All the 4 crashes are caused by this problem. It used to run fine with the 7.0-Beta1/2/3 kernel and the HPS stack. http://mcuee.blogspot.com/2007/11/pk2cmd-ported-to-linux.html How should I attack this problem? Xiaofan