Question
USB HID descriptor (problem with report id)
Posted on June 03, 2015 at 22:42
Hi, i'm trying to use USB device HID with a stm32F4 For this i modified the example give by st for HID standalone (not custom HID, didn't work for me !). If i use this descriptor i can send data to the pc :
__ALIGN_BEGIN
static
uint8_t HID_ReportDesc[USBD_HID_REPORT_DESC_SIZE] __ALIGN_END =
{
0x06, 0xFF, 0x00,
/* USAGE_PAGE (Vendor Page: 0xFF00) */
0x09, 0x01,
/* USAGE (Demo Kit) */
0xa1, 0x01,
/* COLLECTION (Application) */
0x09, 0x01,
/* USAGE (DATA) */
0x15, 0x00,
/* LOGICAL_MINIMUM (0) */
0x25, 0xFF,
/* LOGICAL_MAXIMUM (255) */
0x75, 0x01,
/* REPORT_SIZE (8) */
0x95, 0x01
/* REPORT_COUNT (1) */
0x81, 0x82,
/* INPUT (Data,Var,Abs,Vol) */
0xc0
/* END_COLLECTION */
};
In the main file i use this to send data :
sendBuffer[0]=0x01;//table with one element
USBD_HID_SendReport (&USBD_Device, SendBuffer, 1);
Now i would like to add more element in my descriptor
__ALIGN_BEGIN
static
uint8_t HID_ReportDesc[USBD_HID_REPORT_DESC_SIZE] __ALIGN_END =
{
0x06, 0xFF, 0x00,
/* USAGE_PAGE (Vendor Page: 0xFF00) */
0x09, 0x01,
/* USAGE (Demo Kit) */
0xa1, 0x01,
/* COLLECTION (Application) */
0x85, 0x01
/* REPORT_ID (1) */
0x09, 0x01,
/* USAGE (DATA 1) */
0x15, 0x00,
/* LOGICAL_MINIMUM (0) */
0x25, 0xFF,
/* LOGICAL_MAXIMUM (255) */
0x75, 0x08,
/* REPORT_SIZE (8) */
0x95, 0x01
/* REPORT_COUNT (1) */
0x81, 0x82,
/* INPUT (Data,Var,Abs,Vol) */
0x85, 0x02
/* REPORT_ID (2) */
0x09, 0x02,
/* USAGE (DATA 2) */
0x15, 0x00,
/* LOGICAL_MINIMUM (0) */
0x25, 0xFF,
/* LOGICAL_MAXIMUM (255) */
0x75, 0x08,
/* REPORT_SIZE (8) */
0x95, 0x01
/* REPORT_COUNT (1) */
0x81, 0x82,
/* INPUT (Data,Var,Abs,Vol) */
0xc0
/* END_COLLECTION */
};
and in the main :
//send data1
sendBuffer[0]=0x01;
//report id
sendBuffer[1]=0x7F;
//data1 to send
USBD_HID_SendReport (&USBD_Device, SendBuffer, 2);
This didn't work, my card is correctly detected by windows (driver install ok) but i ddn't see any data ! Do you know what is wrong ?