Enabling USB host functionality on OTG2

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

Enabling USB host functionality on OTG2

774 Views
EmbeddedTech
Contributor III

Hi,

I am working on the IMXRT1060 EVK and would like to use both USB 1 and USB2. The USB device CDC function on the USB1 and the USB host function on the USB2. I have modifies the CONTROLLER_ID for device as kUSB_ControllerEhci0 and for host as kUSB_ControllerEhci1. The Virtual COM functionality is working on USB1 but the host functionality is not working on USB2. Can you please let me know what else should be taken care in order to use USB2 as host.

Thanks.

Labels (1)
0 Kudos
3 Replies

749 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi,

You can use source code attached, the example starts using Ehci0 controller but changes to Ehci1 if you press SW8. Maybe you can use this code as reference.

Have a great day,

Felipe

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored. Please open a new thread and refer to the closed one, if you have a related question at a later point in time. 

------------------------------------------------------------------------------ 

0 Kudos

712 Views
EmbeddedTech
Contributor III

Hi @FelipeGarcia ,

How does the Cache affect the USB host functionality?

If I disable Data Cache (SCB_DisableDCache();) in the main function after board initialization, then it detects the mouse as a peripheral and can get the data on the terminal. But the display update becomes very slow and the startup gif file does not play.

If I do not disable the cache then the mouse is not detected. 

What could be the reason for this?

Thanks.

0 Kudos

733 Views
EmbeddedTech
Contributor III

Hi,

I have done the init similarly only.

I have configured the Ehci0 as device and Ehci1 as host.

The host init is done successfully. But when I connect the mouse it does not print the device information and when I disconnect the mouse it says enumeration failed.

Should I enable any clock or something for USB2?

Thanks.

0 Kudos