Skip to main content
juliuscaesar
Associate III
February 27, 2017
Question

Setup Custom HID device

  • February 27, 2017
  • 8 replies
  • 3412 views
Posted on February 27, 2017 at 23:01

Hey guys.

I'm trying to setup Custom HID. I'd like to use an output- and input Buffer.

I have managed to setup the descriptors. I think i have done that right: Windows is correct enumerating my device.

On the other side I got a C# HID API. The Initialisation works, the HID descriptors are successfully exchanged (Output Buffer Size, Input Buffer Size are correctly recognised).

However when I try to send to send/receive message the sending/receiving fails.

in the usbd_custom_hid.c the is an USBD_ClassTypeDef  USBD_CUSTOM_HID which contains pointer to serveral functions

USBD_ClassTypeDef  USBD_CUSTOM_HID =

{

  USBD_CUSTOM_HID_Init,

  USBD_CUSTOM_HID_DeInit,

  USBD_CUSTOM_HID_Setup,

  NULL, /*EP0_TxSent*/  

  USBD_CUSTOM_HID_EP0_RxReady, /*EP0_RxReady*/ /* STATUS STAGE IN */

  USBD_CUSTOM_HID_DataIn, /*DataIn*/

  USBD_CUSTOM_HID_DataOut,

  NULL, /*SOF */

  NULL,

  NULL,      

  USBD_CUSTOM_HID_GetCfgDesc,

  USBD_CUSTOM_HID_GetCfgDesc,

  USBD_CUSTOM_HID_GetCfgDesc,

  USBD_CUSTOM_HID_GetDeviceQualifierDesc,

};

However these functions are never called. I tried calling the USBD_CUSTOM_HID_Init function manually but this did not solve the problem.

Could you help me out what to do with this ClassTypedef?

greets Julian

    This topic has been closed for replies.

    8 replies

    fb2
    Associate II
    May 26, 2017
    Posted on May 26, 2017 at 18:07

    Hello Julian, I'm facing the same issue, did you make it work?

    Thank you!

    Fernando

    juliuscaesar
    Associate III
    May 27, 2017
    Posted on May 27, 2017 at 11:45

     ,

     ,

    hey,

    yep i did cost me some time to figure it out, but after searching on the internet for some time i found a really helpful tutorial

    https://www.youtube.com/watch?v=xufZyQf4O7Y

     ,

    i configured the Custom HID driver exactly the same as the guy in the video and it worked

    To verfiy that the driver works, i tested some C ♯ Hid libraries. I think it was simplehid and mightyhid. Turned out that both of them worked with my disco board. Hope that helps

    fb2
    Associate II
    May 29, 2017
    Posted on May 29, 2017 at 13:51

    Thank you Julian! I will follow your advice with this tutorial, surelly it will be helpfull.

    Thank you again!

    Fernando

    fb2
    Associate II
    June 15, 2017
    Posted on June 15, 2017 at 20:32

    It worked

    Thank you very much! You really helped me.

    Fernando