AnsweredAssumed Answered

USB HID Linux

Question asked by mueller.jonas on Dec 5, 2012
Hi,

I do use the ST Evalboard STM3220G-Eval and started with ST example project USB HID Device Mouse/Joystick. It does work on Windows and Linux - no problems.
Now I started to modify the example because my device should not appear as a mouse. I want to send 4 bytes of data from the usb device (Evalboard) to the usb host (computer).

In file usbd_hid_core.c I did two changes:

InterfaceProtocal was 2 and is now 0
0x00,         /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/

 
And the report descriptor looks like this  
  // HID_MOUSE_REPORT_DESC_SIZE = 21
0x06, 0x00, 0xff,              // USAGE_PAGE (Vendor Defined Page 1)
0x09, 0x01,                    // USAGE (Vendor Usage 1)
0xa1, 0x01,                    // COLLECTION (Application)
0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
0x75, 0x08,                    //   REPORT_SIZE (8)
0x95, 0x04,                    //   REPORT_COUNT (4)
0x09, 0x01,                    //   USAGE (Vendor Usage 1)
0x81, 0x02,                    //   INPUT (Data,Var,Abs)
0xc0                           // END_COLLECTION



In windows it does work and send 4 bytes of data. But with Linux I get an error during initialization:
URB status: Broken pipe (-EPIPE) (-32)

Does anyone know that problem?

Outcomes