Hi,
We are working on an AM335x based board which draws heavily from the Beaglebone Black. The USB1 circuit is slightly different however. Notable points are:
--> The ID pin is permanently grounded.
--> The USB VBUS is not connected outside. We have power directly being supplied through a TPS27082 switch to the USB device USB1 connects to.
--> USB_DRVVBUS is left open.
With this circuit, our basic functionality of USB Host mode operation was fine. I also tried to operate as a USB Peripheral, thus asking the other side to operate as Host. For this, the following was done:
--> in the file "am335x-bone-common.dtsi", "dr_mode" was set to "otg" and built. Corresponding DTB was used.
--> Through SW option, I made the IDDIG signal High/Not connected. IDDIG and IDDIG_MUX Bits were set accordingly in the USB1_MODE Register.
--> Upon attaching a Gadget (e.g. - g_mass_storage) - a PC or a BBB recognized our device as a Mass storage gadget.
(The USB connector was changed appropriately in the two different scenarios).
Now, we face the situation of switching from the first condition to the second dynamically, i.e. - a dynamic "role switch". In order to do this, the first hurdle we are facing is that our device is not enumerating the device connected to the other end when our Kernel/DTB is operating in "otg" mode. I understand that MUSB driver in OTG Mode does not start unless a gadget is attached. Upon doing the following:
--> Attaching g_mass_storage and dependent modules.
--> Not changing the ID Pin - which is by default tied to GND.
Upon doing this, the Gadget attaches and goes into Suspend Mode. Upon attaching a device, there is no change in this state. My expectation was that it will start as a USB Host. The first issue we are facing here is how to enumerate a device while our MUSB has started in "OTG" Mode.
While looking at posts on this forum, I found that there is a lot of talk about Capacitance connected to VBUS line. Honestly, I do not know anything about this. I checked our schematic to find that a 100N Capacitor is connected at VBUS side of the external Device. Since the design is such that our board's VBUS and the device VBUS are not connected - I am confused about which side the capacitor should be on.
Any advise would be greatly helpful. It would be very helpful if I know if we have to change our schematic for the VBUS/Capacitance issue.
Thanks in advance for the help,
Best Regards,
Avinash