<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MCUXpresso SDKのトピックMCUXpresso USB Generic HID Example - High Speed and 1kB Packet Size</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUXpresso-USB-Generic-HID-Example-High-Speed-and-1kB-Packet/m-p/847527#M1159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I attempted to ppst this as a blog, but I wasn't allowed to select a "place" which prevented the post, so starting a new discussion is the next best thing.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Here are the details:&amp;nbsp; I was running the USB generic HID device example code from the MCUXpresso SDK for the LPCXpresso54608 board (OM13092).&amp;nbsp; This MCU/dev baord was chosen because it included a USB HS PHY.&amp;nbsp; Along with the example code, there is a C# program referenced in the readme which identifies when the correct VID and PID are registered on the PC and allows for data to be transferred to the dev board and receives/displays data that is echoed back.&amp;nbsp; Here is the link to download it, but per the example code readme, you will need to make some modifications.&amp;nbsp; I have attached the modified C# code to this post as well.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;A class="" href="https://www.codeproject.com/Articles/18099/A-USB-HID-Component-for-C" style="color: #2989c5; text-decoration: none;" title="https://www.codeproject.com/Articles/18099/A-USB-HID-Component-for-C"&gt;A USB HID Component for C# - CodeProject&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Default settings for the LPC54608 example code have it running on the full-speed (FS) port (J3) with 8-byte reports.&amp;nbsp; The following changes allow the board to communicate with USB high-speed (HS) on J2 with 1024-byte reports.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;First, changing the following in "usb_device_config.h" switches the active PHY from FS / J3 to HS / J2:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;From:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/*! @brief LPC USB IP3511 FS instance count */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_DEVICE_CONFIG_LPCIP3511FS (1U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/*! @brief LPC USB IP3511 HS instance count */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_DEVICE_CONFIG_LPCIP3511HS (0U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;To:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/*! @brief LPC USB IP3511 FS instance count */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/*! @brief LPC USB IP3511 HS instance count */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I also changed the polling period to be as frequent as possible which I believe is supposed to be 125µs.&amp;nbsp; The change is as follows&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;In "usb_device_descriptor.h" I changed the generic buffer lengths, the HS packet sizes and the interrupt interval&amp;nbsp;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;to be as frequent as possible which I believe is supposed to be 125µs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;From:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_IN_BUFFER_LENGTH (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_OUT_BUFFER_LENGTH (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_COUNT (2U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_INTERFACE_INDEX (0U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_IN (1U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_OUT (2U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_CLASS (0x03U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_SUBCLASS (0x00U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_PROTOCOL (0x00U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x04U) /* 2^(4-1) = 1ms */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x01U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x04U) /* 2^(4-1) = 1ms */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x01U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;To:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_IN_BUFFER_LENGTH (1024U) // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_OUT_BUFFER_LENGTH (1024U) // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_COUNT (2U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_INTERFACE_INDEX (0U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_IN (1U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_OUT (2U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_CLASS (0x03U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_SUBCLASS (0x00U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_PROTOCOL (0x00U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (1024U) // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x01U) /* 2^(4-1) = 1ms */ // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x01U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (1024U) // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x01U) /* 2^(4-1) = 1ms */ // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x01U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;NOTE - Though I changed the IN and OUT buffer length and packet size above, that was not sufficient to to actually change the packet size.&amp;nbsp; The report descriptor also had to be modified.&amp;nbsp; I was concerned that the parameter associated with the "Report Count" was only one byte, but with some Googling, I found a program that will generate the appropriate hex for the descriptor.&amp;nbsp; The following link explains this pretty well and provides the link to the HID descriptor tool:&amp;nbsp;&amp;nbsp;&lt;A data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Feleccelerator.com%2Ftutorial-about-usb-hid-report-descriptors%2F" rel="nofollow" style="color: #2989c5; border: 0px; font-weight: inherit; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;Tutorial about USB HID Report Descriptors | Eleccelerator&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I included a few extra commented lines to show the descriptor changes for 255, 256, 512 and 768 byte packets with only the 1024 byte line uncommented.&amp;nbsp; The report descriptor is in the file "usb_device_descriptor.c":&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;From:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;uint8_t g_UsbDeviceHidGenericReportDescriptor[] = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x05U, 0x81U, /* Usage Page (Vendor defined)*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x82U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0xA1U, 0x01U, /* Collection (Application) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x83U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x84U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x15U, 0x80U, /* Logical Minimum (-128) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x25U, 0x7FU, /* Logical Maximum (127) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x75U, 0x08U, /* Report Size (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x95U, 0x08U, /* Report Count (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x81U, 0x02U, /* Input(Data, Variable, Absolute) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x84U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x15U, 0x80U, /* Logical Minimum (-128) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x25U, 0x7FU, /* Logical Maximum (127) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x75U, 0x08U, /* Report Size (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x95U, 0x08U, /* Report Count (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x91U, 0x02U, /* Output(Data, Variable, Absolute) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0xC0U, /* End collection */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;To:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;uint8_t g_UsbDeviceHidGenericReportDescriptor[] = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x05U, 0x81U, /* Usage Page (Vendor defined)*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x82U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0xA1U, 0x01U, /* Collection (Application) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x83U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x84U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x15U, 0x80U, /* Logical Minimum (-128) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x25U, 0x7FU, /* Logical Maximum (127) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x75U, 0x08U, /* Report Size (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x95U, 0xFFU, /* Report Count (255U) */ // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x01U, /* Report Count (256U) */ // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x02U, /* Report Count (512U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x03U, /* Report Count (768U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x96U, 0x00U, 0x04U, /* Report Count (1024U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x81U, 0x02U, /* Input(Data, Variable, Absolute) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x84U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x15U, 0x80U, /* Logical Minimum (-128) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x25U, 0x7FU, /* Logical Maximum (127) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x75U, 0x08U, /* Report Size (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x95U, 0xFFU, /* Report Count (255U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x01U, /* Report Count (256U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x02U, /* Report Count (512U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x03U, /* Report Count (768U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x96U, 0x00U, 0x04U, /* Report Count (1024U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x91U, 0x02U, /* Output(Data, Variable, Absolute) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0xC0U, /* End collection */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Don't forget to also change the contents of "&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;usb_device_descriptor.h" to match the report descriptor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;I have only done simple tests with these modifications so far, but by adding a timer in the PC program that starts at the beginning of the PC-USB transmission and stops after the PC receives the echoed data back from the dev board, I have been able to verify that the round trip time for 1024 bytes is ~600µs (slightly more than 2x microframes at 125µs each.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2018 21:11:33 GMT</pubDate>
    <dc:creator>nbgatgi</dc:creator>
    <dc:date>2018-09-19T21:11:33Z</dc:date>
    <item>
      <title>MCUXpresso USB Generic HID Example - High Speed and 1kB Packet Size</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUXpresso-USB-Generic-HID-Example-High-Speed-and-1kB-Packet/m-p/847527#M1159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I attempted to ppst this as a blog, but I wasn't allowed to select a "place" which prevented the post, so starting a new discussion is the next best thing.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Here are the details:&amp;nbsp; I was running the USB generic HID device example code from the MCUXpresso SDK for the LPCXpresso54608 board (OM13092).&amp;nbsp; This MCU/dev baord was chosen because it included a USB HS PHY.&amp;nbsp; Along with the example code, there is a C# program referenced in the readme which identifies when the correct VID and PID are registered on the PC and allows for data to be transferred to the dev board and receives/displays data that is echoed back.&amp;nbsp; Here is the link to download it, but per the example code readme, you will need to make some modifications.&amp;nbsp; I have attached the modified C# code to this post as well.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;A class="" href="https://www.codeproject.com/Articles/18099/A-USB-HID-Component-for-C" style="color: #2989c5; text-decoration: none;" title="https://www.codeproject.com/Articles/18099/A-USB-HID-Component-for-C"&gt;A USB HID Component for C# - CodeProject&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Default settings for the LPC54608 example code have it running on the full-speed (FS) port (J3) with 8-byte reports.&amp;nbsp; The following changes allow the board to communicate with USB high-speed (HS) on J2 with 1024-byte reports.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;First, changing the following in "usb_device_config.h" switches the active PHY from FS / J3 to HS / J2:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;From:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/*! @brief LPC USB IP3511 FS instance count */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_DEVICE_CONFIG_LPCIP3511FS (1U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/*! @brief LPC USB IP3511 HS instance count */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_DEVICE_CONFIG_LPCIP3511HS (0U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;To:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/*! @brief LPC USB IP3511 FS instance count */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/*! @brief LPC USB IP3511 HS instance count */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I also changed the polling period to be as frequent as possible which I believe is supposed to be 125µs.&amp;nbsp; The change is as follows&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;In "usb_device_descriptor.h" I changed the generic buffer lengths, the HS packet sizes and the interrupt interval&amp;nbsp;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;to be as frequent as possible which I believe is supposed to be 125µs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;From:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_IN_BUFFER_LENGTH (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_OUT_BUFFER_LENGTH (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_COUNT (2U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_INTERFACE_INDEX (0U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_IN (1U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_OUT (2U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_CLASS (0x03U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_SUBCLASS (0x00U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_PROTOCOL (0x00U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x04U) /* 2^(4-1) = 1ms */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x01U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x04U) /* 2^(4-1) = 1ms */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x01U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;To:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_IN_BUFFER_LENGTH (1024U) // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_OUT_BUFFER_LENGTH (1024U) // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_COUNT (2U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_INTERFACE_INDEX (0U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_IN (1U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_ENDPOINT_OUT (2U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_CLASS (0x03U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_SUBCLASS (0x00U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define USB_HID_GENERIC_PROTOCOL (0x00U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (1024U) // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x01U) /* 2^(4-1) = 1ms */ // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x01U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (1024U) // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define HS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x01U) /* 2^(4-1) = 1ms */ // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;#define FS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x01U)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;NOTE - Though I changed the IN and OUT buffer length and packet size above, that was not sufficient to to actually change the packet size.&amp;nbsp; The report descriptor also had to be modified.&amp;nbsp; I was concerned that the parameter associated with the "Report Count" was only one byte, but with some Googling, I found a program that will generate the appropriate hex for the descriptor.&amp;nbsp; The following link explains this pretty well and provides the link to the HID descriptor tool:&amp;nbsp;&amp;nbsp;&lt;A data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Feleccelerator.com%2Ftutorial-about-usb-hid-report-descriptors%2F" rel="nofollow" style="color: #2989c5; border: 0px; font-weight: inherit; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;Tutorial about USB HID Report Descriptors | Eleccelerator&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I included a few extra commented lines to show the descriptor changes for 255, 256, 512 and 768 byte packets with only the 1024 byte line uncommented.&amp;nbsp; The report descriptor is in the file "usb_device_descriptor.c":&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;From:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;uint8_t g_UsbDeviceHidGenericReportDescriptor[] = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x05U, 0x81U, /* Usage Page (Vendor defined)*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x82U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0xA1U, 0x01U, /* Collection (Application) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x83U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x84U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x15U, 0x80U, /* Logical Minimum (-128) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x25U, 0x7FU, /* Logical Maximum (127) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x75U, 0x08U, /* Report Size (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x95U, 0x08U, /* Report Count (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x81U, 0x02U, /* Input(Data, Variable, Absolute) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x84U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x15U, 0x80U, /* Logical Minimum (-128) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x25U, 0x7FU, /* Logical Maximum (127) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x75U, 0x08U, /* Report Size (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x95U, 0x08U, /* Report Count (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x91U, 0x02U, /* Output(Data, Variable, Absolute) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0xC0U, /* End collection */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;To:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;uint8_t g_UsbDeviceHidGenericReportDescriptor[] = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x05U, 0x81U, /* Usage Page (Vendor defined)*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x82U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0xA1U, 0x01U, /* Collection (Application) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x83U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x84U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x15U, 0x80U, /* Logical Minimum (-128) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x25U, 0x7FU, /* Logical Maximum (127) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x75U, 0x08U, /* Report Size (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x95U, 0xFFU, /* Report Count (255U) */ // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x01U, /* Report Count (256U) */ // &amp;lt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x02U, /* Report Count (512U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x03U, /* Report Count (768U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x96U, 0x00U, 0x04U, /* Report Count (1024U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x81U, 0x02U, /* Input(Data, Variable, Absolute) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x09U, 0x84U, /* Usage (Vendor defined) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x15U, 0x80U, /* Logical Minimum (-128) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x25U, 0x7FU, /* Logical Maximum (127) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x75U, 0x08U, /* Report Size (8U) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x95U, 0xFFU, /* Report Count (255U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x01U, /* Report Count (256U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x02U, /* Report Count (512U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;// 0x96U, 0x00U, 0x03U, /* Report Count (768U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x96U, 0x00U, 0x04U, /* Report Count (1024U) */ //&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;lt;--&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0x91U, 0x02U, /* Output(Data, Variable, Absolute) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;0xC0U, /* End collection */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Don't forget to also change the contents of "&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;usb_device_descriptor.h" to match the report descriptor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;I have only done simple tests with these modifications so far, but by adding a timer in the PC program that starts at the beginning of the PC-USB transmission and stops after the PC receives the echoed data back from the dev board, I have been able to verify that the round trip time for 1024 bytes is ~600µs (slightly more than 2x microframes at 125µs each.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 21:11:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUXpresso-USB-Generic-HID-Example-High-Speed-and-1kB-Packet/m-p/847527#M1159</guid>
      <dc:creator>nbgatgi</dc:creator>
      <dc:date>2018-09-19T21:11:33Z</dc:date>
    </item>
  </channel>
</rss>

