<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>HID Example for MCBSTM32E change ReportDescriptor</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/27918/hid-example-for-mcbstm32e-change-reportdescriptor</link><description> 
Hello everybody, 

 
i have here an MCBSTM32E and i tried to write my own HID client on
the PC. 
It worked already fine but now i want to send more then just one
Byte. But i dont know how i have to change the ReportDescriptor on
the Board and which</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: HID Example for MCBSTM32E change ReportDescriptor</title><link>https://community.arm.com/thread/78720?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2010 05:02:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:af81981d-2b7e-4c61-9392-0d9b204df968</guid><dc:creator>Mathias D</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Tsuneo,&lt;/p&gt;

&lt;p&gt;
thanks for you answer. I read the Topic and changed the
HID-Example of the MCBSTM32E like you wrote there.&lt;br /&gt;
But i still have some problems.&lt;br /&gt;
This is my ReportDescriptor&lt;/p&gt;

&lt;pre&gt;
usbdesc.c

#define HID_INPUT_REPORT_BYTES       64              /* size of report in Bytes */
#define HID_OUTPUT_REPORT_BYTES      1              /* size of report in Bytes */
#define HID_FEATURE_REPORT_BYTES     1              /* size of report in Bytes */

const U8 HID_ReportDescriptor[] = {
  HID_UsagePageVendor( 0x00                     ),
  HID_Usage          ( 0x01                     ),
  HID_Collection     ( HID_Application          ),
    HID_LogicalMin   ( 0                        ),  /* value range: 0 - 0xFF */
    HID_LogicalMaxS  ( 0xFF                     ),
    HID_ReportSize   ( 8                        ),  /* 8 bits */
    HID_ReportCount  ( HID_INPUT_REPORT_BYTES   ),
    HID_Usage        ( 0x01                     ),
    HID_Input        ( HID_Data | HID_Variable | HID_Absolute ),
    HID_ReportCount  ( HID_OUTPUT_REPORT_BYTES  ),
    HID_Usage        ( 0x01                     ),
    HID_Output       ( HID_Data | HID_Variable | HID_Absolute ),
    HID_ReportCount  ( HID_FEATURE_REPORT_BYTES ),
    HID_Usage        ( 0x01                     ),
    HID_Feature      ( HID_Data | HID_Variable | HID_Absolute ),
  HID_EndCollection,
};

/* USB Configuration Descriptor */
/*   All Descriptors (Configuration, Interface, Endpoint, Class, Vendor) */
const U8 USB_ConfigDescriptor[] = {
...

/* Endpoint, HID Interrupt In */
  USB_ENDPOINT_DESC_SIZE,            /* bLength */
  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
  USB_ENDPOINT_IN(1),                /* bEndpointAddress */
  USB_ENDPOINT_TYPE_INTERRUPT,       /* bmAttributes */
  WBVAL(0x0040),                     /* wMaxPacketSize */
  0x20,          /* 32ms */          /* bInterval */
/* Terminator */
  0                                  /* bLength */
};
&lt;/pre&gt;

&lt;p&gt;
The variable InReport i defined like this:&lt;/p&gt;

&lt;pre&gt;
main.c

U8 InReport[HID_INPUT_REPORT_BYTES];
&lt;/pre&gt;

&lt;p&gt;
But when i try to compile i get two errors.&lt;br /&gt;
Both here:&lt;/p&gt;

&lt;pre&gt;
usbuser.c

#if USB_CONFIGURE_EVENT
void USB_Configure_Event (void) {

  if (USB_Configuration) {                   /* Check if USB is configured */
    GetInReport();
    USB_WriteEP(HID_EP_IN, &amp;amp;InReport, sizeof(InReport));
  }
}
#endif

/*
 *  USB Endpoint 1 Event Callback
 *   Called automatically on USB Endpoint 1 Event
 *    Parameter:       event
 */

void USB_EndPoint1 (U32 event) {

  switch (event) {
    case USB_EVT_IN:
      GetInReport();
      USB_WriteEP(HID_EP_IN, &amp;amp;InReport, sizeof(InReport));
      break;
  }
}
&lt;/pre&gt;

&lt;p&gt;
The problem is the &amp;amp;InReport but what should i write here
instead? Just InReport oder &amp;amp;InReport[0]?&lt;/p&gt;

&lt;p&gt;
The same here:&lt;/p&gt;

&lt;pre&gt;
hiduser.c

BOOL HID_GetReport(void){

  /*ReportID = SetupPacket.wValue.WB.L; */
  switch (SetupPacket.wValue.WB.H){
    case HID_REPORT_INPUT:
      GetInReport();
      EPOBuf[0] = InReport;
      break;
    case HID_REPORT_OUTPUT:
      return (__FALSE);     /*Not Supported*/
    case HID_REPORT_FEATURE:
      return (__FALSE);     /*Not Supported*/
  }
  return (__TRUE)
}
&lt;/pre&gt;

&lt;p&gt;
What should i write instead of&lt;/p&gt;

&lt;pre&gt;
EPOBuf[0] = InReport;
&lt;/pre&gt;

&lt;p&gt;
Hope you can help me.&lt;/p&gt;

&lt;p&gt;
regards&lt;br /&gt;
Mathias&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID Example for MCBSTM32E change ReportDescriptor</title><link>https://community.arm.com/thread/58762?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2010 15:25:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9d3289ec-3151-48b4-86f2-6c5caa055699</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
See this topic,&lt;br /&gt;
&lt;a href="http://www.keil.com/forum/11137/"&gt;http://www.keil.com/forum/11137/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Above topic was discussed on HID example for LPC2148.&lt;br /&gt;
Keil example code is common with STM32, at least, on descriptors.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>