PICkit 2 again with HPS stack

Xiaofan Chen xiaofanc at gmail.com
Thu Apr 24 15:24:31 UTC 2008


On Tue, Oct 16, 2007 at 8:42 PM, Xiaofan Chen <xiaofanc at 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 at freebsd7.MSHOME.net:/usr/obj/usr/src/sys/custom  i386

[mcuee at 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 at 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 at 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 at 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


More information about the freebsd-usb mailing list