Solved
STM32MP257DAK3 USB3DR not working in peripheral mode under Linux
Hi, ST Community!
We are developing a device based on the STM32MP257DAK3 processor.
In U-Boot and DFU mode, USB works fine
The firmware is built using Yocto (Scarthgap release) with Linux kernel 6.6 from ST and the meta layers meta-st-openstlinux and meta-st-stm32mp.
The device includes a USBPD controller (MAX77958) that is managed by an external microcontroller. This setup is intended to allow USB charging independently of the main processor.
Goal:
We want to enable USB3DR in USB 2.0 peripheral mode (to use USB gadget / Ethernet over USB under Linux).
In U-Boot and DFU mode, USB works fine
→ The PC sees the device
→ Data transfers are successful
→ USB traffic is visible on the oscilloscope
After Linux boots:
→ The PC doesn’t detect the USB device
→ USB lines are completely idle (both lines at 0V)
→ usb1 interface appears in ifconfig
→ No errors in dmesg
Device Tree config (from ST documentation):
&usb3dr {
status = "okay";
dwc3: usb@48300000 {
maximum-speed = "high-speed";
role-switch-default-mode = "peripheral";
usb-role-switch;
};
};Relevant log (dmesg | grep -i usb):
[ 0.085159] usbcore: registered new interface driver usbfs
[ 0.085196] usbcore: registered new interface driver hub
[ 0.085229] usbcore: registered new device driver usb
[ 0.201783] usbcore: registered new interface driver usb-storage
[ 0.202116] usbcore: registered new device driver onboard-usb-hub
[ 0.212602] usbcore: registered new interface driver usbhid
[ 0.212615] usbhid: USB HID core driver
[ 0.300337] scmi-regulator scmi_dev.6: Regulator vdd3v3_usb registered for domain [20]
[ 0.362092] usb-stm32-dwc3 42080000.bus:usb@48300000: configured in usb2 mode
[ 0.365389] usb-stm32-dwc3 42080000.bus:usb@48300000: Enabling runtime PM for inactive device with active children
[ 0.411847] ehci-platform 482f0000.usb: EHCI Host Controller
[ 0.411881] ehci-platform 482f0000.usb: new USB bus registered, assigned bus number 1
[ 0.411994] ehci-platform 482f0000.usb: irq 70, io mem 0x482f0000
[ 0.430691] ehci-platform 482f0000.usb: USB 2.0 started, EHCI 1.00
[ 0.431368] hub 1-0:1.0: USB hub found
[ 0.686236] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 0.847091] hub 1-1:1.0: USB hub foundWhat we’ve tried:
- Set peripheral-only mode in Device Tree
- Tried dual-role, but it seems to require M33/TF-M firmware — not using it at the moment
- Loaded g_ether manually — didn’t help
- Configured usb-role-switch and connector nodes
- Verified power supplies and regulators (e.g. vdd3v3_usb) are OK
Questions:
- Is it possible to use USB3DR in peripheral-only mode without using Cortex-M33 firmware (TF-M)?
- If yes, what’s the correct way to set it up?
Any help or suggestions would be greatly appreciated!
Best regards,
Nikolai
