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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2017-08-23T04:54:13+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2017-08-23T04:54:13+02:00</updated>

		<published>2017-08-23T04:54:13+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32905#p32905</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32905#p32905"/>
		<title type="html"><![CDATA[Re: output report go right to usbfunctinowrite?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32905#p32905"><![CDATA[
Turns out I must have had a corrupt, partial or old version of the driver. I had no reason to suspect that but changing a define blew up the code. So after I re downloaded to fix that I figure I better come back to this bug. Sure enough that also fixes this issue.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed Aug 23, 2017 4:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2017-08-19T18:55:12+02:00</updated>

		<published>2017-08-19T18:55:12+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32886#p32886</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32886#p32886"/>
		<title type="html"><![CDATA[Re: output report go right to usbfunctinowrite?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32886#p32886"><![CDATA[
Interesting... It's possible that refactoring (code size improvements, but fixes) broke something. I know that it did work when it was implemented.<br /><br />The most reliable way to find out what's going on is analytic debugging. I would change the C code to make a trigger pulse on an I/O line when `usbRxToken` &lt; 0x10 is seen and trigger a storage scope with that pulse. Then I' would print the value to a serial output and view the data on the scope. You may start without a scope, just print the value in `usbRxToken` to a serial line. The project already has a debug log function which can be enabled. Only if you suspect a misinterpretation of the message, it's necessary to look at the data.<br /><br />I currently don't have the time for in-depth debugging, sorry.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sat Aug 19, 2017 6:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2017-08-19T01:52:13+02:00</updated>

		<published>2017-08-19T01:52:13+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32884#p32884</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32884#p32884"/>
		<title type="html"><![CDATA[Re: output report go right to usbfunctinowrite?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32884#p32884"><![CDATA[
I did as you suggested but still have the same issue? What can I look at to further this investigation.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Sat Aug 19, 2017 1:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2017-08-18T14:01:12+02:00</updated>

		<published>2017-08-18T14:01:12+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32879#p32879</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32879#p32879"/>
		<title type="html"><![CDATA[Re: output report go right to usbfunctinowrite?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32879#p32879"><![CDATA[
Did you make a clean build after you defined USB_CFG_IMPLEMENT_FN_WRITEOUT? I have done a code review and think that it should work. In asmcommon.inc there are the lines:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#if USB_CFG_IMPLEMENT_FN_WRITEOUT   /* if we have data for endpoint != 0, set usbCurrentTok to address */<br />    andi    x3, 0xf             ;&#91;32&#93;<br />    breq    storeTokenAndReturn ;&#91;33&#93;<br />    mov     token, x3           ;&#91;34&#93; indicate that this is endpoint x OUT<br />#endif<br /></code></pre></div><br /><br />`token` is finally stored to `usbRxToken`. It is only set to the endpoint number if asmcommon.inc has been compiled with USB_CFG_IMPLEMENT_FN_WRITEOUT defined to 1.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Fri Aug 18, 2017 2:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2017-08-14T03:44:55+02:00</updated>

		<published>2017-08-14T03:44:55+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32862#p32862</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32862#p32862"/>
		<title type="html"><![CDATA[Re: output report go right to usbfunctinowrite?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32862#p32862"><![CDATA[
Looks like we may have another bug here. <br /><br />if(usbRxToken &lt; 0x10){ /* endpoint number in usbRxToken */<br />change it to this:<br /><strong class="text-strong">if(usbRxToken == USBPID_OUT){ /* endpoint number in usbRxToken*/</strong><br /><br /><br />so this works but breaks control sets where no_msg is used. After more headaches I noticed that the return is causing the issues so I now have this. <br /><br />#if USB_CFG_IMPLEMENT_FN_WRITEOUT<br />    if(usbRxToken  == USBPID_OUT){  /* OUT to endpoint != 0: endpoint number in usbRxToken */<br />        usbFunctionWriteOut(data, len);<br />        //return;<br />    }<br /><br />this provides to be a perfect solution.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Aug 14, 2017 3:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2017-08-14T01:47:26+02:00</updated>

		<published>2017-08-14T01:47:26+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32861#p32861</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32861#p32861"/>
		<title type="html"><![CDATA[Re: output report go right to usbfunctinowrite?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32861#p32861"><![CDATA[
Ok I finally found this<br /><br />Using Interrupt- and Bulk-Out endpoints<br /><br />Interrupt- and Bulk-Out endpoints are used to send stream type data to the device. When the host sends a chunk of data on the endpoint, the function usbFunctionWriteOut() is called. If you use more than one interrupt- or bulk-out endpoint, the endpoint number is passed in the global variable usbRxToken. You must define USB_CFG_IMPLEMENT_FN_WRITEOUT to 1 in usbconfig.h when you use this feature.<br /><br /><br />Some how the driver is getting confused but this explains thing for me. It is not working but I just learned about it. Seems the usbFunctionWriteOut is never getting called, I did set<br /> #define USB_CFG_IMPLEMENT_FN_WRITEOUT   1<br />could there be an issue with having usbFunctionWriteOut  and usbFunctionWrite both defined and being used?<br /><br />my end points are <br /> 7,          /* sizeof(usbDescrEndpoint) */ <br />    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */ <br />    0x81,       // bulk IN endpoint number 1 <br />    0x03,       /* attrib: Interrupt endpoint */ <br />    8, 0,       /* maximum packet size */ <br />    0x08, /* in ms*/ <br /><br />//the output. <br /><br />    7,          // sizeof(usbDescrEndpoint) <br />    5,  // descriptor type = endpoint <br />    0x01,        // out endpoint number 2 <br />    0x03,       // attrib: Interrupt endpoint <br />    8, 0,       // maximum packet size <br />    0x08, // in ms<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Aug 14, 2017 1:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2017-08-13T22:56:41+02:00</updated>

		<published>2017-08-13T22:56:41+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32860#p32860</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32860#p32860"/>
		<title type="html"><![CDATA[output report go right to usbfunctinowrite?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10980&amp;p=32860#p32860"><![CDATA[
This is not making sense to me. I have a descriptor that uses a set, get, and 5 outputs. This descriptor is the FFB example by Microsoft. I can show all relevant code if needed but it will dramatically complete things.  I rather step my way in to this mystery question at a time. So here is what I currently see.<br /><br />gett -&gt; gets cough in usbFunctionSetup GOOD.<br />set -&gt; gets cough in usbFunctionSetup GOOD.<br />output t -&gt; gets cough in 1usbFunctionWrite HUH.<br />output 2-&gt; gets cough in 1usbFunctionWrite HUH.<br />output 2-&gt; gets cough in 1usbFunctionWrite HUH.<br />output 3-&gt; gets cough in 1usbFunctionWrite HUH.<br />output 4-&gt; gets cough in 1usbFunctionWrite HUH.<br />output 5-&gt; gets cough in 1usbFunctionWrite HUH.<br /><br />Now, to my understating you use the return USB_NO_MSG from a get or a set to run the usb function write or read. This is only needed if data exceeds 8 bytes and you can not return the payload up front. So I'm very confused how the outputs go right to 1usbFunctionWrite. I would except them to first hit usbFunctionSetup (set report). Now the output reports are bulk, maybe this is why, if so where is this explained?<br /><br /><br />Now for the part that really complicates matters. If my first get returns the size 5 (as it should based on the descriptor) none of the outputs are caught in the usbFunctionWrite . I actually have to return  USB_NO_MSG from my get report. This makes absolutely no sense because outs are not gets at all, they should be sets....<br /><br />If neither of these questions have answers then my confusion is sane. I'll add the code and see if its a programing issue and not an understanding issue. If what I typed above does make sense, what am I missing?<br /><br />to make things worse<br /><em class="text-italics">Windows sends output reports as interrupt-out data if possible and expects input reports on the interrupt-in endpoint. Only feature reports are always communicated as control transfers on endpoint 0. It is therefore advisable to use feature reports for your data.<strong class="text-strong"> We will only cover feature reports here</strong>.</em><br /><br />Isn't that a nice how do you do...<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Sun Aug 13, 2017 10:56 pm</p><hr />
]]></content>
	</entry>
	</feed>
