USB device don't recognized by system if we try to use more than one endpoint in app_usbd_hid_generic library:
APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid,
INTERFACE_NUMBER,
hid_ev_handler,
(HID_IN_ENDPOINT, HID_OUT_ENDPOINT),
hid_reports,
HID_IN_QUEUE_SIZE,
HID_OUT_MAXSIZE,
APP_USBD_HID_SUBCLASS_BOOT,
APP_USBD_HID_PROTO_MOUSE);
This code, but with one endpoint(in or out) works as expected:
APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid,
...
(HID_IN_ENDPOINT),
...);
After changing loop variable to "j" in components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.c our code works fine even with 2 endpoints.
static bool hid_generic_feed_descriptors(app_usbd_class_descriptor_ctx_t * p_ctx,
app_usbd_class_inst_t const * p_inst,
uint8_t * p_buff,
size_t max_size)
{
...
for (i = 0; i < ifaces; i++)
{
...
static uint8_t endpoints = 0;
endpoints = app_usbd_class_iface_ep_count_get(p_cur_iface);
for (j = 0; j < endpoints; j++)
{
...
p_cur_ep = app_usbd_class_iface_ep_get(p_cur_iface, i); <<=== wrong loop variable
...
}
}
APP_USBD_CLASS_DESCRIPTOR_END();
}