On Sat, 16 Jun 2007, Stephan Esterhuizen wrote:

> I just finished a PCB design with the Cypress FX2LP (CY7C68013A-100AC).
> When I plug the device into a linux box, I get "device not accepting
> address" errors. 
> 
> Since this is such a simple interface: Power up FX2 and connect D+/D-/GND
> to host controller, I suspect that the problem might be with my D- and D+
> traces, but would like other people's input. Please see below for dmesg
> and usbmon output.
> 
> I have a few questions:
> 
> 1) I tried decoding the setup packets but it is not a 'standard device
> request' but a 'class request', shouldn't it be the former or am I missing
> something?

Which setup packets?  The ones in your usbmon logs?  None of those in
the first log were sent to the fx2lp.

> 2) Is the fx2lp actually working? I suspect it is because according to
> usbmon, the fx2lp responded to the first setup packet with:
> 
> e89de2c0 1532923663 C Ci:001:00 0 4 = 01050100

No, that response came from the root hub, not from the fx2lp.  It's 
fair to say that your tests show the fx2lp is _not_ working.

> 3) If the fx2lp is actually responding to usb requests, why is it not
> accepting the address the host is trying to assign to it?

It isn't responding to USB requests.

> I have a slew of other fx2lp devices which all work, this is the first
> one that is on a custom PCB. When examining D-/D+ on a scope, things look
> fine.
> 
> Any insight will be greatly appreciated.
> 
> ---------- dmesg -------------
> Jun 13 13:29:15 toga2 kernel: usb 1-1: device not accepting address 15,
> error -71 
> Jun 13 13:29:15 toga2 kernel: usb 1-1: new full speed USB device using
> uhci_hcd and address 16 
> Jun 13 13:29:15 toga2 kernel: usb 1-1: uhci_result_common: failed with
> status 440000 
> Jun 13 13:29:15 toga2 kernel: usb 1-1: uhci_result_common: failed with
> status 440000 
> Jun 13 13:29:15 toga2 kernel: usb 1-1: device not accepting address 16,
> error -71 
> Jun 13 13:29:15 toga2 kernel: hub 1-0:1.0: state 7 ports 2 chg 0000 evt
> 0002 
> ------------------------------

If you had enabled USB debugging in your kernel you might have seen 
more useful messages than just these.

And why do you label this output as "dmesg"?  It obviously is from a 
log file created by syslogd, not from dmesg.

> ---------- dmesg (high verbosity) -------------
> Jun 16 09:49:18 toga2 kernel: usb 1-1: uhci_result_common: failed with status 
> 440000
> Jun 16 09:49:18 toga2 kernel: [f78f46c0] CTL QH link (378f4422) element 
> (37dd5240)
> Jun 16 09:49:18 toga2 kernel: urb_priv [e37b4330] urb [f77ce1c0] qh 
> [f78f46c0] Dev=0 EP=0(IN) CTL Actlen=0
> Jun 16 09:49:18 toga2 kernel:     1: [f7dd5240] link (37dd51b0) e0 Stalled 
> CRC/Timeo Length=7 MaxLen=7 DT0 EndPt=0 Dev=0, PID=2d(SETUP) (buf=35e87d80)
> Jun 16 09:49:18 toga2 kernel:     2: [f7dd51b0] link (37dd51e0) e3 SPD Active 
> Length=0 MaxLen=3f DT1 EndPt=0 Dev=0, PID=69(IN) (buf=37a53e80)
> Jun 16 09:49:18 toga2 kernel:     3: [f7dd51e0] link (37dd5270) e3 IOC Active 
> Length=0 MaxLen=7ff DT1 EndPt=0 Dev=0, PID=e1(OUT) (buf=00000000)
> Jun 16 09:49:18 toga2 kernel:   Dummy TD
> Jun 16 09:49:18 toga2 kernel: [f7dd5270] link (37dd51b0) e0 Length=0
> MaxLen=7ff DT0 EndPt=0 Dev=0, PID=e1(OUT) (buf=00000000)
> 
> ------------------------------

The first thing to ask is whether you expect the fx2lp to run at high 
speed or at full speed?  The UHCI driver shown in the messages above 
does not handle high-speed devices.

> --------- usbmon -------------
> f7dd8840 1483781836 C Ii:001:01 0 2 = 0200
> f7dd8840 1483781854 S Ii:001:01 -115 2 <
> e89deac0 1483781878 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89deac0 1483781892 C Ci:001:00 0 4 = 01050100

On the other hand, this message shows a port status with the high-speed
status bit turned on, indicating it came from the EHCI driver and not
the UHCI driver.

> e89deac0 1483781897 S Co:001:00 s 23 01 0010 0001 0000 0
> e89deac0 1483781902 C Co:001:00 0 0
> e89deac0 1483781909 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89deac0 1483781913 C Ci:001:00 0 4 = 01050000
> e89deac0 1483813891 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89deac0 1483813900 C Ci:001:00 0 4 = 01050000
> e89deac0 1483845835 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89deac0 1483845843 C Ci:001:00 0 4 = 01050000
> e89deac0 1483877834 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89deac0 1483877841 C Ci:001:00 0 4 = 01050000
> e89deac0 1483909898 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89deac0 1483909906 C Ci:001:00 0 4 = 01050000

The portion above shows the root-hub port being debounced.

> e89deac0 1483909927 S Co:001:00 s 23 03 0004 0001 0000 0
> e89deac0 1483909933 C Co:001:00 0 0

The hub driver does a port reset.

> e89deac0 1483965835 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89deac0 1483966025 C Ci:001:00 0 4 = 00001000

The port status after the reset shows that the device is no longer 
connected to the EHCI controller.  This is normal behavior for 
full-speed devices but not for high-speed devices.

> e89deac0 1483966030 S Co:001:00 s 23 01 0014 0001 0000 0
> e89deac0 1483966034 C Co:001:00 0 0
> e89deac0 1483966038 S Co:001:00 s 23 01 0001 0001 0000 0
> e89deac0 1483966042 C Co:001:00 0 0
> e89deac0 1483966050 S Co:001:00 s 23 01 0001 0001 0000 0
> e89deac0 1483966053 C Co:001:00 0 0

The rest of this shows the hub driver cleaning up after a failed 
connection attempt.

> -------------------------
> 
> And as an example of what usbmon displays for another fx2 device that
> works properly:
> 
> --------- usbmon (development FX2, device works properly) -------------
> f7dd8840 1532923596 C Ii:001:01 0 2 = 0200
> f7dd8840 1532923618 S Ii:001:01 -115 2 <
> e89de2c0 1532923647 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89de2c0 1532923663 C Ci:001:00 0 4 = 01050100
> e89de2c0 1532923667 S Co:001:00 s 23 01 0010 0001 0000 0
> e89de2c0 1532923674 C Co:001:00 0 0
> e89de2c0 1532923682 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89de2c0 1532923685 C Ci:001:00 0 4 = 01050000
> e89de2c0 1532955586 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89de2c0 1532955595 C Ci:001:00 0 4 = 01050000
> e89de2c0 1532987566 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89de2c0 1532987575 C Ci:001:00 0 4 = 01050000
> e89de2c0 1533019585 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89de2c0 1533019593 C Ci:001:00 0 4 = 01050000
> e89de2c0 1533051583 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89de2c0 1533051591 C Ci:001:00 0 4 = 01050000
> e89de2c0 1533051613 S Co:001:00 s 23 03 0004 0001 0000 0
> e89de2c0 1533051619 C Co:001:00 0 0
> e89de2c0 1533107573 S Ci:001:00 s a3 00 0000 0001 0004 4 <
> e89de2c0 1533107803 C Ci:001:00 0 4 = 03051000

Here is the point where this trace diverges from the previous one.  It 
shows the device has reset properly and is operating at high speed.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to