Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2007 20:42:11 +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:  <a276da400710160542q71bb4983jf27b59cb0e5ee104@mail.gmail.com>
In-Reply-To: <200710152303.29294.hselasky@c2i.net>
References:  <a276da400710120332h5f780ee8g9a12d5fb5548f8da@mail.gmail.com> <200710121912.03585.hselasky@c2i.net> <a276da400710130252k2d2d0db2n2ac1f40c20b64a1b@mail.gmail.com> <200710152303.29294.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/16/07, Hans Petter Selasky <hselasky@c2i.net> wrote:
> On Saturday 13 October 2007, Xiaofan Chen wrote:
> > On 10/13/07, Hans Petter Selasky <hselasky@c2i.net> 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



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