OK First for all, does USB_EVT_IN event occurs every time the device sends
an input report to host irrespective of whether it has sent using control
or interrupt EP?
We are experiencing something strange. We are testing different report ID
format.
We have one simple report descriptor without any report ID or anything
which we took from the sample code and it looks like this.
const uint8_t HID_ReportDescriptor[] = {
HID_UsagePageVendor(0x00),
HID_Usage(0x01),
HID_Collection(HID_Application),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8), // 8 bits -- /bns 3/4 chaning
this to 10 from 8
HID_ReportCount(HID_INPUT_REPORT_BYTES),
HID_Usage(0x01),
HID_Input(HID_Data | HID_Variable | HID_Absolute),
HID_ReportCount(HID_OUTPUT_REPORT_BYTES),
HID_Usage(0x01),
HID_Output(HID_Data | HID_Variable | HID_Absolute),
HID_ReportCount(HID_FEATURE_REPORT_BYTES),
HID_Usage(0x01),
HID_Feature(HID_Data | HID_Variable | HID_Absolute),
HID_EndCollection,
};
When we use the above report descriptor, we do get USB_EVT_IN.
However, when we use the following report descriptor, the host receives
input report, however at the device end we never receive USB_EVT_IN.
const uint8_t HID_ReportDescriptor[] = {
HID_UsagePageVendor(0x45),
HID_Usage(0x00), //name of hhe usage for the entire
application
HID_Collection(HID_Application),
HID_Usage(0xA010), //name of the usage for the entire
input report
HID_ReportID(0x01),
HID_Collection(HID_Logical),
HID_Usage(0xA011),
HID_Usage(0xA012),
HID_Usage(0xA013),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8),
HID_ReportCount(3),
HID_Input(HID_Variable),
HID_Usage(0xA014),
HID_Usage(0xA015),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xF),
HID_ReportSize(4),
HID_ReportCount(2),
HID_Input(HID_Variable),
HID_Usage(0xA016),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8),
HID_ReportCount(60), //when input length is 8 there is no
EV_In so changing this from 4 to 60 total 64
HID_Input(HID_Variable),
HID_EndCollection, //end of input collection
HID_ReportID(0x02),
HID_ReportSize(8),
HID_ReportCount(HID_OUTPUT_REPORT_BYTES),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_Usage(0xA020),
HID_Output(HID_Variable),
HID_Usage(0xA0001), //name of the usage for the entire
feature report
HID_ReportID(0x03),
HID_Collection(HID_Logical),
HID_Usage(0xA0002),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8),
HID_ReportCount(1),
HID_Feature(HID_Variable| HID_Volatile), //device might change
HID_Usage(0xA0003),
HID_Usage(0xA0004),
HID_LogicalMin(0), // value range: 0 - 0xF
HID_LogicalMaxS(0xF),
HID_ReportSize(4),
HID_ReportCount(2),
HID_Feature(HID_Variable| HID_Volatile), //device might change
HID_Usage(0xA0005),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8),
HID_ReportCount(1),
HID_Feature(HID_Variable| HID_Volatile), //device might change
HID_Usage(0xA0006),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8),
HID_ReportCount(61),
HID_Feature(HID_Variable| HID_Volatile), //device might change
HID_EndCollection, //end of feature
//testing another feature report with ID 4 format is the same
HID_Usage(0x30), //name of the usage for the entire
feature report
HID_ReportID(0x04),
HID_Collection(HID_Logical),
HID_Usage(0x32),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8),
HID_ReportCount(1),
HID_Feature(HID_Variable| HID_Volatile), //device might change
HID_Usage(0x33),
HID_Usage(0x34),
HID_LogicalMin(0), // value range: 0 - 0xF
HID_LogicalMaxS(0xF),
HID_ReportSize(4),
HID_ReportCount(2),
HID_Feature(HID_Variable| HID_Volatile), //device might change
HID_Usage(0x35),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8),
HID_ReportCount(1),
HID_Feature(HID_Variable| HID_Volatile), //device might change
HID_Usage(0x36),
HID_LogicalMin(0), // value range: 0 - 0xFF
HID_LogicalMaxS(0xFF),
HID_ReportSize(8),
HID_ReportCount(5),
HID_Feature(HID_Variable| HID_Volatile), //device might change
HID_EndCollection, //end of feature
HID_EndCollection,
};
Any idea?
Thanks