Erratic USB host behavior with USB hubs MIMXRT1064.

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

Erratic USB host behavior with USB hubs MIMXRT1064.

1,204 Views
max3
Contributor I

(I'm on the newest SDK and newest version of MCUXpresso)

This the second time I'm writing this post because the last time it failed to submit for some reason. Due to that, I'm going to be briefer this time.

Essentially the host_hid_mouse_keyboard_freertos example, and all other examples, fail erratically with USB hubs. I'm trying to use one port on the MIMXRT1064EVK (tried multiple EVK boards and custom designs) for a mouse and keyboard using a USB hub. However, I get very random behavior when trying this. It seems the hub is always detected, however, most of the time the mouse gets attached then detached, and rarely the keyboard is ever enumerated. Rarely, however, the mouse and keyboard both work until unplugged and plugged back in again.

 

I'm using this keyboard + hub combo and a generic USB mouse for testing right now:

https://www.amazon.com/Penclic-Office-Wired-Ergonomic-Keyboard/dp/B07R6YFKVZ

However, I've tried various hubs and various combinations of USB keyboard and mice. I've also tried powered hubs. Note that the keyboard (non hub version)/mouse work fine on their own as a single device without the hub. 

 

Here is the common failure scenario (output from example) :

Sometimes the keyboard is also enumerated and quickly detached for some reason like we see the mouse is.

 

 

hub attached:level=1 address=1

hid mouse attached:pid=0xc077vid=0x46d address=2

mouse attached

enumeration failed

enumeration failed

mouse detached

 

 

 

I would show an example of it all working, but I'm unable to get it to do it ever right now, however, a few minutes ago I got it working briefly.

I'm worried this is a silicon issue, but at the very least it seems like a low-level USB driver problem. I've even tried USBX (with some modifications to get things somewhat working) and I'm getting what seems to be similar behavior. Both stacks seem to fail because a device won't respond at some point. If that means anything to anyone.

Labels (1)
0 Kudos
4 Replies

1,156 Views
max3
Contributor I

issue seems to be caused by a too-small default value for 

USB_HOST_EHCI_PORT_RESET_DELAY
 
upping the value to 500ms causes the keyboard to attach after one failed enumeration, which is fine.
 
there is still some weirdness in some of the hub ports not working properly, but it works on reset.
0 Kudos

1,167 Views
max3
Contributor I

Has anyone else been able to use hubs on their device?

0 Kudos

1,190 Views
max3
Contributor I

I've also checked and it seems the hub + keyboard + mouse only take up 4 endpoints on my windows machine. 

0 Kudos

1,203 Views
max3
Contributor I

I thought it might be somewhat helpful to show the log of those devices on my windows machine in case something is interesting there.

I've attached a screenshot of that below. However, note that I've tested with many combinations of hubs and mice/keyboards, so the specific device is not the issue here.

0 Kudos