<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/6135" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2011-10-27T13:48:58+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/6135</id>

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2011-10-27T13:48:58+02:00</updated>

		<published>2011-10-27T13:48:58+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=6135&amp;p=20007#p20007</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=6135&amp;p=20007#p20007"/>
		<title type="html"><![CDATA[Trouble-shooting using Linux Host]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=6135&amp;p=20007#p20007"><![CDATA[
I had some problems getting a basic V-USB device working.<br />I looked at the log files on the host system (my PC), to help trouble-shoot my V-USB device.<br /><br />I'm a bit of a newbie. This post is a summary of what I learned or assumed, (and it took quite a while <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br />in the hope that it helps anyone else as a starting point.<br /><br />Good luck!<br />Mk<br /><br /><br />My host system: Linux: OpenSuSE 11.4 on a 64-bit AMD based system.<br /><br /><br />To see the USB devices connected to your system, use the command:<br />&gt; lsusb <br />Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />Bus 001 Device 002: ID 0424:2502 Standard Microsystems Corp. <br />Bus 005 Device 002: ID 045e:0745 Microsoft Corp. Nano Transceiver v1.0 for Bluetooth<br />Bus 001 Device 003: ID 0424:2504 Standard Microsystems Corp. USB 2.0 Hub<br />Bus 001 Device 004: ID 0424:223a Standard Microsystems Corp. 8-in-1 Card Reader<br />Bus 001 Device 005: ID 046d:082b Logitech, Inc. <br />Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />Bus 008 Device 013: ID 16c0:05dc VOTI shared ID for use with libusb<br /><br /><br />as you can see, each Bus has a root hub connected as Device 001.<br />We are interested in device numbers &gt; 1,<br />and in particular with the final line, which shows my V-SUB hardware device has been enumerated:<br />Bus 008 Device 013: ID 16c0:05dc VOTI shared ID for use with libusb<br /><br />Earlier, when the device was not working, I didn't get this last line.<br /><br />So I checked the host (PC) USB port and USB cable by plugging the cable into a USB device that I knew was good<br />(my AVR Dragon programmer), and confirmed that 'lsusb' generated a new line for the programmer - which it did.<br /><br /><br />When my V-USB device wasn't connecting, I looked in the system logs, <br />where you can see the kernel attempting to enumerate the USB devices when they are plugged in:<br /><br />&gt; sudo tail /var/log/messages -n100<br /><br /><br />Good result (this is what it should look like): <br /><br />Oct 27 11:55:20 linux-pn5m kernel: [ 6042.619118] usb 8-2: new low speed USB device using ohci_hcd and address 13<br />Oct 27 11:55:20 linux-pn5m kernel: [ 6042.872173] usb 8-2: New USB device found, idVendor=16c0, idProduct=05dc<br />Oct 27 11:55:20 linux-pn5m kernel: [ 6042.872182] usb 8-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0<br />Oct 27 11:55:20 linux-pn5m kernel: [ 6042.872189] usb 8-2: Product: MyProduct<br />Oct 27 11:55:20 linux-pn5m kernel: [ 6042.872194] usb 8-2: Manufacturer: MyCompany.com<br />Oct 27 11:55:20 linux-pn5m mtp-probe: checking bus 8, device 13: &quot;/sys/devices/pci0000:00/0000:00:14.4/0000:04:07.0/usb8/8-2&quot;<br />Oct 27 11:55:20 linux-pn5m mtp-probe: bus: 8, device: 13 was not an MTP device<br /><br /><br />Bad result from earlier (when failing to enumerate my V-USB hardware):<br /><br />Oct 27 11:42:30 linux-pn5m kernel: [ 5273.246152] usb 8-2: new low speed USB device using ohci_hcd and address 7<br />Oct 27 11:42:30 linux-pn5m kernel: [ 5273.410136] usb 8-2: device descriptor read/64, error -62<br />Oct 27 11:42:31 linux-pn5m kernel: [ 5273.675029] usb 8-2: device descriptor read/64, error -62<br />Oct 27 11:42:31 linux-pn5m kernel: [ 5273.933152] usb 8-2: new low speed USB device using ohci_hcd and address 8<br />Oct 27 11:42:31 linux-pn5m kernel: [ 5274.097148] usb 8-2: device descriptor read/64, error -62<br />Oct 27 11:42:31 linux-pn5m kernel: [ 5274.362124] usb 8-2: device descriptor read/64, error -62<br />Oct 27 11:42:32 linux-pn5m kernel: [ 5274.620137] usb 8-2: new low speed USB device using ohci_hcd and address 9<br />Oct 27 11:42:32 linux-pn5m kernel: [ 5275.024083] usb 8-2: device not accepting address 9, error -62<br />Oct 27 11:42:32 linux-pn5m kernel: [ 5275.181124] usb 8-2: new low speed USB device using ohci_hcd and address 10<br />Oct 27 11:42:33 linux-pn5m kernel: [ 5275.585139] usb 8-2: device not accepting address 10, error -62<br />Oct 27 11:42:33 linux-pn5m kernel: [ 5275.585160] hub 8-0:1.0: unable to enumerate USB device on port 2<br /><br /><br />Note on the first line that we have &quot;using ohci_hcd&quot;<br />this tells us which usb driver the kernel is using.<br /><br />OK - so it's detected that a new device has been plugged in,<br />and it's assigned it an address on the host (temporarily).<br />But it seems to be failing to read the device descriptor. <br />And hasn't picked up the vendor ID or product ID (which are contained in the device descriptor)<br />So this seems to be fairly early on in the process.<br /><br />I assume that 'read/64' is simply saying that the error occurred during a 64-bit read operation on the device descriptor.<br /><br /><br />If we look errno.h<br /><br />On my system, there were several errno.h files.<br />The file /usr/include/errno.h was not very helpful.<br />So then I started in /usr/include/asm/errno.h, which simply contained a #include to /usr/include/asm-generic/errno.h<br /><br />/usr/include/asm-generic/errno.h contains a list of standard error code enumerations, and tells us that error code '62' is enumerated to 'ETIME'<br />(I don't know if that's what the 'error -62' refers to - but we'll come back to that in a moment).<br /><br /><br />Kernel Documentation<br />====================<br /><br />Again, use the software package manager to check that kernel documentation is installed,<br />and to check where the files are located.<br /><br />For me, it's in /usr/src/linux-2.6.37.1-1.2/Documentation,<br />and there is a 'usb' directory in there.<br /><br /><br />Of particular interest is:<br />/usr/src/linux-2.6.37.1-1.2/Documentation/usb/error-codes.txt<br />which includes the line:<br /><br />-ETIME (**)No response packet received within the prescribed<br />bus turn-around time.  This error may instead be<br />reported as -EPROTO or -EILSEQ.<br /><br /><br />So - if the error code '-62' is 'ETIME' (from errno.h), then it seems that my hardware is not responding to the host packets at all.<br /><br /><br />Kernel source<br />=============<br /><br />Using your software package manager, check that kernel source is installed. <br />This will also show you where the files are installed.<br /><br />For me, it's in /usr/src/linux-2.6.37.1-1.2/<br />and interestingly: /usr/src/linux-2.6.37.1-1.2/drivers/usb/host<br /><br />where we find the ohci_hcd.c source file.<br /><br /><br />At this point I went back to the V-USB firmware on my AVR, and got it working.<br />So I didn't pursue the host-side any further.<p>Statistics: Posted by Guest — Thu Oct 27, 2011 1:48 pm</p><hr />
]]></content>
	</entry>
	</feed>
