<?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/3070" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2015-12-15T06:13:47+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2015-12-15T06:13:47+02:00</updated>

		<published>2015-12-15T06:13:47+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=30618#p30618</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=30618#p30618"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=30618#p30618"><![CDATA[
Not sure I follow this here but I'm getting this in linux.<br /><br /> Configuration Descriptor:<br />    bLength                 9<br />    bDescriptorType         2<br />    wTotalLength           41<br />    bNumInterfaces          1<br />    bConfigurationValue     1<br />    iConfiguration          0<br />    bmAttributes         0x00<br />      (Missing must-be-set bit!)<br />      (Bus Powered)<br />    MaxPower              224mA<br /><br />This looks bad to me, why are we clearing the bit exactly? Or is linux using older code and reading as 1.0 instead of 1.1?<br /><br />Sorry for the huge bump but it seem best to use this post.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Tue Dec 15, 2015 6:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2009-08-24T12:27:16+02:00</updated>

		<published>2009-08-24T12:27:16+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10643#p10643</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10643#p10643"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10643#p10643"><![CDATA[
We have released a new version of the driver yesterday. I doubt that it fixes your particular problem, though, since it fixes bugs in the 12.8 and 16 MHz modules only.<br /><br />If the bugs occur with all clock frequencies, the problem must be in the common code, not in the low level bitbanging stuff. It's either in the concepts (buffer swapping, ACK/NAK handling) or in the usbdrv.c module. These are much easier to understand than the low level bitbanging.<br /><br />In any case, you can enable debugging code by compiling with -DDEBUG_LEVEL=2. Debug output is sent through the USART at 19200 bps. To see what a particular debug print means, search usbdrv.c for DBG1 and DBG2 macros. The first parameter to the macro is the first hex number printed. There are debug logs for all received and all transmitted messages. Be careful, though: Transmitted messages are printed when they are written to the buffer, not when they are fetched by the host. If the transfer stalls, the last tx message may never have been fetched.<br /><br />For fine grained debugging, I usually toggle port pins in particular positions and connect a storage scope.<br /><br />Regards, Christian.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Mon Aug 24, 2009 12:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2009-08-23T17:04:23+02:00</updated>

		<published>2009-08-23T17:04:23+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10624#p10624</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10624#p10624"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10624#p10624"><![CDATA[
Hi,<br /><br />You're wellcome.<br /><br />What I read within the usb spec was that the topmost bit should always be set to one for historical reasons, that's what I found out after diging into that error from lsusb (which didn't notice at the time of my last post, but was also showing up on wireshark)<br /><br />However, the trick lasted very little.<br /><br />I'm still back to the same situation, where I can turn the led on, perform a read-stress test without failure, query it's status, but as soon as I turn the led back off, I get a &quot;wrong multi-byte sequence&quot; error, and from there on and till I replug the device, any request gets a &quot;protocol error&quot; message as answer.<br /><br />This is something I've also noticed using usbtiny as well as vusb with different clock rates. <br /><br />Strange is that with same hardware, I cun run the hid-mouse example without a problem (that one also shipped with vusb, which makes the pointer go in circles arround the screen).<br /><br />It looks like as if some buffer weren't getting clean before the second request arrives or something like that.<br /><br />Unfortunately, though I've been these last days reading up on usb, doesn't matter how many times I look at the code, I can't even get to understand how the first (KJKJKJKK, sync sequence) is achieved by carefully studying the assembler source!<br /><br />It's getting a bit painful to get this up and running without any debugging form available other than a led! hehe.<br /><br />Well, thanks.<p>Statistics: Posted by Guest — Sun Aug 23, 2009 5:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2009-08-22T12:23:22+02:00</updated>

		<published>2009-08-22T12:23:22+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10617#p10617</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10617#p10617"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10617#p10617"><![CDATA[
Thanks for the hint! USB 1.0 declared the bmAttributes field as with values<br /><div class="codebox"><p>Code: </p><pre><code>#define USBATTR_BUSPOWER        0x80<br />#define USBATTR_SELFPOWER       0x40<br />#define USBATTR_REMOTEWAKE      0x20<br /></code></pre></div><br />while USB 1.1 seems to define USBATTR_BUSPOWER as mandatory.<br /><br />I'll change the driver accordingly. Thanks!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sat Aug 22, 2009 12:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2009-08-21T20:25:07+02:00</updated>

		<published>2009-08-21T20:25:07+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10613#p10613</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10613#p10613"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10613#p10613"><![CDATA[
Hi,<br /><br />It was indeed a different issue.<br /><br />Remeber I was using the custom-class example shiphed with vusb? a lsusb for this device showed  this message:<br /><br />(Missing must-be-set bit!)<br /><br />Then, I just set the topmost byte to one within usbdrv.c:<br /><br />    (1&lt;&lt;7) |<br />#if USB_CFG_IS_SELF_POWERED<br />    USBATTR_SELFPOWER,      /* attributes */<br />#else<br />    (char)USBATTR_BUSPOWER, /* attributes */<br />#endif<br /><br />And that was all!!<br /><br />Now I can turn the led on, query the status, and turn it back off without getting a `protocol-error' message from the host.<br /><br />Now everything works as expected, it works so reliably, can't understand why nobody else (which uses linux) was getting the same as me, though.<br /><br />Thanks.<p>Statistics: Posted by Guest — Fri Aug 21, 2009 8:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mschoeldgen]]></name></author>
		<updated>2009-08-21T08:37:01+02:00</updated>

		<published>2009-08-21T08:37:01+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10607#p10607</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10607#p10607"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10607#p10607"><![CDATA[
Thanks to Michael !<br />This fix finally got rid of the erratic coordinates i encountered with my Tablet Adapter :<br /><!-- l --><a class="postlink-local" href="http://forums.obdev.at/viewtopic.php?f=8&amp;t=2765">viewtopic.php?f=8&amp;t=2765</a><!-- l --><br />Initilally i though the tablet to be responsible for those errors. Thanks again <img class="smilies" src="./../../../images/smilies/icon_biggrin.gif" alt=":D" title="Very Happy" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2242">mschoeldgen</a> — Fri Aug 21, 2009 8:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2009-08-13T10:43:48+02:00</updated>

		<published>2009-08-13T10:43:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10530#p10530</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10530#p10530"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10530#p10530"><![CDATA[
This must be a different issue. I have tested the 20 MHz version with test patterns which enforce bit stuffing at always the same bit. I have tested all bits this way.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Thu Aug 13, 2009 10:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2009-08-13T00:07:06+02:00</updated>

		<published>2009-08-13T00:07:06+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10522#p10522</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10522#p10522"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10522#p10522"><![CDATA[
Hi,<br /><br />I find the same problem with 20mhz.<br /><br />The host enumerates de device properly, the `set-led' application can turn the led on, it can also get device's status, but as soon as I try to turn the led off, the usb_control_msg returns with an error (sometines the led is effectively turned off, sometimes not).<br /><br />From there on, all I get when trying to do anything else is a protocol error from the same function, and I have to reconnect the device for it work again.<br /><br />I have enabled the`test' option, though, and it passes it without a single error.<br /><br />Regards,<p>Statistics: Posted by Guest — Thu Aug 13, 2009 12:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Michael]]></name></author>
		<updated>2009-08-11T13:00:47+02:00</updated>

		<published>2009-08-11T13:00:47+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10489#p10489</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10489#p10489"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10489#p10489"><![CDATA[
This fixes the bug, now the usb communication works like a charm.<br /><br />Thanks for the quick response.<br /><br />Greetings!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2594">Michael</a> — Tue Aug 11, 2009 1:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2009-08-09T21:04:16+02:00</updated>

		<published>2009-08-09T21:04:16+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10444#p10444</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10444#p10444"/>
		<title type="html"><![CDATA[Re: Possible bug in V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3070&amp;p=10444#p10444"><![CDATA[
Did not take THAT long to track down: The unstuffing code for bit 6 was ca. one cycle too long. The error summed up if multiple unstuffings occurred in bit 6 until we were out of sync.<br /><br />You can fix the issue by changing the code in usbdrvasm16.inc:<br /><div class="codebox"><p>Code: </p><pre><code>unstuff6:<br />    andi    x2, USBMASK ;&#91;03&#93;<br />    ori     x3, 1&lt;&lt;6    ;&#91;04&#93; will not be shifted any more<br />    andi    shift, ~0x80;&#91;05&#93;<br />    mov     x1, x2      ;&#91;06&#93; sampled bit 7 is actually re-sampled bit 6<br />    subi    leap, 3     ;&#91;07&#93; since this is a short (10 cycle) bit, enforce leap bit<br />    rjmp    didUnstuff6 ;&#91;08&#93;<br /></code></pre></div><br /><br />to<br /><div class="codebox"><p>Code: </p><pre><code>unstuff6:<br />    andi    x2, USBMASK ;&#91;03&#93;<br />    ori     x3, 1&lt;&lt;6    ;&#91;04&#93; will not be shifted any more<br />    andi    shift, ~0x80;&#91;05&#93;<br />    mov     x1, x2      ;&#91;06&#93; sampled bit 7 is actually re-sampled bit 6<br />    subi    leap, -1    ;&#91;07&#93; total duration = 11 bits -&gt; subtract 1/3<br />    rjmp    didUnstuff6 ;&#91;08&#93;<br /></code></pre></div><br /><br />The other unstuffing routines need a fix, too, but the error is not big enough to cause any problems when it sums up.<br /><br />This will be fixed in the next release.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sun Aug 09, 2009 9:04 pm</p><hr />
]]></content>
	</entry>
	</feed>
