cancel
Showing results for 
Search instead for 
Did you mean: 

USB3DR Peripheral Mode on STM32MP257F-DK

jseely
Visitor

Hi all,

I'm trying to get a USB Gadget device working in Linux on the STM32MP257F-DK board to expose a Mass Storage device to another system. I'm trying to use CN15 for this function but I can't get the bound gadget to show up on the other side of the USB connection.

I'm using a fork of github.com/STMicroelectronics/linux?branch=v6.6-stm32mp where I've modified the usb3dr node of the dk.dts file with the following things:

1. 

836	&usb3dr {
837		status = "okay";
838
839		dwc3: usb@48300000 {
840			phys            = <&usb2_phy2>, <&combophy PHY_TYPE_USB3>;
841			phy-names       = "usb2-phy", "usb3-phy";
842			usb-role-switch;
843			dr_mode = "peripheral";
844			port {
845				dwc3_ep: endpoint {
846					remote-endpoint = <&typec_ep>;
847				};
848			};
849		};
850	};
2. 
840 -	phys            = <&usb2_phy2>, <&combophy PHY_TYPE_USB3>;
841 -	phy-names       = "usb2-phy", "usb3-phy";
842 840	usb-role-switch;
843 -	dr_mode = "peripheral";
841 +	role-switch-default-mode = "peripheral";
841 +	maximum-speed = "high-speed";​

3. 

843 +	
844 +	dr_mode = "peripheral";

4.

844 -	dr_mode = "peripheral";
844 +	dr_mode = "otg";

I've also validated that my hardware connection works by booting into serial downloader boot mode, in which case I've been able to see the `STMicroelectronics STM Device in DFU Mode`.

I did come across this post: https://community.st.com/t5/stm32-mpus-products-and-hardware/stm32mp257dak3-usb3dr-not-working-in-peripheral-mode-under-linux/m-p/796776
It seems like a similar, if not the same issue, but they don't actually detail what they did to the u-boot device tree to make it work. 

Anyway, I'd appreciate any help anyone is willing to give!

Justin

0 REPLIES 0