From owner-freebsd-usb@FreeBSD.ORG Fri Oct 12 18:19:13 2007 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 C3FFE16A419 for ; Fri, 12 Oct 2007 18:19:13 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe13.swip.net [212.247.155.129]) by mx1.freebsd.org (Postfix) with ESMTP id 3D51413C44B for ; Fri, 12 Oct 2007 18:19:13 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [85.19.218.45] (account mc467741@c2i.net [85.19.218.45] verified) by mailfe13.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 255790034; Fri, 12 Oct 2007 19:19:10 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Fri, 12 Oct 2007 19:19:35 +0200 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710121919.36175.hselasky@c2i.net> Cc: 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: Fri, 12 Oct 2007 18:19:13 -0000 On Friday 12 October 2007, Xiaofan Chen wrote: > I am trying to get the PICDEM FS USB demo board working under > FreeBSD. There are two libusb based application for it which work > under Linux and Windows. I am now trying to get the bootloader > working first. It is not working. Possibly this is again a firmware bug > related issue but I would like to get it working either by patching > the kernel code or by fixing the firmware. I am running the latest > SVN version of HPS stack and the latest FreeBSD 6.2 Stable version. > > http://www.internetking.org/fsusb (original under Linux) > http://forum.microchip.com/tm.aspx?m=106426 (minor patch by me) > > ===[mcuee] ~ # uname -a > FreeBSD FreeBsd62.Mshome 6.2-STABLE FreeBSD 6.2-STABLE #2: Thu Oct 11 > 19:50:55 SGT 2007 > root@FreeBsd62.Mshome:/home/obj/home/src/sys/USBDEBUG i386 > > ===[mcuee] ~/Desktop/build/fsusb/fsusb-0.1.11-2 # dmesg | grep ugen > ugen0: 126> ugen1: class 0/0, rev 2.00/0.01, addr 125> > > ===[mcuee] ~/Desktop/build/fsusb/fsusb-0.1.11-2 # sudo sysctl > hw.usb.debug=15 hw.usb.debug: 0 -> 15 > > ===[mcuee] ~/Desktop/build/fsusb/fsusb-0.1.11-2 # sudo ./fsusb --read > test.hex usb_set_debug: Setting debugging level to 255 (on) > Locating USB Microchip(tm) PICDEM-FS USB(tm) (vendor 0x04d8/product 0x000b) > usb_os_find_busses: Found /dev/usb0 > usb_os_find_busses: Found /dev/usb1 > usb_os_find_busses: Found /dev/usb2 > usb_os_find_devices: Found /dev/ugen1 on /dev/usb1 > usb_os_find_devices: Found /dev/ugen0 on /dev/usb1 > usb_control_msg: 128 6 512 0 0xbfbfe828 8 1000 > USB error: error sending control message: Input/output error > Unable to get descriptor (-5) > usb_control_msg: 128 6 512 0 0xbfbfe828 8 1000 > usb_control_msg: 128 6 512 0 0x8052080 41 1000 > skipped 1 class/vendor specific interface descriptors > usb_control_msg: 128 6 513 0 0xbfbfe828 8 1000 > usb_control_msg: 128 6 513 0 0x804d100 32 1000 > Found USB PICDEM-FS USB as device '/dev/ugen0' on USB bus /dev/usb1 > USB error: error writing to bulk endpoint /dev/ugen0.1: Input/output error > usb_bulk_write: Input/output error > Fatal error> rjl_request_version(): USB write failed > ===[mcuee] ~/Desktop/build/fsusb/fsusb-0.1.11-2 # dmesg | grep ugen > ugen0: 126> ugen1: class 0/0, rev 2.00/0.01, addr 125> > ugenopen: flag=1, mode=8192 > ugenioctl: cmd=40125569 > ugenclose: flag=1, 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 > ugenclose: flag=3, mode=8192 > ugenopen: flag=3, mode=8192 > ugenioctl: cmd=80045572 > ugenioctl: cmd=c018556f > ugenioctl: cmd=80045572 > ugenioctl: cmd=c018556f > ugenioctl: cmd=80045572 > ugenioctl: cmd=c018556f > ugenioctl: cmd=80045572 > ugenioctl: cmd=c018556f > ugenclose: flag=3, mode=8192 > ugenopen: flag=3, mode=8192 > ugenioctl: cmd=80045565 > ugen_set_config: configno 1, sc=0xc35cd000 > ugenclose: flag=0, mode=0 > ugenopen: flag=3, mode=8192 > ugenioctl: cmd=80045572 > ugenwrite: > ugenwrite: transferred 5 bytes > ugen_write_clear_stall_callback: sce=0xc35cd084: stall cleared > ugen_default_write_callback: waking 0xc35cd084 > ugenclose: flag=3, mode=8192 > ugenclose: flag=3, mode=8192 I think that the write STALLED. You can check this by turning on debugging on the OHCI controller by: systctl hw.usb.ohci.debug=15 Replace "ohci" by "ehci" or "uhci" if you are using such controllers. Do you have any USB protocol analyser by hand so that you can trace the USB cable ? --HPS