I am using a custom i.MX6UL board running Linux 4.1.15 from NXP. When I configure the first USB (usbotg1) through the Linux device tree file as OTG (dr_mode = "otg";), I can switch between host and peripheral mode by grounding and floating the OTG ID pin.
The problem I am having is that if I ground the OTG ID pin to go into host mode and don't have a device connected within 10 seconds of grounding the OTG ID pin, I get the following message and then no matter what device I connect there is no detection of it:
ci_hdrc ci_hdrc.0: Device No Response
I traced this message down to the a_wait_bcon_tmout() function in the drivers/usb/chipidea/otg_fsm.c file, but I am not sure what BCON stands for or where this function is getting called from in other parts of the USB drivers.
If I connect a device within 10 seconds after I ground the OTG ID pin, the device is detected and works as expected.
Does anyone have any ideas why the USB detection stops working after 10 seconds and how to prevent this from happening when running in OTG mode as a host?
I removed all references to the "a_wait_bcon_tmout" function in the following files:
drivers/usb/chipidea/otg_fsm.c
drivers/usb/phy/phy-fsl-usb.c
After doing this the problem seemed to go away. Since I don't understand what the BCON timeout is I am not very confident in this being the fix to my issue. Is it safe to just remove the BCON timeout? Is this timeout really needed?
Hi,
I have tried on the i.MX6UL EVB with the Linux 4.1.15 precompiled image, and, when connecting the OTG adapter (which connects the ID pin to GND), it is detected as a HUB; however, I let it running for a while (more than 10 seconds) and the timeout message never appear.
Regarding your workaround, such timeout is used to poll the USB services searching for a Device, so, in order to not having a poll task on an infinite loop, so, just the polling task will remain forever if you remove the timeout (other option could be increasing the timeout to a larger window).
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!
-----------------------------------------------------------------------------------------------------------------------
Carlos,
If the timeout is used for searching for a device and the polling for a new device stops after the timeout, what happens when you connect a device after the timeout period of 10 seconds? It would seem to me that if the polling stopped then it would not detect the device like I am seeing. Can you connect a USB device 10 seconds after grounding the USB OTG ID pin and see if populate?
Could this issue with timeout and not detecting USB devices be related to the TX and RX resistance and current trimming values that can be adjusted on the USB PHY?