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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2014-01-03T20:36:46+02:00</updated>

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

		<entry>
		<author><name><![CDATA[rszemeti]]></name></author>
		<updated>2014-01-03T20:36:46+02:00</updated>

		<published>2014-01-03T20:36:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26400#p26400</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26400#p26400"/>
		<title type="html"><![CDATA[Solved]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26400#p26400"><![CDATA[
Sorted.<br /><br />At some point I had uncommented the line:<br /><br />// #define USB_INTR_CFG MCUCR<br /><br />in usbconfig.h ... which caused it to work erratically ... for reasons not totally clear to me ... I think I did that while trying to configure for INT2<br /><br />but anyway commenting that line out again that solved it, and it runs on INT2 just fine.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20141">rszemeti</a> — Fri Jan 03, 2014 8:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rszemeti]]></name></author>
		<updated>2014-01-03T05:06:46+02:00</updated>

		<published>2014-01-03T05:06:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26397#p26397</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26397#p26397"/>
		<title type="html"><![CDATA[Re: Sometimes it does ... sometimes it doesn't]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26397#p26397"><![CDATA[
I've tried with stock 'Automator' code, stripped down to essentials, removed all the events and polling with the exception of the usbPoll(); loop ... and still get pretty much the same result ..  disconnecting the JTAG debugger and running production rather than debug code seems to make a little improvement, but maybe I'm imagining it,  but even so, just acquiring  manufacturer and product from the device fails about 25% of the time, which is core v-usb functionality, <br /><br />Seems to generally be the same -84 error .. which apparently is EILSEQ .. a CRC error. Sometimes it -71, a EPROTO  protocol error<br /><br />The USB waveform looks really crisp and is going 0V to 3.3V rail to rail, or as close as you can imagine, the 1K5 pulls up to around 3V so it looks about right.<br /><br />Just trying the standard automator 'download file' I get it to work around 50% of the time ... still seeing protocol errors when trying to probe the manufacrturer and product<br /><div class="codebox"><p>Code: </p><pre><code>f652f480 1711975673 S Ci:6:099:0 s 80 06 0301 0409 00ff 255 &lt;<br />f652f480 1711990667 C Ci:6:099:0 0 26 = 1a037700 77007700 2e006f00 62006400 65007600 2e006100 7400<br /></code></pre></div><br /><br />and next time<br /><br /><div class="codebox"><p>Code: </p><pre><code>f23a0e80 1713236684 S Ci:6:099:0 s 80 06 0301 0409 00ff 255 &lt;<br />f23a0e80 1713251665 C Ci:6:099:0 -71 26 = 1a037700 77007700 2e006f00 62006400 65007600 2e006100 7400<br /></code></pre></div><br /><br />The probe is the same, the received packet is the same, but Linux seems to think there is a protocol error ...  the notes I can find on the 'net say:<br /><br /><blockquote class="uncited"><div> 81 -EPROTO (*, **)         a) bitstuff error<br /> 82                         b) no response packet received within the<br /> 83                            prescribed bus turn-around time<br /> 84                         c) unknown USB error <br /> 85 <br /> 86 -EILSEQ (*, **)         a) CRC mismatch<br /> 87                         b) no response packet received within the<br /> 88                            prescribed bus turn-around time<br /> 89                         c) unknown USB error <br /> 90 <br /> 91                         In cases b) and c) either -EPROTO or -EILSEQ<br /> 92                         may be returned.  Note that often the controller<br /> 93                         hardware does not distinguish among cases a),<br /> 94                         b), and c), so a driver cannot tell whether<br /> 95                         there was a protocol error, a failure to respond<br /> 96                         (often caused by device disconnect), or some<br /> 97                         other fault.<br /></div></blockquote><br /><br />By the way the packets look identical, but there is a protocol error ... I would say its either timing related or something deeper in the handshake?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20141">rszemeti</a> — Fri Jan 03, 2014 5:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-01-02T19:48:19+02:00</updated>

		<published>2014-01-02T19:48:19+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26395#p26395</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26395#p26395"/>
		<title type="html"><![CDATA[Re: Sometimes it does ... sometimes it doesn't]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26395#p26395"><![CDATA[
Your modifications are a good place to start. Does the stock firmware work? Is your hardware any different? What clock source are you using?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Thu Jan 02, 2014 7:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rszemeti]]></name></author>
		<updated>2014-01-02T05:16:19+02:00</updated>

		<published>2014-01-02T05:16:19+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26394#p26394</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26394#p26394"/>
		<title type="html"><![CDATA[Sometimes it does ... sometimes it doesn't]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8784&amp;p=26394#p26394"><![CDATA[
I'm having a bit of headache with a (modified) version of Automator ... and at least part of the problem seems to be erratic comms.<br /><br />Running #lsusb -D &lt;device path&gt; or opening the device from a random Perl script will either yield the manufacturer name, or the product name, or both, or neither ... depending on how it happens to feel at the time.<br /><br />I ran usbmon and mounted the kernel debugfs and got this example of a partially failed transaction:<br /><br /><div class="codebox"><p>Code: </p><pre><code>daacee00 3258841209 S Ci:6:028:0 s 80 06 0300 0000 00ff 255 &lt;<br />daacee00 3258847165 C Ci:6:028:0 0 4 = 04030904<br />daacee00 3258847184 S Ci:6:028:0 s 80 06 0301 0409 00ff 255 &lt;<br />daacee00 3258856170 C Ci:6:028:0 -84 16 = 1a037700 77007700 2e006f00 62006400<br />f0b1d980 3258856251 S Ci:6:028:0 s 80 06 0300 0000 00ff 255 &lt;<br />f0b1d980 3258862165 C Ci:6:028:0 0 4 = 04030904<br />f0b1d980 3258862185 S Ci:6:028:0 s 80 06 0302 0409 00ff 255 &lt;<br />f0b1d980 3258873169 C Ci:6:028:0 0 20 = 14034100 75007400 6f006d00 61007400 6f007200<br />f0b1d980 3258873264 S Ci:6:028:0 s 80 06 0300 0000 00ff 255 &lt;<br />f0b1d980 3258880172 C Ci:6:028:0 0 4 = 04030904<br />f0b1d980 3258880215 S Ci:6:028:0 s 80 06 0300 0409 00ff 255 &lt;<br />f0b1d980 3258886165 C Ci:6:028:0 0 4 = 04030904<br /></code></pre></div><br /><br />the line: <br /><br />&quot;daacee00 3258856170 C Ci:6:028:0 -84 16 = 1a037700 77007700 2e006f00 62006400&quot;<br /><br />appears to be the troublesome one ... it seems to be saying its going to send 0x0A bytes, I can see it manages &quot;www.obd&quot; and then seems to crap out  ... not sure what the -84 code is  .. I guess its an error code for something?<br /><br />I've disabled other interrupts on the system, (im running on INT2, so I've cleared INT0 and INT1) .. any clues where to start looking? Its a 3.3V  system and runing through a pair of 68R into the linux box, the lines appear to go close to rail and look lovely and crisp on the scope, so I doubt it is levels ...<br /><br />The initial setup seems to go OK, I can see it finds the device and works out what it is, vendor ID, product ID etc, that all seems to go off with out a hitch .. its the later queries and anything from the fltk application that seem to be cursed ... any clues on where to begin to dig?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20141">rszemeti</a> — Thu Jan 02, 2014 5:16 am</p><hr />
]]></content>
	</entry>
	</feed>
