From owner-freebsd-usb@FreeBSD.ORG Sat Apr 26 04:46:55 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 9CBB7106564A for ; Sat, 26 Apr 2008 04:46:55 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 48F218FC17 for ; Sat, 26 Apr 2008 04:46:54 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so4340920fgg.35 for ; Fri, 25 Apr 2008 21:46:53 -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=5tZSNKZCFAMCSLYjVQj/LS/FKmk0GbszcvrFF6ryFfI=; b=TPeKNUgEGyYXuzKyMTIU9bU3YzCXeV72M7bc3MDS6wDIysnjlQCu5pp1yc8sCOKSGkUVv6z3pY8zeQ5gXz4Y898EQtf74NTew1Gzupn0KbXx6arGJZm03fj+BoghfZpLCDd5juEwyUhycaY5Q9ilq6OBz9o1vWfOrXJvmJp7mn4= 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=NdCDKSv/kCAxT/GJRGhRZJIcAKf0jR5H3Wh4BCIXk5BFqsYT6CKMXAYsZJxA403LMW2upCKevVZi4xCa9ifmfC/k0ci+M9M3r907rEm/vNYdJgW2spNTiUtKeq0JX9SKpWOGEuFB4JI/RdLsH6zGMSmV/zzZwPzc6cJDCAodYuk= Received: by 10.78.107.1 with SMTP id f1mr678039huc.85.1209185212926; Fri, 25 Apr 2008 21:46:52 -0700 (PDT) Received: by 10.78.176.18 with HTTP; Fri, 25 Apr 2008 21:46:52 -0700 (PDT) Message-ID: Date: Sat, 26 Apr 2008 12:46:52 +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: <200804251849.11283.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: PICDEM FS USB Bootloader under FreeBSD 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: Sat, 26 Apr 2008 04:46:55 -0000 On Sat, Apr 26, 2008 at 11:50 AM, Xiaofan Chen 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