HID report size is multiple of endpoint0 size (nxpUSBlib v0.98)

cancel
Showing results for 
Search instead for 
Did you mean: 

HID report size is multiple of endpoint0 size (nxpUSBlib v0.98)

114 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by vogl on Mon Jul 15 06:55:33 MST 2013
Hello,

in our HID application we use a LPC1833 as USB device (high speed).
The endpoint0 size is 64 bytes.

The application works fine as long as we don't receive an OUT report
whose size is a multiple of 64 bytes (including report ID), e.g. 64, 128, 192,...

For such a report we see ACKs foreach 64 byte packet on the USB analyzer
but EVENT_USB_Device_ControlRequest() will not be called.

Any idea?

Toni
Labels (1)
0 Kudos
1 Reply

38 Views
NXP Employee
NXP Employee
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
0 Kudos