USB Host Initialization OTG1 port IMX6SX VBUS Power

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

USB Host Initialization OTG1 port IMX6SX VBUS Power

1,907 Views
ed_smith_mqx_le
Contributor III
I’m trying to get the OTG1 HOST mode of the MQX usb_v2 stack to work on the IMX6SX for a customer.  It’s failing to initialize because there is an inversion in the state of the the VBUS power specifically the USB_OTG1_PWR control signal.  I have tried a work-a-round using a GPIO for the power issue but this may have caused other problems with resting a connected device during initialization.
1.  The problem.  When the stack starts up it tries to enable VBUS power by setting the PP bit in the PORTSC1 register.  This bit should enable power to the VBUS when it is set and disable power when it clear.  However on the IMX6SoloX Saber board (rev C) the opposite is true.  Power is enabled when the bit is clear and disabled when the bit is set.  While one might think that simply reversing the state should solve the problem there appears to be other operations controlled by the PP bit.  It seems if this bit is set to 0 all internal operations of the USB hardware will not work.
2.  My work-a-round was to change the USB_OTG1_PWR (GPIO1_IO09) into a gpio line and manually control the enable and disable of power.  This has basically worked but there seems to still be other related problems with the initialization and here is where I’m hoping that you have a work-a-round for this problem or can point me to some Linux code that initializes and works with the OTG1 port in host mode.  This is definitely a problem related to using the port in host mode.
Labels (2)
0 Kudos
2 Replies

753 Views
Ed_EmbeddedAcce
Contributor II

Hi Carlos,

Yes what I did was check with the scope the output of the USB_OTG1_PWR while toggling the PP bit in the PORTSC1 register with the debugger.  So I was not actually running any code.  Since we are developing for the SABRE board we don't have the option to use any other pin.  I don't think the errata applies specifically but the problem may be related to it.  It explains why the USB is powered on after reset.  I'm not really familiar with all the details of how the internal hardware works in the USB controller but there seems to be a problem with this bit being reversed and getting the OTG1 to operate in host mode.  Unfortunately all the information I've found seem seems to be related to device mode. I'll check the assignments but other bits in the register seem to be ok so I don't think there is a general register problem.  I'm thinking there must be some test code somewhere where this port was run in host mode and how this issue was worked around.

Thanks

Ed

0 Kudos

753 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Ed,

Have you verified the related hardware connected to the USB_OTG1_PWR pin on the SABRE board?

You could also take a look at the following links with related information

https://community.nxp.com/thread/435499

https://www.spinics.net/lists/devicetree/msg22355.html

Additionally, errata ERR009059 also includes some information regarding USB_OTG1_PWR issues on the i.MX6SX, you could take a look at it:

http://www.nxp.com/assets/documents/data/en/errata/IMX6SXCE.pdf

Finally, have you properly configured the domains for each core (A9 and M4) in order to assign the OTG1 module to be controlled by the M4 (you mentioned it is running MQX, isn’t it?)


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos