cancel
Showing results for 
Search instead for 
Did you mean: 

stm32mp257f-ev1 USB_DRD (CN15) configuration

MBassi
Associate III

Hello,

I notice that on stm32mp257f-ev1 board the USB_DRD port (CN15) is active only if USBPD_DRPSI_CM33_NonSecure_stripped.elf firmware is running.  I need to run a different firmware on M33 while using the USB_DRD port. Searching in board's DT I found the following part:

&mlahb {
intc_rpmsg: interrupt-controller@1 {
compatible = "rpmsg,intc";
reg = <1 0>;
#interrupt-cells = <1>;
interrupt-controller;
status = "okay";
};

i2c_rpmsg: i2c@2 {
compatible = "rpmsg,i2c-controller";
reg = <2 0>;
rpmsg,dev-id = "rpmsg_i2c";
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

typec@35 {
compatible = "st,stm32mp25-typec";
reg = <0x35>;
interrupts-extended = <&intc_rpmsg 0>;
status = "okay";
connector {
compatible = "usb-c-connector";
label = "USB-C";

port {
typec_ep: endpoint {
remote-endpoint = <&dwc3_ep>;
};
};
};
};

};
};

So I'm thinking the point is that the typec@35 node is activated only when i2c_rpmesg is created running USBPD_DRPSI_CM33_NonSecure_stripped.elf. Is it possible to change this configuration?

Regards

Marco.

2 REPLIES 2
Erwan SZYMANSKI
ST Employee

Hello @MBassi ,
You can force USB_DRD in "peripheral" mode (if it can match your use case). In this condition, the M33 firmware is not needed anymore, you can so remove the typec@35 node (I mean disable it) and apply the good configuration on the usb3dr node.

See https://wiki.st.com/stm32mpu/wiki/USB3DR_device_tree_configuration#DT_configuration_example_as_USB2-speed_only_USB3DR_in_Peripheral_mode--with_micro-B-28ID_left_unconnected-29_or_Type-C_connector

Other similar topic: https://community.st.com/t5/stm32-mpus-products/stm32mp257dak3-usb3dr-not-working-in-peripheral-mode-under-linux/m-p/798142

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @Erwan SZYMANSKI 

Sorry for my late reply. Your solution works, but I read in the guide that force peripheral mode ignore vbus detection and is not compliant with USB specifications. So I tried to add vbus following the suggested guide OTG device tree configuration 
I don't know exactly how to define the <&vbus_otg> node required by vbus-supply, I tried the following code changing <&vbus_otg> with <&vbus_5v> in the connector node, It compiles but doesn't work. Maybe I misunderstand something else in the guide?

Regards

Marco.

vbus_5v: vbus_5v {
	compatible = "regulator-fixed";
	regulator-name = "vbus-regulator";
	regulator-min-microvolt = <5000000>;
	regulator-max-microvolt = <5000000>;
	regulator-always-on;
};