Content originally posted in LPCWare by Tsuneo on Tue Jul 16 00:49:06 MST 2013
Er, which one are you talking, output report over interrupt OUT endpoint, or Set_Report request over the default endpoint?
a) Output report over interrupt OUT endpoint
Because of "violation of HID spec", the HID class drivers on major OS (Windows, MacOSX and Linux) don't put ZLP after output reports shorter than the greatest output report. Therefore, the firmware has to detect the end of transfer by the accumulated size of the packets.
b) Output report over Set_Report request
On LPCOpen (either v0.98 or v1.03), EVENT_USB_Device_ControlRequest() is called just when the device received SETUP transaction.
In these versions, Set_Report request handler expects just single packet at the DATA stage. ie. output reports of greater than 64 bytes are not supported. You have to touch to this code flow in the stack, to get two or more packets in the DATA stage.
lpcopen_v1.03(or 0.98)\software\LPCUSBLib\Drivers\USB\Class\Device\HIDClassDevice.c
HID_Device_ProcessControlRequest() --> case HID_REQ_SetReport: --> Endpoint_Read_Control_Stream_LE()
lpcopen_v1.03(or 0.98)\software\LPCUSBLib\Drivers\USB\Core\EndpointStream.c
Endpoint_Read_Control_Stream_LE() --> Endpoint_Read_Stream_LE()
Tsuneo