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

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

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

		<entry>
		<author><name><![CDATA[rowaweb]]></name></author>
		<updated>2007-06-01T17:03:36+02:00</updated>

		<published>2007-06-01T17:03:36+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=492&amp;p=1441#p1441</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1441#p1441"/>
		<title type="html"><![CDATA[Cant manage to receive Report &gt; 8 byte]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1441#p1441"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>Can you arrange for SOME kind of debugging output? If not by UART, then maybe at least a port pin which you can toggle when usbFunctionWrite is called and or something like that.</div></blockquote><br /><br />My thanks to a LED i could connect. usbFunctionWrite() is entered excactly 8 times (64 bytes report length). i had a pointer error  <img class="smilies" src="./../../../images/smilies/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /> <br /><br />thanks for your support. Works out perfect.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=270">rowaweb</a> — Fri Jun 01, 2007 5:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-05-31T22:47:35+02:00</updated>

		<published>2007-05-31T22:47:35+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=492&amp;p=1436#p1436</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1436#p1436"/>
		<title type="html"><![CDATA[Cant manage to receive Report &gt; 8 byte]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1436#p1436"><![CDATA[
I can't see an obvious bug at the first glance. But when you can't find the bug where you are searching, you are probably searching in the wrong place.<br /><br />Can you arrange for SOME kind of debugging output? If not by UART, then maybe at least a port pin which you can toggle when usbFunctionWrite is called and or something like that.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Thu May 31, 2007 10:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-05-31T19:45:54+02:00</updated>

		<published>2007-05-31T19:45:54+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=492&amp;p=1435#p1435</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1435#p1435"/>
		<title type="html"><![CDATA[Cant manage to receive Report &gt; 8 byte]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1435#p1435"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>Maybe I should append:<br /><br />usbFunctionWrite() is called multiple times with chunks of up to 8 bytes until all 64 bytes are transferred.</div></blockquote><br /><br />That does depend on the return value, right? I return 0 if i want to receive more bytes....  my usbFunctionWrite()  should exactly behave like this, but obviously it doenst <img class="smilies" src="./../../../images/smilies/icon_sad.gif" alt=":(" title="Sad" /><br /><br />I got no UART tool and no debug-tools on chip, so its hard to know whats going on there... Does the code itself look good?<br /><br />Thanks<p>Statistics: Posted by Guest — Thu May 31, 2007 7:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-05-31T19:24:28+02:00</updated>

		<published>2007-05-31T19:24:28+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=492&amp;p=1433#p1433</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1433#p1433"/>
		<title type="html"><![CDATA[Cant manage to receive Report &gt; 8 byte]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1433#p1433"><![CDATA[
Maybe I should append:<br /><br />usbFunctionWrite() is called multiple times with chunks of up to 8 bytes until all 64 bytes are transferred.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Thu May 31, 2007 7:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2007-05-31T09:55:51+02:00</updated>

		<published>2007-05-31T09:55:51+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=492&amp;p=1429#p1429</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1429#p1429"/>
		<title type="html"><![CDATA[Cant manage to receive Report &gt; 8 byte]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1429#p1429"><![CDATA[
Well..<br /><br /><blockquote><div><cite>Device Class Definition for Human Interface Devices (HID) V1.11 wrote:</cite><strong class="text-strong">5.6 Reports</strong><br /><br />Using USB terminology, a device may send or receive a transaction every USB frame (1 millisecond). A transaction may be made up of multiple packets (token, data, handshake) <em class="text-italics"><strong class="text-strong">but is limited in size to 8 bytes for low-speed devices and 64 bytes for high-speed devices</strong></em>. A transfer is one or more transactions creating a set of data that is meaningful to the device—for example, Input, Output, and Feature reports. In this document, a transfer is synonymous with a report.<br /><br />Most devices generate reports, or transfers, by returning a structure in which each data field is sequentially represented. However, some devices may have multiple report structures on a single endpoint, each representing only a few data fields. For example, a keyboard with an integrated pointing device could independently report “key press” data and “pointing” data over the same endpoint. Report ID items are used to indicate which data fields are represented in each report structure. A Report ID item tag assigns a 1-byte identification prefix to each report transfer. If no Report ID item tags are present in the Report descriptor, it can be assumed that only one Input, Output, and Feature report structure exists and together they represent all of the device’s data.<br /><br />If a device has multiple report structures, all data transfers start with a 1-byte identifier prefix that indicates which report structure applies to the transfer. This allows the class driver to distinguish incoming pointer data from keyboard data by examining the transfer prefix.</div></blockquote><br /><br />AVR-USB implements a low speed device.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Thu May 31, 2007 9:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rowaweb]]></name></author>
		<updated>2007-05-31T00:53:05+02:00</updated>

		<published>2007-05-31T00:53:05+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=492&amp;p=1428#p1428</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1428#p1428"/>
		<title type="html"><![CDATA[Cant manage to receive Report &gt; 8 byte]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=492&amp;p=1428#p1428"><![CDATA[
Hi,<br /><br />im using ur code for usb implementation and i got a report descriptor like this:<br /><br /><div class="codebox"><p>Code: </p><pre><code>&#40;...&#41;<br />    0x09, 0x00,                    //   USAGE &#40;Undefined&#41;<br />    0xb1, 0x02,                    //   FEATURE &#40;Data,Var,Abs&#41;<br />    0x85, 0x04,                    //   REPORT_ID &#40;4&#41;<br />    0x95, 0x40,                    //   REPORT_COUNT &#40;64&#41;<br />    0x09, 0x00,                    //   USAGE &#40;Undefined&#41;<br />    0xb1, 0x02,                    //   FEATURE &#40;Data,Var,Abs&#41;<br /></code></pre></div><br /><br />This means, i get 1 byte report-id and another 63 for data usage.<br /><br /><div class="codebox"><p>Code: </p><pre><code><br />static uchar   textBuffPtr=0;<br />static uchar   textBuffer&#91;63&#93;= &#123; ... &#125;<br /><br />uchar   usbFunctionSetup&#40;uchar data&#91;8&#93;&#41;<br />...<br />       &#125; else if &#40;rq-&gt;bRequest == USBRQ_HID_SET_REPORT&#41; &#123;<br />         if &#40;rq-&gt;wValue.bytes&#91;0&#93; == 4&#41; &#123;<br />            // set 63 byte custom<br />                        state = STATE_WRITE_KEYBUFFER;   // prepared to receive data<br />         textBuffPtr = 0;<br />                        usbWriteLen = rq-&gt;wLength.word; // length of Report<br />                        return 0xff;<br />&#125;<br />...<br /></code></pre></div><br /><br />My write function looks like this:<br /><br /><div class="codebox"><p>Code: </p><pre><code>uchar usbFunctionWrite&#40;uchar *data, uchar len&#41;<br />&#123;<br /><br />  uchar i;<br />  <br />  if &#40;state == STATE_WRITE_KEYBUFFER&#41; &#123;<br />   if &#40;usbWriteLen == 1+63&#41;     // first chunk to receive<br />   &#123;<br />      data++;<br />      len--;<br />   &#125;<br />   <br />   // to be safe &#40;###&#41;<br />   if &#40;len &gt; usbWriteLen&#41; len = usbWriteLen;<br />   <br />   for&#40;i=0; i&lt;len; i++&#41; &#123;<br />      textBuffPtr++;<br />      textBuffer&#91;textBuffPtr&#93; = data&#91;i&#93;;<br />      usbWriteLen--;<br />   &#125;<br />   <br />   <br />   // return 0 if more data expected<br />   if &#40;usbWriteLen&#41; return 0;<br /><br />   state = STATE_IDLE;<br />   textBuffPtr = 0;<br />   <br />   return 1;   <br />  &#125;<br /></code></pre></div><br /><br />Any suggestions? Im using a windows tool set SET_REPORT and it works out, but it only sets the first 7 byte of data and i cant see why.<br /><br />Thanks in advance...<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=270">rowaweb</a> — Thu May 31, 2007 12:53 am</p><hr />
]]></content>
	</entry>
	</feed>
