I’m trying to get (at least partial) OTG type capability out of USB0. I’ve looked over some 8-9 year old posts on the subject both here and at T.I. E2E forums. Seeing the initial progress in the post by Marc_M at BBB USB0 change from client to host has me thinking that it’s more a matter of getting the power management under control.
Personally, I’m willing to sacrifice automatic detection of USB peripherals and make the host mode change a user-initiated function. But doing so kind of puts me outside the realm of changing the mode in the .dtsi file like Marc_M did.
Does anyone have pointers the driver or gadget API that would help me?
Or maybe pointers to which driver files I should look at to implement the change?
Looking at the schematic for USB1, there’s the possibility of getting that channel to work OTG by pulling R49 and wiring it to a GPIO pin or somewhere off the board…But I don’t think I can sell that to the rest of my crew in the long run.
To answer my own question:
It is a qualified yes. Ugly but doable.
I’m having to make significant hardware addition(s).
Changing the dr_mode from “peripheral” to “host” in am-335x-bone-common.dtsi will force the OS to try connecting to it as a peripheral.
The second thing that needs to happen is that the USB0 power needs to be tied to a stable 5V source…like VDD_5V. Bouncing voltages and/or power removal here will induce spurious reset(s) of the BBB.
The third thing that needs to happen is that the USB_ID line (pin 4 on the mini-usb connector) has to be tied low, instead of left open-circuit.
Of course the USB-A plug on your typical memory stick doesn’t have that 5th pin, which means either an “adapter cable” or something to pull the line down or some other software driven
The fourth thing that needs to happen is that USB power needs to be presented to the peripheral device to be connected. That means giving it a 5V source. And that 5V can’t be the same as the one getting fed to the USB0 port (and the TPS65217 PMIC). Otherwise, the power fluctuations that come with plugging/unplugging are likely to induce BBB resets when things get plugged and/or unplugged.
And yeah, my product solution involves implementing a whole other power management subsystem on top of the one that’s already on the BBB.