MXRT685 USB speed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MXRT685 USB speed

567 Views
12345
Contributor I

Hi,

 

I tried use MXRT685 to set USB higher speed , setting g_UsbDeviceHidGeneric.speed = USB_SPEED_SUPER; but usb packet analyzer shows the speed is the same( approximate 4Mbps), is there another code I need to modify?

 

  • (Test Computer) Intel I5-8265U (AsusPro P3540FA),
  • (Test Env.) MCUXpresso IDE v11.2.0 ,
  • (Test Code) evkmimxrt685_dev_hid_generic_bm

Setting : 

USB_device_config.h:

/*! @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)

Hid_generic.c:

 

tatic void USB_DeviceApplicationInit(void)
{
USB_DeviceClockInit();
#if (defined(FSL_FEATURE_SOC_SYSMPU_COUNT) && (FSL_FEATURE_SOC_SYSMPU_COUNT > 0U))
SYSMPU_Enable(SYSMPU, 0);
#endif /* FSL_FEATURE_SOC_SYSMPU_COUNT */

/* Set HID generic to default state */
g_UsbDeviceHidGeneric.speed = USB_SPEED_SUPER;
g_UsbDeviceHidGeneric.attach = 0U;
g_UsbDeviceHidGeneric.hidHandle = (class_handle_t)NULL;
g_UsbDeviceHidGeneric.deviceHandle = NULL;
g_UsbDeviceHidGeneric.buffer[0] = (uint8_t *)&s_GenericBuffer0[0];
g_UsbDeviceHidGeneric.buffer[1] = (uint8_t *)&s_GenericBuffer1[0];

 

        

 

 

Thanks,

Tseng

Tags (1)
0 Kudos
1 Reply

547 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @12345 ,

The USB device controller in RT685 hasn't USB_SPEED_SUPER speed mode. When USB cable connect, it will switch to USB_SPEED_HIGH. 

If you want higher speed, you can enlarge USB packet size. This example use interrupt endpoint type. And the default packet size is 8. You can set it to 1024. Then you'll get the maximum speed.

The definition is in usb_device_descriptor.h. Please find below definitions.

#define HS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (8U)
#define FS_HID_GENERIC_INTERRUPT_OUT_PACKET_SIZE (8U)
#define HS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x04U) /* 2^(4-1) = 1ms */
#define FS_HID_GENERIC_INTERRUPT_OUT_INTERVAL (0x01U)

#define HS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)
#define FS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)
#define HS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x04U) /* 2^(4-1) = 1ms */
#define FS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x01U)

 

Regards,

Jing

0 Kudos