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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2010-11-09T13:21:03+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2010-11-09T13:21:03+02:00</updated>

		<published>2010-11-09T13:21:03+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=16590#p16590</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=16590#p16590"/>
		<title type="html"><![CDATA[Re: problem: USB HID report descriptor length - driving me nuts!]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=16590#p16590"><![CDATA[
Hi!<br />Although there has been no post for a while... I have got some similar problem with an at32uc3a microcontroller, it is doing strange things, sometimes usb works, sometimes not... do you now have some more explanations why it is now working? <br />Thanks a lot.<br />Chris<p>Statistics: Posted by Guest — Tue Nov 09, 2010 1:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[onocentaur]]></name></author>
		<updated>2010-02-27T18:55:02+02:00</updated>

		<published>2010-02-27T18:55:02+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13436#p13436</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13436#p13436"/>
		<title type="html"><![CDATA[Re: problem: USB HID report descriptor length - driving me nuts!]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13436#p13436"><![CDATA[
Yes, always <em class="text-italics">make clean</em> first...<br />Okay, so having swapped out usbdrv I'm now now longer having the problem. It's more than likely I'm an idiot. I don't know what was happening but i'm glad it stopped. I sincerely hope I won't have to post again with the same issue tomorrow  <img class="smilies" src="./../../../images/smilies/icon_redface.gif" alt=":oops:" title="Embarassed" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=3586">onocentaur</a> — Sat Feb 27, 2010 6:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2010-02-27T17:29:48+02:00</updated>

		<published>2010-02-27T17:29:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13434#p13434</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13434#p13434"/>
		<title type="html"><![CDATA[Re: problem: USB HID report descriptor length - driving me nuts!]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13434#p13434"><![CDATA[
Are you doing a clean before compile?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Sat Feb 27, 2010 5:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[onocentaur]]></name></author>
		<updated>2010-02-27T14:47:02+02:00</updated>

		<published>2010-02-27T14:47:02+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13430#p13430</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13430#p13430"/>
		<title type="html"><![CDATA[Re: problem: USB HID report descriptor length - driving me nuts!]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13430#p13430"><![CDATA[
Okay, so it was working. Now it's doing the same thing again!!<br /><br />Here's what's happening at the moment.<br />When I have the following usbHidReportDescriptor in my code:<br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; = { /* USB report descriptor */<br /><br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x04,                    // USAGE (Joystick)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x09, 0x01,                    //   USAGE (Pointer)<br />    0xa1, 0x00,                    //   COLLECTION (Physical)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />    0x09, 0x33,                    //     USAGE (Rx)<br />    0x09, 0x34,                    //     USAGE (Ry)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,              //     LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,                    //     REPORT_SIZE (8)<br />    0x95, 0x04,                    //     REPORT_COUNT (4)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x05, 0x09,                    //     USAGE_PAGE (Button)<br />    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)<br />    0x29, 0x18,                    //     USAGE_MAXIMUM (Button 24)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //     REPORT_SIZE (1)<br />    0x95, 0x18,                    //     REPORT_COUNT (24)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />     0xc0,                          // END_COLLECTION<br />  0xc0,                          //     END_COLLECTION<br />   <br />};</code></pre></div> with USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH defined as 47 in usbconfig.h, it works fine.<br /><br />Now if I adjust the desriptor to this:<br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; = { /* USB report descriptor */<br /><br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x04,                    // USAGE (Joystick)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x09, 0x01,                    //   USAGE (Pointer)<br />    0xa1, 0x00,                    //   COLLECTION (Physical)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />    0x09, 0x33,                    //     USAGE (Rx)<br />    0x09, 0x34,                    //     USAGE (Ry)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,              //     LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,                    //     REPORT_SIZE (8)<br />    0x95, 0x04,                    //     REPORT_COUNT (4)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x05, 0x09,                    //     USAGE_PAGE (Button)<br />    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)<br />    0x29, 0x10,                    //     USAGE_MAXIMUM (Button 16)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //     REPORT_SIZE (1)<br />    0x95, 0x10,                    //     REPORT_COUNT (16)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x05, 0x09,                    //     USAGE_PAGE (Button)<br />    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)<br />    0x29, 0x08,                    //     USAGE_MAXIMUM (Button 8)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //     REPORT_SIZE (1)<br />    0x95, 0x08,                    //     REPORT_COUNT (8)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />     0xc0,                          // END_COLLECTION<br />  0xc0,                          //     END_COLLECTION<br />   <br />};</code></pre></div>and set USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH to 63, then despite having the same overall reportbuffer length, then it doesn't work! I've tried numerous examples of editing the report descriptor length and code and it doesn't ever work - this is the simplest way I've though of to explain it.<br />Bizarrely, changing the descriptor has worked at least once because I've edited the code from the original PS2USB to this... If anyone can help, I'd be very grateful, this is driving me crazy!!<br /><br />UPDATE: Okay, I think I'm going insane. I just swapped the entire usbdrv subdirectory for one downloaded 'as new' from the v-usb home, and.. it worked. So, swapped back in the 'old' usbdrv to try and see wtf was going on, and.. it worked....<br />will post updates!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=3586">onocentaur</a> — Sat Feb 27, 2010 2:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[onocentaur]]></name></author>
		<updated>2010-02-26T17:06:23+02:00</updated>

		<published>2010-02-26T17:06:23+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13415#p13415</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13415#p13415"/>
		<title type="html"><![CDATA[Re: USB HID report descriptor length problem]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13415#p13415"><![CDATA[
Hmmm. I've no idea what I've done (I'm not sure I've changed anything at all!) but it now works with the correct descriptor length.<br /><br />Thanks anyway  <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=3586">onocentaur</a> — Fri Feb 26, 2010 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2010-02-26T16:20:58+02:00</updated>

		<published>2010-02-26T16:20:58+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13414#p13414</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13414#p13414"/>
		<title type="html"><![CDATA[Re: USB HID report descriptor length problem]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13414#p13414"><![CDATA[
its 0, but I think its done that way so that it can be set in the PROGMEM array. I derived this from another project. But I would think you can set USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH to 8 if your set up is done that way.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Fri Feb 26, 2010 4:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[onocentaur]]></name></author>
		<updated>2010-02-26T09:17:26+02:00</updated>

		<published>2010-02-26T09:17:26+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13413#p13413</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13413#p13413"/>
		<title type="html"><![CDATA[Re: USB HID report descriptor length problem]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13413#p13413"><![CDATA[
Thanks for the reply.<br />So you've just not used USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH when actually defining your descriptor? Interesting, I'll try that later.<br />What does your usbconfig.h have for USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=3586">onocentaur</a> — Fri Feb 26, 2010 9:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2010-02-26T00:05:14+02:00</updated>

		<published>2010-02-26T00:05:14+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13405#p13405</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13405#p13405"/>
		<title type="html"><![CDATA[Re: USB HID report descriptor length problem]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13405#p13405"><![CDATA[
I have done the same thing, my code adds pressure buttons, guitar hero support, and I ripped out the pad. I wont post it as its very large and not what you asked but few things..<br /><br />here is my report<br /><div class="codebox"><p>Code: </p><pre><code>const char analog_usbHidReportDescriptor&#91;&#93; PROGMEM = {<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x05,                    // USAGE (Gamepad)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />   <br />    0x09, 0x01,                    //   USAGE (Pointer)    <br />   0xa1, 0x00,                    //   COLLECTION (Physical)<br />   0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />   <br />   0x09, 0x33,                  //     USAGE (Rx)<br />   0x09, 0x34,                  //     USAGE (Ry)<br /><br />   0x09, 0x35,                  //     USAGE (Rz)   <br />   0x09, 0x36,                  //     USAGE (Slider)   <br /><br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x26, 0xFF, 0x00,              //     LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,                    //     REPORT_SIZE (8)<br />    0x95, 0x06,                    //     REPORT_COUNT (6)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />   0xc0,                          //   END_COLLECTION (Physical)<br /><br />    0x05, 0x09,                    //   USAGE_PAGE (Button)<br />    0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)<br />    0x29, 0x10,                    //   USAGE_MAXIMUM (Button 14)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //   REPORT_SIZE (1)<br />    0x95, 0x10,                    //   REPORT_COUNT (16)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br /><br />    0xc0<br />};</code></pre></div><br /><br />I use a REPORT SIZEof 8, The way they do two reports is by using the first byte as the ID, a 1 or 0. So you need to bump down all reports..<br /><br />example:<br /><br />reportBuffer[1] will be reportBuffer[0]<br />reportBuffer[2] will be reportBuffer[1]<br />reportBuffer[3] will be reportBuffer[2]<br /><br />etc..<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Fri Feb 26, 2010 12:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[onocentaur]]></name></author>
		<updated>2010-02-27T14:39:33+02:00 </updated>

		<published>2010-02-25T22:21:54+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13404#p13404</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13404#p13404"/>
		<title type="html"><![CDATA[problem: USB HID report descriptor length - driving me nuts!]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3937&amp;p=13404#p13404"><![CDATA[
Hi,<br />I'm working on a usb game controller, based on the PS2USB v2 example project:  <a href="http://vusb.wikidot.com/project:ps2usb" class="postlink">http://vusb.wikidot.com/project:ps2usb</a>. My coding and AVR skills are limited so I don't exactly know what I'm doing...<br />Anyway, first step is to modify the code to deal with only one controller - simple, just remove the 2nd pad setup and output functions, and remove half the USB HID report descriptor. Now this <strong class="text-strong">works</strong>, but <em class="text-italics">only</em> if I set USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH to 99 or more in usbconfig.h, despite the descriptor being only 63 long:<br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; = { /* USB report descriptor */<br /><br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x04,                    // USAGE (Joystick)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x09, 0x01,                    //   USAGE (Pointer)<br />    0xa1, 0x00,                    //   COLLECTION (Physical)<br />    0x85, 0x01,                    //     REPORT_ID (1)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x25, 0x0f,                    //     LOGICAL_MAXIMUM (15)<br />    0x75, 0x04,                    //     REPORT_SIZE (4)<br />    0x95, 0x02,                    //     REPORT_COUNT (2)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x09, 0x32,                    //     USAGE (Z)<br />    0x09, 0x33,                    //     USAGE (Rx)<br />    0x09, 0x34,                    //     USAGE (Ry)<br />    0x09, 0x35,                    //     USAGE (Rz)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,              //     LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,                    //     REPORT_SIZE (8)<br />    0x95, 0x04,                    //     REPORT_COUNT (4)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x05, 0x09,                    //     USAGE_PAGE (Button)<br />    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)<br />    0x29, 0x10,                    //     USAGE_MAXIMUM (Button 16)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //     REPORT_SIZE (1)<br />    0x95, 0x10,                    //     REPORT_COUNT (16)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0xc0,                          //     END_COLLECTION<br />    0xc0,                          // END_COLLECTION<br /><br />};</code></pre></div><br />If I set the descriptor length to 98 or less, then the usb device does not appear in /dev/input (it appears as /dev/input/js0 when set to any value 99-126 - haven't tried larger than 126). <br /> Am I missing something obvious? Can anyone help?! Thanks!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=3586">onocentaur</a> — Thu Feb 25, 2010 10:21 pm</p><hr />
]]></content>
	</entry>
	</feed>
