This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Updating USB to OTG and testing

Other Parts Discussed in Thread: AM3354

My AM3354 board is currently configured with 2 USB Host ports. I'd like to change them to OTG configuration and then verify the functionality of them (that they can be used as both peripheral and host as well as doing some test transfers).

I have 3 questions about this work.

1) I see that in the device tree I have them currently configured for host operation.

		musb: usb@47400000 {
			status = "okay";

			control@44e10000 {
				status = "okay";
			};

			usb-phy@47401300 {
				status = "okay";
			};

			usb-phy@47401b00 {
				status = "okay";
			};

			usb@47401000 {
				status = "okay";
				dr_mode = "host";
			};

			usb@47401800 {
				status = "okay";
				dr_mode = "host";
			};

			dma-controller@07402000  {
				status = "okay";
			};
		};

I can change the two usb nodes dr_mode property to be "otg" but is that all that is required, or is there more to it?

2) Once I have the ports correctly configured for OTG I'd like to run some verification tests to make sure the functionality works as expected. This would include making sure they operation both as peripheral, slave, devices as well as host, master, devices. Does TI have, or know of, any such software packages that can verify the full OTG functionality of the AM3354 device?

3) I've read that when using OTG devices a special OTG USB cable is required. Is this the case or can any USB cable be used?

  • Mike,

    1). the dr_mode binding is the sw requirement for the controller to be able to transit between host and device mode. The hw design should also meet the requirement for DRD mode, a power switch is required to control VBUS, VBUS pin and DRVVBUS pin should hook up correctly. The AM335x GP EVM USB0 port design can be a reference.

    2). We don't have such validation package. For host mode, you can enable the USB Class driver(s) you need in kernel and plug in the corresponding USB devices and run applications to test. For device mode, you can enable the required USB Gadget driver(s) then hook up to a USB host port and run your application.

    Please note AM335x only support dual-role mode switching based in the USB cable insertion, not full OTG such as SRP, HNP, ADP protocols.

    3). The mode switch is controlled by the ID pin from the micro-AB connector. To transit to host mode, you should use micro-A cable which ground the ID pin in the plug header; to transit to device mode, you should use micro-B cable which does not ground the ID pin in the header.