cancel
Showing results for 
Search instead for 
Did you mean: 

USBD_HID_Init

ron2399
Associate II
Posted on August 05, 2016 at 02:33

I have an STM32F416 embedded in a USB device that I want to act like a keyboard device when plugged in to a PC.  I'm using the STM32Cube USB device library and the UM1734 documentation.  In the documentation it says:

''The HID stack is initialized by calling the USBD_HID_Init(),'' [sic]

So I tried calling that function and got both an undeclared function warning and a link error.  When I looked at the source code for the library, I found that the USBD_HID_Init function was not declared in usbd_hid.h.  Moreover, in usbd_hid.c the function is declared:

static uint8_t  USBD_HID_DeInit (USBD_HandleTypeDef *pdev, 

                                 uint8_t cfgidx)

So this function cannot be called externally.  There seems to be a total mismatch between the documentation and the code here.  What am I missing?
1 REPLY 1
ron2399
Associate II
Posted on August 05, 2016 at 18:34

Figured it out.  The static functions are exported through an object called USBD_HID.  So to call the init function you call USBD_HID.Init(...).  The difference is a dot instead of an underscore.  The docs are wrong.  It's a small typo, but a major change in semantics.

Is there any way to report this to ST?  Do ST people read these forums?