Tool/software:
I have a custom AM3358 board running Linux 5.15.0 that is currently set up to use USB0 as a peripheral with mass storage and ethernet gadgets and USB1 as a host connected to a modem. These features work as expected. I am trying to experiment with setting up USB0 to be OTG, but without success. The initial test is to see if something happens when I plug in a flash drive, but I have not observed any change. I am not sure if there is a configuration problem, or if the hardware design is incapable of supporting OTG.
Here is a description of the USB0 circuit: the USB0_VBUS pin on the AM3358 is not connected to the VBUS pin on the connector, but is rather permanently pulled high through a ferrite bead. USB0_ID is also not currently attached to the USB connector; it floats, but I can manually connect it to ground. I do not have access to either USB0_VBUS or USB0_DRVVBUS pins. (FYI, USB1, which is set up as a USB host, likewise has USB1_VBUS permanently pulled high, and has USB1_ID connected to ground.) My understanding from the documentation is that USB0_ID controls the OTG mode: ground => host, floating => peripheral. (Question: is USB_ID supposed to be pulled high internally? I do not see any voltage on it.) The board has a microUSB-B jack (female). For the purpose of this test, I am using a USB-A female to microUSB-B male adapter and a USB-A splitter so that I can externally apply 5V to the cable-combination VBUS. Before inserting the flash drive, I manually apply ground to USB0_ID. This particular flash drive momentarily lights up since power is present, but there is no indication of detection or access in the AM3358 console terminal or in dmesg.
Question: can this hardware setup work as is? The AM3358 should detect that USB0_VBUS is greater than 4.4V because it is pulled high, but does it expect it go low before going high? If it can work, am I making the right assumptions about the test setup (in particular USB0_ID)?
If it can work, then I wonder if I do not have the correct kernel configuration. I have set usb0 dr_mode="otg". In addition to the original setup for USB functionality (with usb0 dr_mode="peripheral" and usb1 dr_mode="host"), I have added CONFIG_USB_OTG=y and tried with and without CONFIG_USB_ROLE_SWITCH=y. The complete USB configuration is:
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_OTG=y
CONFIG_USB_ACM=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_AM35X=y
CONFIG_USB_MUSB_DSPS=y
CONFIG_USB_TI_CPPI41_DMA=y
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_SIERRAWIRELESS=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_AM335X_PHY_USB=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG=y
CONFIG_USB_GADGET_VERBOSE=y
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=32
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_ROLE_SWITCH=y
(I also added CONFIG_USB_GADGET_DEBUG and CONFIG_USB_GADGET_VERBOSE, but I do not see any additional logging output.)
If it is of any help, I also ran the 8105.chkusb.sh script I found in the response to a similar question in the forum:
Question: am I missing something from the configuration?
Thanks for any help you can provide. Please let me know if I can supply any additional information.
dave