cancel
Showing results for 
Search instead for 
Did you mean: 

stm32mp255 USB-C VBUS GPIO device tree configuration

erich664
Associate
I am trying to configure a USB-C connector on a peripheral device to detect VBUS via GPIO (PH9). I have tried several iterations using the following device tree documentation.
The only way I have been able to get USB traffic to occur is by using the role-switch-default-mode attribute, but that comes with the warning about VBUS:
Forcing default mode bypasses the vbus detection, which is normally required to raise the pull-up resistor on D+ data line. This makes it non compliant with USB specifications. Recommended method to implement peripheral only role, is to use GPIO to detect Vbus,
 
And I suspect this warning is the reason why USB traffic doesn't come back after coming back out of suspend/low-power mode.
Example snippet of a configuration I've tried is as follows:
/ {
	usb_c_connector {
		compatible = "usb-c-connector";
		label = "USB-C Connector";
		type = "usb-c";
		vbus-gpios = <&gpioh 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
		vbus-supply = <&scmi_vdd3v3_usb>;

		port {
			dwc3_ep: endpoint {
				remote-endpoint = <&typec_ep>;
			};
		};
	};
};
&usb3dr {
	status = "okay";

	dwc3:usb@48300000{
		maximum-speed = "high-speed";
		usb-role-switch;

		port {
			typec_ep: endpoint {
				remote-endpoint = <&dwc3_ep>;
			};
		};
    };
};
 
Is there an example using the DWC3 driver with a `typec` connector and/or VBUS via GPIO?
0 REPLIES 0