Re: USB Mass Storage Device with HPS Stack

2008-04-29 Thread Xiaofan Chen
On Tue, Apr 29, 2008 at 3:01 PM, Hans Petter Selasky [EMAIL PROTECTED] wrote:
  If umass is in the kernel you need to rebuild. Else you kldunload umass.

I managed to crash the system again when playing with
 kldload umass and kldunload umass. But maybe the
backtrace does not make much sense, to me anyway.

[EMAIL PROTECTED] /var/crash]# cat info.4
Dump header from device /dev/ad4s4b
  Architecture: i386
  Architecture Version: 2
  Dump Length: 152387584B (145 MB)
  Blocksize: 512
  Dumptime: Tue Apr 29 20:34:58 2008
  Hostname: freebsd7.MSHOME.net
  Magic: FreeBSD Kernel Dump
  Version String: FreeBSD 7.0-RELEASE #2: Tue Apr 29 19:47:40 SGT 2008
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/custom
  Panic String: page fault
  Dump Parity: 3612086858
  Bounds: 4
  Dump Status: good

[EMAIL PROTECTED] /usr/obj/usr/src/sys/custom]# kgdb kernel.debug
/var/crash/vmcore.4
[GDB will not be able to debug user-mode threads:
/usr/lib/libthread_db.so: Undefined symbol ps_pglobal_lookup]
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for details.
This GDB was configured as i386-marcel-freebsd.

Unread portion of the kernel message buffer:

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0x8
fault code  = supervisor write, page not present
instruction pointer = 0x20:0xc4fcb2f5
stack pointer   = 0x28:0xe6fdfbf4
frame pointer   = 0x28:0xe6fdfc10
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 1376 (USB interrupt threa)
trap number = 12
panic: page fault
cpuid = 0
Uptime: 44m1s
Physical memory: 1011 MB
Dumping 145 MB: 130 114 98 82 66 50 34 18 2

#0  doadump () at pcpu.h:195
195 __asm __volatile(movl %%fs:0,%0 : =r (td));
(kgdb) list *0xc4fcb2f5
No source file for address 0xc4fcb2f5.
(kgdb) backtrace
#0  doadump () at pcpu.h:195
#1  0xc0739ac7 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:409
#2  0xc0739d89 in panic (fmt=Variable fmt is not available.
) at /usr/src/sys/kern/kern_shutdown.c:563
#3  0xc0a3fb4c in trap_fatal (frame=0xe6fdfbb4, eva=8)
at /usr/src/sys/i386/i386/trap.c:899
#4  0xc0a3fdb0 in trap_pfault (frame=0xe6fdfbb4, usermode=0, eva=8)
at /usr/src/sys/i386/i386/trap.c:812
#5  0xc0a40732 in trap (frame=0xe6fdfbb4) at /usr/src/sys/i386/i386/trap.c:490
#6  0xc0a270bb in calltrap () at /usr/src/sys/i386/i386/exception.s:139
#7  0xc4fcb2f5 in ?? ()
Previous frame inner to this frame (corrupt stack?)
(kgdb) quit

Xiaofan
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: USB Mass Storage Device with HPS Stack

2008-04-29 Thread Xiaofan Chen
On Tue, Apr 29, 2008 at 7:59 PM, Xiaofan Chen [EMAIL PROTECTED] wrote:

One more MP3 player which works under Windows XP and Linux but not
FreeBSD 7.0-Release with HPS stack.

[EMAIL PROTECTED] ~]# dmesg
...
umass1: vendor 0x10d6 USB 2.0(HS) Flash Disk, class 0/0, rev
2.00/1.00, addr 3 on usb2
umass1:  8070i (ATAPI) over Bulk-Only; quirks = 0x
umass1:1:1:-1: Attached to scbus1
da1 at umass-sim1 bus 1 target 0 lun 0
da1: USB 2.0 (HS) Flash Disk 1.00 Removable Direct Access SCSI-0 device
da1: 40.000MB/s transfers
da1: 1946MB (3987121 512 byte sectors: 255H 63S/T 248C)
(da1:umass-sim1:1:0:0): Synchronize cache failed, status == 0x4, scsi
status == 0x0

[EMAIL PROTECTED] ~]# usbdevs -v
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, OHCI root HUB(0x),
nVidia(0x), rev 1.00
 port 1 powered
 port 2 powered
 port 3 powered
 port 4 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, OHCI root HUB(0x),
nVidia(0x), rev 1.00
 port 1 powered
 port 2 powered
 port 3 powered
 port 4 powered
Controller /dev/usb2:
addr 1: high speed, self powered, config 1, EHCI root HUB(0x),
nVidia(0x), rev 1.00
 port 1 addr 3: high speed, power 500 mA, config 1, USB 2.0(HS) Flash
Disk(0x1101), vendor 0x10d6(0x10d6), rev 1.00
 port 2 powered
 port 3 powered
 port 4 powered
 port 5 powered
 port 6 powered
 port 7 powered
 port 8 addr 2: high speed, power 100 mA, config 1, Mass
Storage(0x2002), USB(0x178c), rev 2.00

port 1 addr 1 is the MP3 player, a cheap iPOD Nano clone (look-alike).
port 8 addr 2 is the National Semiconductor USB Mass Storage
device which has a read-only CDROM partition.

Xiaofan
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: USB Mass Storage Device with HPS Stack

2008-04-29 Thread Hans Petter Selasky
On Saturday 26 April 2008, Xiaofan Chen wrote:
 http://sourceforge.net/projects/pic18fusb

Hi,

This source code is not USB standard compliant and it is not good!

For example:

//Clear feature
void clear_feature(void){
parity.msdi_parity = 0; //reset ep1 in parity
UEP1bits.EPSTALL = 0;
ep0Bi.CNT = 0; //send zero length packet
ep0Bi.STAT = 0x80 | 0x40 | 0x08;

send_csw(); //send csw
}

At least this function should check which endpoint you clear the stall on.

Maybe you can get my USB stack working on your PIC board? It now supports the 
Device Side aswell as the host side! See usbd_handle_request in:

http://www.selasky.org/hans_petter/isdn4bsd/sources/src/sys/dev/usb/usb_transfer.c

Mass storage driver:

http://www.selasky.org/hans_petter/isdn4bsd/sources/src/sys/dev/usb/ustorage_fs.c

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: USB CDC-ACM device under FreeBSD and HPS stack

2008-04-29 Thread Hans Petter Selasky
On Saturday 26 April 2008, Xiaofan Chen wrote:
 Today is my FreeBSD USB day. :-)
 So I am attaching various USB device to FreeBSD and see if
 they work or not.
...

 As for the generic CDC-ACM device (the Olimex LPC-P2148), I do not know
 how to load the necessary kernel module to get it work as a usb-serial
 device.

 Under Linux, there is a generic cdc-acm device support.


kldload umodem

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: USB Mass Storage Device with HPS Stack

2008-04-29 Thread Hans Petter Selasky
On Tuesday 29 April 2008, Xiaofan Chen wrote:
 On Tue, Apr 29, 2008 at 7:59 PM, Xiaofan Chen [EMAIL PROTECTED] wrote:

 One more MP3 player which works under Windows XP and Linux but not
 FreeBSD 7.0-Release with HPS stack.

Probably your device needs a quirk.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: USB Mass Storage Device with HPS Stack

2008-04-29 Thread Xiaofan Chen
On Wed, Apr 30, 2008 at 3:59 AM, Hans Petter Selasky [EMAIL PROTECTED] wrote:
  Maybe you can get my USB stack working on your PIC board? It now supports the
  Device Side aswell as the host side! See usbd_handle_request in:

  
 http://www.selasky.org/hans_petter/isdn4bsd/sources/src/sys/dev/usb/usb_transfer.c

  Mass storage driver:

  
 http://www.selasky.org/hans_petter/isdn4bsd/sources/src/sys/dev/usb/ustorage_fs.c


The PIC18F4550 is a lowly 8-bit MCU (12MIPS, 32KB Flash, 2KB SRAM including
USB RAM). So maybe it is too low to run your USB stack's device side.
What is the minimum requirement to run your USB stack's device side?


XIaofan
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: USB CDC-ACM device under FreeBSD and HPS stack

2008-04-29 Thread Xiaofan Chen
On Wed, Apr 30, 2008 at 3:45 AM, Hans Petter Selasky [EMAIL PROTECTED] wrote:
   As for the generic CDC-ACM device (the Olimex LPC-P2148), I do not know
   how to load the necessary kernel module to get it work as a usb-serial
   device.
  
   Under Linux, there is a generic cdc-acm device support.
  

  kldload umodem

I tried that and nothing happens.


[EMAIL PROTECTED] ~]# kldload umodem
[EMAIL PROTECTED] ~]# kldstat
Id Refs AddressSize Name
 1   18 0xc040 90568c   kernel
 21 0xc0d06000 6f88 snd_ich.ko
 32 0xc0d0d000 4a5acsound.ko
 41 0xc0d58000 6a32cacpi.ko
 51 0xc4492000 22000linux.ko
 61 0xc46f7000 21000radeon.ko
 71 0xc4718000 f000 drm.ko
101 0xc4d9a000 4000 umodem.ko
111 0xc4d9f000 4000 ucom.ko
[EMAIL PROTECTED] ~]# dmesg
(nothing happens).
[EMAIL PROTECTED] ~]# kldload ugen
[EMAIL PROTECTED] ~]# dmesg
ugen0: vendor 0x10d6 USB 2.0(HS) Flash Disk, class 0/0, rev
2.00/1.00, addr 2 on usb2
ugen1: LPCUSB USBSerial, class 2/0, rev 2.00/1.00, addr 3 on usb0

[EMAIL PROTECTED] ~]# lsusb -vvv

Bus /dev/usb0 Device /dev/ugen1: ID :0005
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass2 Communications
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  idVendor   0x
  idProduct  0x0005
  bcdDevice1.00
  iManufacturer   1 LPCUSB
  iProduct2 USBSerial
  iSerial 3 DEADC0DE
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   67
bNumInterfaces  2
bConfigurationValue 1
iConfiguration  0
bmAttributes 0xc0
  Self Powered
MaxPower  100mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 2 Communications
  bInterfaceSubClass  2 Abstract (modem)
  bInterfaceProtocol  1 AT-commands (v.25ter)
  iInterface  0
  CDC Header:
bcdCDC   1.10
  CDC Call Management:
bmCapabilities   0x01
  call management
bDataInterface  1
  CDC ACM:
bmCapabilities   0x02
  line coding and serial state
  CDC Union:
bMasterInterface0
bSlaveInterface 1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0008  1x 8 bytes
bInterval  10
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   0
  bNumEndpoints   2
  bInterfaceClass10 CDC Data
  bInterfaceSubClass  0 Unused
  bInterfaceProtocol  0
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x05  EP 5 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  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
Device Status: 0x
  (Bus Powered)


Xiaofan
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to [EMAIL PROTECTED]