Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Apr 2008 22:59:43 +0800
From:      "Xiaofan Chen" <xiaofanc@gmail.com>
To:        "Hans Petter Selasky" <hselasky@c2i.net>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: PICkit 2 again with HPS stack
Message-ID:  <a276da400804240759s2e170cadn1dab42729a87369f@mail.gmail.com>
In-Reply-To: <a276da400710160542q71bb4983jf27b59cb0e5ee104@mail.gmail.com>
References:  <a276da400710120332h5f780ee8g9a12d5fb5548f8da@mail.gmail.com> <200710121912.03585.hselasky@c2i.net> <a276da400710130252k2d2d0db2n2ac1f40c20b64a1b@mail.gmail.com> <200710152303.29294.hselasky@c2i.net> <a276da400710160542q71bb4983jf27b59cb0e5ee104@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 16, 2007 at 8:42 PM, Xiaofan Chen <xiaofanc@gmail.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a276da400804240759s2e170cadn1dab42729a87369f>