Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Apr 2008 12:46:52 +0800
From:      "Xiaofan Chen" <xiaofanc@gmail.com>
To:        "Hans Petter Selasky" <hselasky@c2i.net>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: PICDEM FS USB Bootloader under FreeBSD
Message-ID:  <a276da400804252146g67496758g791ba934e341e9db@mail.gmail.com>
In-Reply-To: <a276da400804252050y1059ccf0k511251242d21d2d5@mail.gmail.com>
References:  <a276da400710120806k636347eew876ee0fb3fc17ab3@mail.gmail.com> <a276da400804241956r3a7759bp298c76ccdaf8eb76@mail.gmail.com> <a276da400804250659t7b413c60ib9974d2c19c1d3e4@mail.gmail.com> <200804251849.11283.hselasky@c2i.net> <a276da400804252050y1059ccf0k511251242d21d2d5@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 26, 2008 at 11:50 AM, Xiaofan Chen <xiaofanc@gmail.com> wrote:
>
>  >  2) Patch /sys/dev/usb/ugen.c
>  >
>  >  Change all lines looking like the following, that are not in a function
>  >  named "xxx_callback":
>  >
>  >  sce->read_stall = 1;
>  >  sce->write_stall = 1;
>  >
>  >  Into:
>  >
>  >  sce->read_stall = 0;
>  >  sce->write_stall = 0;
>  >
>  >  Recompile ugen an try again.
>
>  Maybe this is a stupid question but how do I compile ugen only and not
>  the whole kernel?
>
>  Normally I will use the following command with this modifications.
>  [root@freebsd7 /usr/src]# make buildkernel installkernel
>  KERNCONF=custom -DNOCLEAN -DNO_CLEAN -DNO_KERNELDEPEND
>
>  But with major updates I will just use
>  make buildkernel installkernel KERNCONF=custom
>
>  I will try this out and report back.

This does not help.

[mcuee@freebsd7 /usr/home/mcuee/Desktop/build/fsusb/fsusb-0.1.11-2]$
sudo sysctl hw.usb.debug=15
Password:
hw.usb.debug: 0 -> 15
[mcuee@freebsd7 /usr/home/mcuee/Desktop/build/fsusb/fsusb-0.1.11-2]$
./fsusb --verify demo.hex
Locating USB Microchip(tm) PICDEM-FS USB(tm) (vendor 0x04d8/product 0x000b)
Found USB PICDEM-FS USB as device '/dev/ugen1' on USB bus /dev/usb1
Communication established.  Onboard firmware version is 1.0
^C

ugenopen: flag=1, mode=8192
ugenioctl: cmd=40125569
ugenclose: flag=1, mode=8192
ugenopen: flag=3, mode=8192
ugenioctl: cmd=80045572
ugenioctl: cmd=c018556f
usbd_do_request_flags: udev=0xc40bc800 bmRequestType=0x80
bRequest=0x06 wValue=0x0200 wIndex=0x0000 wLength=0x0008
usbd_callback_wrapper: case 1
usbd_start_hardware: xfer=0xc4272070, pipe=0xc40bc9b0, nframes=2, dir=read
usbd_dump_pipe: pipe=0xc40bc9b0 edesc=0xc40bcc7d isoc_next=0
toggle_next=0 bEndpointAddress=0x00
usbd_dump_queue: pipe=0xc40bc9b0
usbd_transfer_dequeue: xfer=0xc4272070 pipe=0xc40bc9b0 sts=0 alen=16,
slen=16, afrm=2, nfrm=2
usbd_callback_wrapper: case 5
usbd_callback_wrapper: case 4
ugenioctl: cmd=80045572
ugenioctl: cmd=c018556f
usbd_do_request_flags: udev=0xc40bc800 bmRequestType=0x80
bRequest=0x06 wValue=0x0200 wIndex=0x0000 wLength=0x0029
usbd_callback_wrapper: case 1
usbd_start_hardware: xfer=0xc4272070, pipe=0xc40bc9b0, nframes=2, dir=read
usbd_dump_pipe: pipe=0xc40bc9b0 edesc=0xc40bcc7d isoc_next=0
toggle_next=0 bEndpointAddress=0x00
usbd_dump_queue: pipe=0xc40bc9b0
usbd_transfer_dequeue: xfer=0xc4272070 pipe=0xc40bc9b0 sts=0 alen=49,
slen=49, afrm=2, nfrm=2
usbd_callback_wrapper: case 5
usbd_callback_wrapper: case 4
ugenioctl: cmd=80045572
ugenioctl: cmd=c018556f
usbd_do_request_flags: udev=0xc40bc800 bmRequestType=0x80
bRequest=0x06 wValue=0x0201 wIndex=0x0000 wLength=0x0008
usbd_callback_wrapper: case 1
usbd_start_hardware: xfer=0xc4272070, pipe=0xc40bc9b0, nframes=2, dir=read
usbd_dump_pipe: pipe=0xc40bc9b0 edesc=0xc40bcc7d isoc_next=0
toggle_next=0 bEndpointAddress=0x00
usbd_dump_queue: pipe=0xc40bc9b0
usbd_transfer_dequeue: xfer=0xc4272070 pipe=0xc40bc9b0 sts=0 alen=16,
slen=16, afrm=2, nfrm=2
usbd_callback_wrapper: case 5
usbd_callback_wrapper: case 4
ugenioctl: cmd=80045572
ugenioctl: cmd=c018556f
usbd_do_request_flags: udev=0xc40bc800 bmRequestType=0x80
bRequest=0x06 wValue=0x0201 wIndex=0x0000 wLength=0x0020
usbd_callback_wrapper: case 1
usbd_start_hardware: xfer=0xc4272070, pipe=0xc40bc9b0, nframes=2, dir=read
usbd_dump_pipe: pipe=0xc40bc9b0 edesc=0xc40bcc7d isoc_next=0
toggle_next=0 bEndpointAddress=0x00
usbd_dump_queue: pipe=0xc40bc9b0
usbd_transfer_dequeue: xfer=0xc4272070 pipe=0xc40bc9b0 sts=0 alen=40,
slen=40, afrm=2, nfrm=2
usbd_callback_wrapper: case 5
usbd_callback_wrapper: case 4
ugenclose: flag=3, mode=8192
ugenopen: flag=1, mode=8192
ugenioctl: cmd=40125569
ugenclose: flag=1, mode=8192
ugenopen: flag=3, mode=8192
ugenioctl: cmd=80045572
ugenioctl: cmd=c018556f
usbd_do_request_flags: udev=0xc40bc000 bmRequestType=0x80
bRequest=0x06 wValue=0x0200 wIndex=0x0000 wLength=0x0008
usbd_callback_wrapper: case 1
usbd_start_hardware: xfer=0xc428b070, pipe=0xc40bc1b0, nframes=2, dir=read
usbd_dump_pipe: pipe=0xc40bc1b0 edesc=0xc40bc47d isoc_next=0
toggle_next=0 bEndpointAddress=0x00
usbd_dump_queue: pipe=0xc40bc1b0
usbd_transfer_dequeue: xfer=0xc428b070 pipe=0xc40bc1b0 sts=0 alen=16,
slen=16, afrm=2, nfrm=2
usbd_callback_wrapper: case 5
usbd_callback_wrapper: case 4
ugenioctl: cmd=80045572
ugenioctl: cmd=c018556f
usbd_do_request_flags: udev=0xc40bc000 bmRequestType=0x80
bRequest=0x06 wValue=0x0200 wIndex=0x0000 wLength=0x0020
usbd_callback_wrapper: case 1
usbd_start_hardware: xfer=0xc428b070, pipe=0xc40bc1b0, nframes=2, dir=read
usbd_dump_pipe: pipe=0xc40bc1b0 edesc=0xc40bc47d isoc_next=0
toggle_next=0 bEndpointAddress=0x00
usbd_dump_queue: pipe=0xc40bc1b0
usbd_transfer_dequeue: xfer=0xc428b070 pipe=0xc40bc1b0 sts=0 alen=40,
slen=40, afrm=2, nfrm=2
usbd_callback_wrapper: case 5
usbd_callback_wrapper: case 4
ugenclose: flag=3, mode=8192
ugenopen: flag=3, mode=8192
ugenioctl: cmd=80045565
ugen_set_config: configno 1, sc=0xc4286000
ugenclose: flag=0, mode=0
ugenopen: flag=3, mode=8192
ugenioctl: cmd=80045572
ugenwrite:
usbd_get_pipe: udev=0xc40bc000 iface_index=0 address=0x1 type=0x2
dir=0x0 index=0
usbd_get_pipe: udev=0xc40bc000 iface_index=0 address=0x0 type=0x0
dir=0xff index=0
usbd_get_pipe: udev=0xc40bc000 iface_index=0 address=0x1 type=0x2
dir=0x0 index=0
usbd_get_pipe: udev=0xc40bc000 iface_index=0 address=0x0 type=0x0
dir=0xff index=0
ugenwrite: transferred 5 bytes
usbd_callback_wrapper: case 1
usbd_start_hardware: xfer=0xc4ea9070, pipe=0xc40bc1c4, nframes=1, dir=write
usbd_dump_pipe: pipe=0xc40bc1c4 edesc=0xc4292472 isoc_next=0
toggle_next=0 bEndpointAddress=0x01
usbd_dump_queue: pipe=0xc40bc1c4
usbd_transfer_dequeue: xfer=0xc4ea9070 pipe=0xc40bc1c4 sts=0 alen=5,
slen=5, afrm=1, nfrm=1
usbd_callback_wrapper: case 5
usbd_callback_wrapper: case 4
ugen_default_write_callback: waking 0xc4286084
ugenioctl: cmd=80045572
ugenioctl: cmd=80045571
ugenread:
usbd_get_pipe: udev=0xc40bc000 iface_index=0 address=0x1 type=0x2
dir=0x80 index=0
usbd_get_pipe: udev=0xc40bc000 iface_index=0 address=0x0 type=0x0
dir=0xff index=0
usbd_get_pipe: udev=0xc40bc000 iface_index=0 address=0x1 type=0x2
dir=0x80 index=0
usbd_get_pipe: udev=0xc40bc000 iface_index=0 address=0x0 type=0x0
dir=0xff index=0
usbd_callback_wrapper: case 1
usbd_start_hardware: xfer=0xc4ebd070, pipe=0xc40bc1d8, nframes=1, dir=read
usbd_dump_pipe: pipe=0xc40bc1d8 edesc=0xc4292479 isoc_next=0
toggle_next=0 bEndpointAddress=0x81
usbd_dump_queue: pipe=0xc40bc1d8
usbd_transfer_dequeue: xfer=0xc4ebd070 pipe=0xc40bc1d8 sts=0 alen=4,
slen=4, afrm=1, nfrm=1
usbd_callback_wrapper: case 5
usbd_callback_wrapper: case 4
ugen_default_read_callback: waking 0xc4286084
ugenread: got 4 of 4 bytes
ugenclose: flag=3, mode=8192
ugenclose: flag=3, mode=8192
usbd_transfer_dequeue: xfer=0xc4ebd070 pipe=0xc40bc1d8 sts=5 alen=4,
slen=4, afrm=1, nfrm=1
usbd_transfer_dequeue: xfer=0xc4ea9070 pipe=0xc40bc1c4 sts=5 alen=5,
slen=5, afrm=1, nfrm=1
usb_event_thread: woken up
usb_event_thread: woken up
usb_event_thread: woken up

Bus /dev/usb1 Device /dev/ugen1: ID 04d8:000b Microchip Technology, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x04d8 Microchip Technology, Inc.
  idProduct          0x000b
  bcdDevice            0.00
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         0 (Defined at Interface level)
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

[mcuee@freebsd7 /usr/home/mcuee/Desktop/build/fsusb/fsusb-0.1.11-2]$ lsusb -vvv

Bus /dev/usb0 Device /dev/ugen0: ID 04d8:0033 Microchip Technology, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x04d8 Microchip Technology, Inc.
  idProduct          0x0033
  bcdDevice            0.02
  iManufacturer           1 Microchip Technology Inc.
  iProduct                2 PICkit 2 Microcontroller Programmer
  iSerial                 0
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          2 PICkit 2 Microcontroller Programmer
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               0.01
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      29
          Report Descriptor: (length is 29)
            Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
                            (null)
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
                            (null)
            Item(Local ): Usage Maximum, data= [ 0x40 ] 64
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x40 ] 64
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position
Non_Volatile Bitfield
            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
                            (null)
            Item(Local ): Usage Maximum, data= [ 0x40 ] 64
                            (null)
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position
Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     2
    iConfiguration          4 PICkit 2 Configuration 2
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
can't get device qualifier: Input/output error
can't get debug descriptor: Input/output error
cannot read device status, Input/output error (5)

Bus /dev/usb1 Device /dev/ugen1: ID 04d8:000b Microchip Technology, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x04d8 Microchip Technology, Inc.
  idProduct          0x000b
  bcdDevice            0.00
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         0 (Defined at Interface level)
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
can't get device qualifier: Input/output error
can't get debug descriptor: Input/output error
cannot read device status, Input/output error (5)

Xiaofan



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