Author Topic: iMXRT defining USB device port as fullspeed?  (Read 2935 times)

Offline jackking

  • Newbie
  • *
  • Posts: 31
    • View Profile
iMXRT defining USB device port as fullspeed?
« on: May 22, 2021, 02:28:00 PM »
I have a USB isolator (ADuM3160) on my design which limits he USB speed to 12 Mbps (FS) for the USB device port. 
The USB host port does not have this limitation.

Is there a way to define the USB ports of the iMX to be fullspeed on just the device port (or any port)?

I tried to change a few defines in iMX.h around line 1172, but it seems to configure both ports simultaneously, and I could not get USB_FS_INTERFACE to build at all.

Code: [Select]
// HSUART configuration
//
#define USB_HS_INTERFACE
#if defined iMX_RT105X || defined iMX_RT106X
    #define HSUSB_CONTROLLERS   2
#else
    #define HSUSB_CONTROLLERS   1
#endif
#define iMX_HSUSB_1             0
#define iMX_HSUSB_2             1
#define USBS_AVAILABLE          HSUSB_CONTROLLERS

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: iMXRT defining USB device port as fullspeed?
« Reply #1 on: May 22, 2021, 02:38:40 PM »
Hi

The USB FS driver is used by the Kinetis parts and can't be used by the iMX RT since it has HS USB copntrollers.

To operate the HS driver in FS mode you can do the following when configuring/opening the interface:

USBTABLE tInterfaceParameters;
..
tInterfaceParameters.usConfig = USB_FULL_SPEED;
..
USBPortID_MSD = fnOpen(TYPE_USB, 0, &tInterfaceParameters);


Instead of the normal USB_HIGH_SPEED configuration the USB_FULL_SPEED configuration sets the HS USB into a fixed FS mode so that it operates only at 12Mb/s rather than 480Mb/s and is thus compatible with HW that can't physically run faster due to things like filters in the cables.

Regards

Mark


Offline jackking

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: iMXRT defining USB device port as fullspeed?
« Reply #2 on: May 22, 2021, 04:03:23 PM »
oh, searching for that I also see a switch based on the define:
Code: [Select]
#define HS_USB_USES_FS
This seems to work for my purposes also.

Thanks!

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: iMXRT defining USB device port as fullspeed?
« Reply #3 on: May 23, 2021, 12:09:55 AM »
Hi

Yes, there is such an option for the serial loader build since this is not the first time that such filters have required forcing the USB device to stay in full speed mode (to do this it simply doesn't respond to the host's high speed chirp after the USB reset and then the host falls back to FS mode).

Regards

Mark