AnsweredAssumed Answered

USB Generic HID example program setup

Question asked by Nick Guzzardo on Mar 19, 2019
Latest reply on Apr 26, 2019 by Nick Guzzardo

The USB Generic HID example program receives data via USB device port and echoes that data back on the same port.  I have used this program successfully with the LPCXpresso54608 eval board using the high-speed (HS) PHY.  We have since decided to move the the i.MX RT1064 MCU.  To make a clean transition, I need to reproduce my test results from the LPCXpresso54608 on the MIMXRT1064-EVK.

 

I was able to download and install the SDK into MCUXpresso v10.3 and create the generic HID with FreeRTOS example code project which was nearly identical with the exception of processor specific items.  For the LPC project, I modified it to more closely represent our intended use case.  Aside from a dummy RTOS task and simple data manipulation, the USB related changes were to configure the MCU to us the HS PHY and increase the packet size to 1024 bytes.

 

For both projects, the file usb_device_config.h was identical with the exception of some comments at the beginning regarding copyright.  Here are the original 4 configuration definitions:

 

/*! @brief KHCI instance count */
#define USB_DEVICE_CONFIG_KHCI (0U)

/*! @brief EHCI instance count */
#define USB_DEVICE_CONFIG_EHCI (1U)

/*! @brief LPC USB IP3511 FS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)

/*! @brief LPC USB IP3511 HS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511HS (0U)

 

Note that the stack has been configured to be and enhanced host controller interface (EHCI), but since this project is intended to be a HS device (not host), I changed the configuration to the following:

 

/*! @brief KHCI instance count */
#define USB_DEVICE_CONFIG_KHCI (0U)

/*! @brief EHCI instance count */
#define USB_DEVICE_CONFIG_EHCI (0U)

/*! @brief LPC USB IP3511 FS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)

/*! @brief LPC USB IP3511 HS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)

 

This is the configuration that worked in my LPC project.  This definition leads to a variety of configuration specific initializations and function calls being enabled through compiler directives which leads to my question/concern.

 

In the LPC project there were several compiler directives that clearly separated EHCI from HS-device (LPCIP3511HS) configurations.  In the i.MX project it seemed to only have options for EHCI.

 

1)  Has anyone attempted to use the generic HID example program successfully?

2)  If so, did you have to make modifications in the file hid_generic.c to exclude EHCI function and include HS device function via the OTG PHYs?

Outcomes