<?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 feature</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24459/hid-feature</link><description> 
HID Feature 

 
I have implemented a detach feature in a HID device which report
descriptor is: 

 
const BYTE IPLB_ReportDescriptor[IPLB_SIZ_REPORT_DESC] = { 

 
0x06, 0xA0, 0xFF, // USAGE_PAGE (Consumer Page) 0x09, 0x01, //
USAGE (Consumer Control</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: HID feature</title><link>https://community.arm.com/thread/153480?ContentTypeID=1</link><pubDate>Tue, 16 Dec 2008 03:14:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cccd5c72-a70d-45d9-80e4-3bc6443ee6b0</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
Humm..&lt;br /&gt;
Seems that the version of the stack is different...&lt;br /&gt;
I referred the latest stack from ST Micro web page.&lt;/p&gt;

&lt;p&gt;
In the recent stack, this process is done in the &amp;quot;CopyRoutine&amp;quot;,
assigned in each request.&lt;/p&gt;

&lt;pre&gt;
    pbLen = (*CopyRoutine)(0);
    wLen = (WORD)((DWORD)pbLen);
    pInfo-&amp;gt;Ctrl_Info.Usb_wLength = wLen;
&lt;/pre&gt;

&lt;p&gt;
In your code, the GetProtocol handler is as follows,&lt;/p&gt;

&lt;pre&gt;
BYTE *Mouse_GetProtocolValue(WORD Length)
{
  return (BYTE *)&amp;amp;ProtocolValue;
}
&lt;/pre&gt;

&lt;p&gt;
In the recent stack (Sep-2008) from ST Micro&lt;br /&gt;
&amp;quot;STR7/STR9 USB developer kit software&amp;quot;&lt;br /&gt;
&lt;a href="http://www.st.com/stonline/products/support/micro/files/um0290.zip"&gt;www.st.com/.../um0290.zip&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;
u8 *Joystick_GetProtocolValue(u16 Length)
{
  if (Length == 0)
  {
&lt;b&gt;    pInformation-&amp;gt;Ctrl_Info.Usb_wLength = 1;&lt;/b&gt;
    return NULL;
  }
  else
    return (u8 *)(&amp;amp;ProtocolValue);
}
&lt;/pre&gt;

&lt;p&gt;
Maybe they&amp;#39;ve revised it in the recent stack.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/152807?ContentTypeID=1</link><pubDate>Tue, 16 Dec 2008 01:45:10 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6f4c7da0-9366-4fbe-8d3d-04259039f989</guid><dc:creator>Milton Godinho</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi!&lt;/p&gt;

&lt;p&gt;
I saw the line but it wasn&amp;#39;t working anyway. What I did to solve
it was:&lt;/p&gt;

&lt;pre&gt;
   else if ( (RequestNo == SET_REPORT) &amp;amp;&amp;amp; (pInfo-&amp;gt;USBwValue1 == HID_FEATURE) )
      {
        CopyRoutine = IPLB_SetReport;
        Request = SET_REPORT;
        // detach feature falls here!
     &lt;b&gt;   feature_flag=1;       &lt;/b&gt;
      }
    }
  if (CopyRoutine == NULL) return UNSUPPORT;
  pInfo-&amp;gt;Ctrl_Info.CopyData = CopyRoutine;
  pInfo-&amp;gt;Ctrl_Info.Usb_wOffset = 0;
  &lt;b&gt;
  if (feature_flag==1) &lt;/b&gt;
  {
    (*CopyRoutine)(0);
    feature_flag=0;
  }
  else
  {
    pbLen = (*CopyRoutine)(0);
    wLen = (WORD)((DWORD)pbLen);
    pInfo-&amp;gt;Ctrl_Info.Usb_wLength = wLen;
  }

  return USB_SUCCESS;
} /* IPLB_Data_Setup */

&lt;/pre&gt;

&lt;p&gt;
So it only uses (*CopyRoutine)(0); if it is a feature request. If
I will use it for all requests the device is not recognize anymore
...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/152005?ContentTypeID=1</link><pubDate>Tue, 16 Dec 2008 01:28:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:05ca4d39-81da-4723-9e85-495148ad7a61</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
Maybe he wasn&amp;#39;t aware to modify &amp;quot;(*CopyRoutine)(0);&amp;quot; line, because
I missed to highlight it in above post.&lt;/p&gt;

&lt;pre&gt;
RESULT IPLB_Data_Setup(BYTE RequestNo)
{
   ...
&lt;b&gt;  (*CopyRoutine)(0);&lt;/b&gt;

//  pbLen = (*CopyRoutine)(0);         // delete these lines
//  wLen = (WORD)((DWORD)pbLen);
//  pInfo-&amp;gt;Ctrl_Info.Usb_wLength = wLen;

  return USB_SUCCESS;
} /* IPLB_Data_Setup */
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The implementation of HID Set_Report request is same as CDC
Set_Line_Coding.&lt;br /&gt;
Both requests are carried over Control Write transfer.&lt;/p&gt;

&lt;p&gt;
Actually, I referred the CDC example of the ST USB stack to make
above code.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/151264?ContentTypeID=1</link><pubDate>Mon, 15 Dec 2008 03:33:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c8a80611-01fa-463c-9fcd-48106ef2b85f</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Please post more specific information about what you had to do to
fix your problem. If you just end this thread with your last post,
other people who find this thread will not know about what you
did...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/146303?ContentTypeID=1</link><pubDate>Mon, 15 Dec 2008 03:31:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:35c26ea6-300a-4653-a255-710c2122ed19</guid><dc:creator>Milton Godinho</dc:creator><description>&lt;p&gt;&lt;p&gt;
Leave it Tsuneo, I have just solve it with a flag.&lt;br /&gt;
It is working now!&lt;br /&gt;
Thanks a lot for all your help and have a nice week!&lt;/p&gt;

&lt;p&gt;
Milton&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/146302?ContentTypeID=1</link><pubDate>Mon, 15 Dec 2008 02:16:43 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:272dc2a5-a1ef-4b00-aa72-e7b6662ec9f5</guid><dc:creator>Milton Godinho</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Tsuneo!&lt;/p&gt;

&lt;p&gt;
That&amp;#39;s exacly what I was looking for.&lt;/p&gt;

&lt;p&gt;
Just a small thing, after testing this changes I realise that
after deleting there 3 lines according to your instructions, the
device is not recognize anymore.&lt;/p&gt;

&lt;pre&gt;
//  pbLen = (*CopyRoutine)(0);         // delete these lines
//  wLen = (WORD)((DWORD)pbLen);
//  pInfo-&amp;gt;Ctrl_Info.Usb_wLength = wLen;
&lt;/pre&gt;

&lt;p&gt;
and with the lines the firmware never gets to this function, so I
can&amp;#39;t process the feature ...&lt;/p&gt;

&lt;pre&gt;
void IPLB_Status_In(void)
{
  if (Request == SET_REPORT)
  {
    //
    //  Your Set_Report( Feature ) handler comes here
    //  data is held in feature_buf[]
    //
    Request = 0;
  }
}
&lt;/pre&gt;

&lt;p&gt;
Any idea what can be wrong?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/144527?ContentTypeID=1</link><pubDate>Fri, 12 Dec 2008 10:52:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c0daa3ce-7eae-4dce-a205-2c3da3675abd</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
Auu, sorry, I mistakenly pickup STM32F10x USB library in above
post.&lt;br /&gt;
Almost same, but a little different.&lt;/p&gt;

&lt;p&gt;
This is revised one.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;

&lt;pre&gt;
usb_prop.c

&lt;b&gt;/* Private define ------------------------------------------------------------*/
enum _HID_REPORTS
{
   HID_INPUT = 1,
   HID_OUTPUT,
   HID_FEATURE
};

/* Private variables ---------------------------------------------------------*/
u8 Request = 0;
u8 feature_buf[ BUFFER_SIZE ];

u8 *IPLB_SetReport(u16);

/*******************************************************************************
* Function Name  : IPLB_Status_In.
* Description    : Joystick status IN routine.
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void IPLB_Status_In(void)
{
  if (Request == SET_REPORT)
  {
    //
    //  Your Set_Report( Feature ) handler comes here
    //  data is held in feature_buf[]
    //
    Request = 0;
  }
}
&lt;/b&gt;

RESULT IPLB_Data_Setup(BYTE RequestNo)
{
  DEVICE_INFO           *pInfo = &amp;amp;Device_Info;
  BYTE  *(*CopyRoutine)(WORD);
  BYTE *pbLen;
  WORD wLen;
 BSP_ToggleLED(3);
  CopyRoutine = NULL;
  if (RequestNo == GET_DESCRIPTOR &amp;amp;&amp;amp; Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
  {
    if (pInfo-&amp;gt;USBwIndex0 != 0)
      return UNSUPPORT;
    switch (pInfo-&amp;gt;USBwValue1)
    {
    case HID_DESCRIPTOR:
      CopyRoutine = Mouse_GetHidDescriptor;
      break;

    case REPORT_DESCRIPTOR:
      CopyRoutine = Mouse_GetReportDescriptor;
      break;
    default: return UNSUPPORT;
    }
  } /* End of GET_DESCRIPTOR */
  else

    /*** GET_IDLE/GET_PROTOCOL ***/
    if (Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT))
    {
      if (RequestNo == GET_IDLE)
      {
        /*return the idle time*/
        /*not supported here*/
        return UNSUPPORT;
      }
      else if (RequestNo == GET_PROTOCOL)
      {
        CopyRoutine = Mouse_GetProtocolValue;
      }
&lt;b&gt;
  /*** SET_REPORT ***/
      else if ( (RequestNo == SET_REPORT)
             &amp;amp;&amp;amp; (pInfo-&amp;gt;USBwValue1 == HID_FEATURE) )
      {
        CopyRoutine = IPLB_SetReport;
        Request = SET_REPORT;
      }
&lt;/b&gt;
//        else return UNSUPPORT;
    }
//    else return UNSUPPORT;

  if (CopyRoutine == NULL) return UNSUPPORT;
  pInfo-&amp;gt;Ctrl_Info.CopyData = CopyRoutine;
  pInfo-&amp;gt;Ctrl_Info.Usb_wOffset = 0;
  (*CopyRoutine)(0);
&lt;b&gt;
//  pbLen = (*CopyRoutine)(0);         // delete these lines
//  wLen = (WORD)((DWORD)pbLen);
//  pInfo-&amp;gt;Ctrl_Info.Usb_wLength = wLen;
&lt;/b&gt;
  return USB_SUCCESS;
} /* IPLB_Data_Setup */

&lt;b&gt;
/*******************************************************************************
* Function Name  : IPLB_SetReport.
* Description    : Receive report.
* Input          : Length.
* Output         : None.
* Return         : report buffer base address.
*******************************************************************************/
u8 *IPLB_SetReport(u16 Length)
{
  if (Length == 0)
  {
    pInformation-&amp;gt;Ctrl_Info.Usb_wLength = sizeof(feature_buf);
    return NULL;
  }
  return feature_buf;
}&lt;/b&gt;
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/142168?ContentTypeID=1</link><pubDate>Fri, 12 Dec 2008 09:20:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8cdeb50e-9afa-43d7-b848-94e5168cec4d</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
Are you working on the Custom_HID example?&lt;br /&gt;
Then, modify it as follows.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;

&lt;pre&gt;
usb_prop.c

&lt;b&gt;/* Private define ------------------------------------------------------------*/
enum _HID_REPORTS
{
   HID_INPUT = 1,
   HID_OUTPUT,
   HID_FEATURE
};

/* Private variables ---------------------------------------------------------*/
u8 Request = 0;
u8 feature_buf[ BUFFER_SIZE ];

u8 *CustomHID_SetReport(u16);&lt;/b&gt;

/*******************************************************************************
* Function Name  : CustomHID_Status_In.
* Description    : Joystick status IN routine.
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void CustomHID_Status_In(void)
{
&lt;b&gt;  if (Request == SET_REPORT)
  {
    //
    //  Your Set_Report( Feature ) handler comes here
    //  data is held in feature_buf[]
    //
    Request = 0;
  }&lt;/b&gt;
}

/*******************************************************************************
* Function Name  : CustomHID_Data_Setup
* Description    : Handle the data class specific requests.
* Input          : Request Nb.
* Output         : None.
* Return         : USB_UNSUPPORT or USB_SUCCESS.
*******************************************************************************/
RESULT CustomHID_Data_Setup(u8 RequestNo)
{
  u8 *(*CopyRoutine)(u16);

  CopyRoutine = NULL;

  if ((RequestNo == GET_DESCRIPTOR)
      &amp;amp;&amp;amp; (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
      &amp;amp;&amp;amp; (pInformation-&amp;gt;USBwIndex0 == 0))
  {

    if (pInformation-&amp;gt;USBwValue1 == REPORT_DESCRIPTOR)
    {
      CopyRoutine = CustomHID_GetReportDescriptor;
    }
    else if (pInformation-&amp;gt;USBwValue1 == HID_DESCRIPTOR_TYPE)
    {
      CopyRoutine = CustomHID_GetHIDDescriptor;
    }

  } /* End of GET_DESCRIPTOR */

&lt;b&gt;  else if ( (Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT)) )
  {
  /*** GET_PROTOCOL ***/
    if (RequestNo == GET_PROTOCOL)
    {
      CopyRoutine = CustomHID_GetProtocolValue;
    }
  /*** SET_REPORT ***/
    else if ( (RequestNo == SET_REPORT)
           &amp;amp;&amp;amp; (pInformation-&amp;gt;USBwValue1 == HID_FEATURE) )
    {
      CopyRoutine = CustomHID_SetReport;
      Request = SET_REPORT;
    }
  }&lt;/b&gt;

  if (CopyRoutine == NULL)
  {
    return USB_UNSUPPORT;
  }

  pInformation-&amp;gt;Ctrl_Info.CopyData = CopyRoutine;
  pInformation-&amp;gt;Ctrl_Info.Usb_wOffset = 0;
  (*CopyRoutine)(0);
  return USB_SUCCESS;
}

&lt;b&gt;
/*******************************************************************************
* Function Name  : CustomHID_SetReport.
* Description    : Receive report.
* Input          : Length.
* Output         : None.
* Return         : report buffer base address.
*******************************************************************************/
u8 *CustomHID_SetReport(u16 Length)
{
  if (Length == 0)
  {
    pInformation-&amp;gt;Ctrl_Info.Usb_wLength = sizeof(feature_buf);
    return NULL;
  }
  return feature_buf;
}&lt;/b&gt;
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/139012?ContentTypeID=1</link><pubDate>Fri, 12 Dec 2008 00:47:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:133fe90f-4799-4cc8-afe8-3ceb78edeaff</guid><dc:creator>Milton Godinho</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Tsuneo, my project was based in a mouse HID and I added DFU
support in order to be able to switch to DFU mode.&lt;br /&gt;
The uC that I am using is the STR912FA44 and the base example is from
ST.&lt;br /&gt;
I have just posted my project in the ST Forum so that you can help
me:&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.st.com/mcu/forums-cat-7737-21.html"&gt;www.st.com/.../forums-cat-7737-21.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Thanks a lot for all this help!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/135617?ContentTypeID=1</link><pubDate>Thu, 11 Dec 2008 14:30:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e78e165b-fdc1-4886-aa34-a178521a0882</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;I did as you told me and I start receiving something in my
firmware the package is always empty, all 0x00...&lt;br /&gt;
The only good thing is that:&lt;br /&gt;
if (pInfo-&amp;gt;USBwLength == 0x40) // I get 64 bytes&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Then, you&amp;#39;ve gotten over the host app problem.&lt;br /&gt;
Now, on the firmware side.&lt;/p&gt;

&lt;p&gt;
Maybe, it is the usual pitfall :-)&lt;br /&gt;
I believe the host sends a right report, but you are handling it in
wrong place on the firmware.&lt;/p&gt;

&lt;p&gt;
For requests carried over control read transfer (ex.
Get_Descriptor) or no-data control transfer (ex. Set_Configuration),
the requests are handled just after SETUP stage. However, the request
over control write transfer like Set_Report, it is handled after DATA
stage, too.&lt;/p&gt;

&lt;p&gt;
What is the base example on which you are making?&lt;br /&gt;
KEIL example? And which MCU?&lt;br /&gt;
Post the link to the base example.&lt;br /&gt;
Then, I&amp;#39;ll show you the place where you have to insert your code.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/125132?ContentTypeID=1</link><pubDate>Thu, 11 Dec 2008 05:44:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c2cd861f-81fd-4592-89a2-1961ddbb3bbd</guid><dc:creator>Milton Godinho</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks once more Tsuneo.&lt;/p&gt;

&lt;p&gt;
I have try everything since yesterday.&lt;br /&gt;
I did as you told me and I start receiving something in my firmware
the package is always empty, all 0x00.&lt;/p&gt;

&lt;p&gt;
I am reading the buffer inside the usb_core.c with:&lt;/p&gt;

&lt;p&gt;
pProp-&amp;gt;RxEP_buffer[i] is always 0&lt;/p&gt;

&lt;p&gt;
or in this buffer:&lt;/p&gt;

&lt;p&gt;
pBuf= (WORD*)(GetEPRxAddr(ENDP0)+PMAAddr);&lt;/p&gt;

&lt;p&gt;
The only good thing is that:&lt;/p&gt;

&lt;p&gt;
if (pInfo-&amp;gt;USBwLength == 0x40) // I get 64 bytes&lt;/p&gt;

&lt;p&gt;
Before I analyse the package I call this function:&lt;/p&gt;

&lt;p&gt;
_ClearEP_CTR_RX(ENDP0); // on usb_int.c file&lt;br /&gt;
/* SETUP bit kept frozen while CTR_RX = 1 */&lt;/p&gt;

&lt;p&gt;
Is it interfering with something?&lt;/p&gt;

&lt;p&gt;
Thanks for your help, I am a bit lost now.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/114499?ContentTypeID=1</link><pubDate>Wed, 10 Dec 2008 07:45:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0df83092-715f-4d70-9301-bcb5e7b0f116</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
Aha, you&amp;#39;ve posted it to USB-IF, too.&lt;br /&gt;
&lt;a href="https://www.usb.org/phpbb/viewtopic.php?t=14182"&gt;www.usb.org/.../viewtopic.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
HidD_SetFeature() gives error because ReportBufferLength parameter
doesn&amp;#39;t match to the Feature report defined in the report
descriptor.&lt;br /&gt;
- in your original report descriptor, the size is 128 bytes.&lt;br /&gt;
- you have to add 1 to this value, for the default report ID&lt;/p&gt;

&lt;p&gt;
You may think the default report ID on the host app is redundant,
because it is deleted by the HID device driver after all. But it&amp;#39;s
the Windows way.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/101434?ContentTypeID=1</link><pubDate>Wed, 10 Dec 2008 03:29:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:efd4cab1-454b-415c-9a56-ff64ae5da78e</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
This is the your original report descriptor.&lt;/p&gt;

&lt;pre&gt;
const BYTE IPLB_ReportDescriptor[IPLB_SIZ_REPORT_DESC] = {
    0x06, 0xA0, 0xFF,   // USAGE_PAGE (Vendor Defined page 0xA1)
    0x09, 0x01,         // USAGE (Vendor Usage 0x01)
    0xA1, 0x01,         // COLLECTION (Application)
                        // INPUT
    0x09, 0x03,         //   USAGE (Vendor Usage 0x03)
    0x15, 0x00,         //   LOGICAL_MINIMUM(0)
    0x26, 0xFF, 0x00,   //   LOGICAL_MAXIMUM(255)
    0x75, 0x08,         //   REPORT_SIZE
    0x95, BUFFER_SIZE,  //   REPORT_COUNT (64)
    0x81, 0x02,         //   INPUT (Data,Variable,Abs)
                        // OUTPUT
    0x09, 0x04,         //   USAGE (Vendor Usage 0x04)
    0x15, 0x00,         //   LOGICAL_MINIMUM(0)
    0x26, 0xFF, 0x00,   //   LOGICAL_MAXIMUM(255)
    0x75, 0x08,         //   REPORT_SIZE (8)
    0x95, BUFFER_SIZE,  //   REPORT_COUNT (64)
    0x91, 0x02,         //   OUTPUT(Data, Variable,Abs
                        // Feature
    0x09, 0x05,         //   USAGE (Vendor Usage 0x05)
    0x15, 0x00,         //   LOGICAL_MINIMUM(0)
    0x26, 0xFF, 0x00,   //   LOGICAL_MAXIMUM(255)
    0x75, 0x08,         //   REPORT_SIZE (8)
    0x95, BUFFER_SIZE,  //   REPORT_COUNT (64)
    0xB1, 0x02,         //   Feature (Data, Variable,Abs)
                        // DETACH FEATURE
    0x06,0x00,0xFF,     //   USAGE_PAGE (Vendor Defined page 1)
    0x09,0x55,          //   USAGE (Vendor Usage 0x55) - USAGE DETACH
    0x15,0x00,          //   LOGICAL_MINIMUM(0)
    0x26,0xFF,0x00,     //   LOGICAL_MAXIMUM(255)
    0x75,0x08,          //   REPORT_SIZE (8)
    0x95,BUFFER_SIZE,   //   REPORT_COUNT (64)
    0xB1,0x82,          //   Feature (Data, Var,Abs,Vol)
    0xC0                // END_COLLECTION
}
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
This report descriptor has no error, but maybe it defines the feature
report format differently as you expect.&lt;/p&gt;

&lt;p&gt;
Input report: 64 bytes&lt;br /&gt;
Output report: 64 bytes&lt;br /&gt;
Feature report: 128 bytes&lt;/p&gt;

&lt;p&gt;
That is, the first &amp;quot;Feature&amp;quot; field joins to the second &amp;quot;Feature&amp;quot;
field together, it makes 128 bytes as the total. I think it isn&amp;#39;t the
result you expect.&lt;/p&gt;

&lt;p&gt;
Delete the &amp;quot;DETACH FEATURE&amp;quot; part at all, as follows.&lt;br /&gt;
Then, the descriptor defines just 64 bytes feature.&lt;/p&gt;

&lt;pre&gt;
const BYTE IPLB_ReportDescriptor[IPLB_SIZ_REPORT_DESC] = {
    0x06, 0xA0, 0xFF,   // USAGE_PAGE (Vendor Defined page 0xA1)
    0x09, 0x01,         // USAGE (Vendor Usage 0x01)
    0xA1, 0x01,         // COLLECTION (Application)
                        // INPUT
    0x09, 0x03,         //   USAGE (Vendor Usage 0x03)
    0x15, 0x00,         //   LOGICAL_MINIMUM(0)
    0x26, 0xFF, 0x00,   //   LOGICAL_MAXIMUM(255)
    0x75, 0x08,         //   REPORT_SIZE
    0x95, BUFFER_SIZE,  //   REPORT_COUNT (64)
    0x81, 0x02,         //   INPUT (Data,Variable,Abs)
                        // OUTPUT
    0x09, 0x04,         //   USAGE (Vendor Usage 0x04)
    0x15, 0x00,         //   LOGICAL_MINIMUM(0)
    0x26, 0xFF, 0x00,   //   LOGICAL_MAXIMUM(255)
    0x75, 0x08,         //   REPORT_SIZE (8)
    0x95, BUFFER_SIZE,  //   REPORT_COUNT (64)
    0x91, 0x02,         //   OUTPUT(Data, Variable,Abs
                        // Feature
    0x09, 0x05,         //   USAGE (Vendor Usage 0x05)
    0x15, 0x00,         //   LOGICAL_MINIMUM(0)
    0x26, 0xFF, 0x00,   //   LOGICAL_MAXIMUM(255)
    0x75, 0x08,         //   REPORT_SIZE (8)
    0x95, BUFFER_SIZE,  //   REPORT_COUNT (64)
    0xB1, 0x02,         //   Feature (Data, Variable,Abs)
    0xC0                // END_COLLECTION
}
&lt;/pre&gt;

&lt;p&gt;
Also, you can simplify above descriptor as follows.&lt;/p&gt;

&lt;pre&gt;
const BYTE IPLB_ReportDescriptor[IPLB_SIZ_REPORT_DESC] = {
    0x06, 0xA0, 0xFF,   // USAGE_PAGE (Vendor Defined page 0xA1)
    0x09, 0x01,         // USAGE (Vendor Usage 0x01)
    0xA1, 0x01,         // COLLECTION (Application)
                        // Global items
    0x15, 0x00,         //   LOGICAL_MINIMUM(0)
    0x26, 0xFF, 0x00,   //   LOGICAL_MAXIMUM(255)
    0x75, 0x08,         //   REPORT_SIZE
    0x95, BUFFER_SIZE,  //   REPORT_COUNT (64)
                        // INPUT
    0x09, 0x03,         //   USAGE (Vendor Usage 0x03)
    0x81, 0x02,         //   INPUT (Data,Variable,Abs)
                        // OUTPUT
    0x09, 0x04,         //   USAGE (Vendor Usage 0x04)
    0x91, 0x02,         //   OUTPUT(Data, Variable,Abs
                        // Feature
    0x09, 0x05,         //   USAGE (Vendor Usage 0x05)
    0xB1, 0x02,         //   Feature (Data, Variable,Abs)
    0xC0                // END_COLLECTION
}
&lt;/pre&gt;

&lt;p&gt;
On the host app,&lt;br /&gt;
You have to add default report ID at the top of the buffer&lt;/p&gt;

&lt;pre&gt;
   unsigned char Feature[&lt;b&gt;65&lt;/b&gt;];
   Feature[0] = 0;      // default report ID
   Feature[1] = 0x55;   // detach
   HidD_SetFeature( pWalk-&amp;gt;HidDevice, Feature, &lt;b&gt;65&lt;/b&gt; );
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
On the firmware, in the Set_Report( Feature ) handler,&lt;br /&gt;
Above default ID disappears.&lt;/p&gt;

&lt;pre&gt;
   if ( Feature[0] == 0x55 ) {  // detach command
      ...
   }
&lt;/pre&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/76956?ContentTypeID=1</link><pubDate>Wed, 10 Dec 2008 02:40:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:83353a6c-24e0-4050-8d79-435790dd0f2d</guid><dc:creator>Milton Godinho</dc:creator><description>&lt;p&gt;&lt;p&gt;
Tsuneo, Thanks for your answer!&lt;/p&gt;

&lt;p&gt;
The Buffer Size is 64 (0x40).&lt;br /&gt;
In the HidD_SetFeature I also use 64 bytes.&lt;/p&gt;

&lt;p&gt;
const BYTE IPLB_ReportDescriptor[IPLB_SIZ_REPORT_DESC] = {&lt;/p&gt;

&lt;p&gt;
0x06, 0xA0, 0xFF,// USAGE_PAGE (Consumer Page)&lt;/p&gt;

&lt;p&gt;
0x09, 0x01, // USAGE (Consumer Control Usage)&lt;/p&gt;

&lt;p&gt;
0xA1, 0x01, // COLLECTION (Application)&lt;/p&gt;

&lt;p&gt;
//INPUT&lt;/p&gt;

&lt;p&gt;
0x09, 0x03,&lt;/p&gt;

&lt;p&gt;
0x15, 0x00, // LOGICAL_MINIMUM(0)&lt;/p&gt;

&lt;p&gt;
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM(255)&lt;/p&gt;

&lt;p&gt;
0x75, 0x08, // REPORT_SIZE&lt;/p&gt;

&lt;p&gt;
0x95, BUFFER_SIZE, // REPORT_COUNT (64)&lt;/p&gt;

&lt;p&gt;
0x81, 0x02, // INPUT (Data,Variable,Abs)&lt;/p&gt;

&lt;p&gt;
//OUTPUT&lt;/p&gt;

&lt;p&gt;
0x09, 0x04,&lt;/p&gt;

&lt;p&gt;
0x15, 0x00, // LOGICAL_MINIMUM(0)&lt;/p&gt;

&lt;p&gt;
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM(255)&lt;/p&gt;

&lt;p&gt;
0x75, 0x08, // REPORT_SIZE (8)&lt;/p&gt;

&lt;p&gt;
0x95, BUFFER_SIZE, // REPORT_COUNT (64)&lt;/p&gt;

&lt;p&gt;
0x91, 0x02, // OUTPUT(Data, Variable,Abs&lt;/p&gt;

&lt;p&gt;
//Feature&lt;/p&gt;

&lt;p&gt;
0x09, 0x05,&lt;/p&gt;

&lt;p&gt;
0x15, 0x00, // LOGICAL_MINIMUM(0)&lt;/p&gt;

&lt;p&gt;
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM(255)&lt;/p&gt;

&lt;p&gt;
0x75, 0x08, // REPORT_SIZE (8)&lt;/p&gt;

&lt;p&gt;
0x95, BUFFER_SIZE, // REPORT_COUNT (64)&lt;/p&gt;

&lt;p&gt;
0xB1, 0x02, // Feature (Data, Variable,Abs)&lt;/p&gt;

&lt;p&gt;
//DETACH FEATURE&lt;/p&gt;

&lt;p&gt;
0x06,0x00,0xFF, // VENDOR DEFINED USAGE PAGE&lt;/p&gt;

&lt;p&gt;
0x09,0x55, // USAGE DETACH&lt;/p&gt;

&lt;p&gt;
0x15,0x00, // LOGICAL_MINIMUM(0)&lt;/p&gt;

&lt;p&gt;
0x26,0xFF,0x00, // LOGICAL_MAXIMUM(255)&lt;/p&gt;

&lt;p&gt;
0x75,0x08, // REPORT_SIZE (8)&lt;/p&gt;

&lt;p&gt;
0x95,BUFFER_SIZE, // REPORT_COUNT (64)&lt;/p&gt;

&lt;p&gt;
0xB1,0x82, // Feature (Data, Var,Abs,Vol)&lt;/p&gt;

&lt;p&gt;
0xC0 // END_COLLECTION&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID feature</title><link>https://community.arm.com/thread/53031?ContentTypeID=1</link><pubDate>Tue, 09 Dec 2008 23:33:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e129c0d5-89dc-4727-84e3-33d786d9cdf9</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
Seems a problem on the report descriptor&lt;br /&gt;
- or mismatch of the report size on the HidD_SetFeature&lt;/p&gt;

&lt;p&gt;
Format and attach comment to above report descriptor, so that it
can be readable to us, and post it again :-)&lt;br /&gt;
What is the exact number of BUFFER_SIZE ?&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>