question on zephyr usb hid

hi support team,

we have usb hid demo, the path is \ncs\v2.4.0\zephyr\samples\subsys\usb\hid.

i have tested it and changed the binterval to 1 as below:  ncs default binterval value is 9;

and now i want to send hid data for more than 1byte(1 byte is default report size),when i change report size to 8, it is running normal, every 1 msec, device report 8 bytes.

however, when i change report size to 64 or 128 i met problem

when the report size is 32, it needs 3ms to call the api :int_in_ready_cb and send the next packet:

when the report size is 64, it needs 5ms to call the api :int_in_ready_cb and send the next packet:

when the report size is 128, it needs 9ms to call the api :int_in_ready_cb and send the next packet:

may i ask why the time interval is getting longer and longer? 

Regards,

William.

Parents
  • Hey William,

    wMaxPacketSize is set to 16 bytes, so your HID report is split into several packets. See the reported packets sizes in wireshark and compare with HID report size and you'll see that the totalt packet size is 28 bytes larger for 32, 64, and 128byte HID reports. 

    I guess there's a framing overhead of 28bytes when splitting the reports, so a 32byte HID report is split into 3 packets, each sent at 1ms intervals.

    The USBD peripheral only supports a maximum of 64byte packet payloads btw. 

    BR,
    Håkon Holdhus.

Reply
  • Hey William,

    wMaxPacketSize is set to 16 bytes, so your HID report is split into several packets. See the reported packets sizes in wireshark and compare with HID report size and you'll see that the totalt packet size is 28 bytes larger for 32, 64, and 128byte HID reports. 

    I guess there's a framing overhead of 28bytes when splitting the reports, so a 32byte HID report is split into 3 packets, each sent at 1ms intervals.

    The USBD peripheral only supports a maximum of 64byte packet payloads btw. 

    BR,
    Håkon Holdhus.

Children
Related