I am struggling to get USB working via the “USB2_D_N/USB2_D_P” pins. This is a custom board. The pins are directly connected to a USB connector. I have connected a USB flash drive to it and powered it via 5V. In the device tree, the usb2-2 node is set to mode=otg. To switch to host mode I enter:
echo host | sudo tee /sys/devices/platform/bus@0/3520000.padctl/usb2-2/usb_role/usb2-2-role-switch/role
Actually, I met the same problem. My usb2-0 also is set to OTG mode, but it is type-C port. And nothing happen when it connected to another PC. Do you think it is a hardware issue about the custom board? But it is so confusing that it works when recovery mode?
usb2-0 (recovery USB) works well in both forced recovery and also in Linux. You need the usb0 g_ether for the ssh in initrd anyways to flash the “external” NVME. Otherwise I think there is no way of flashing via recovery.
This is off-topic and you probably need to open another thread (or you get told off here :p). If it does not work for you, it will be a ID switch problem that switches from device to host. This only applies to usb2-0, not usb2-2.
Thanks for your reply. My usb2-0 works well when flashing. But I also want to use it as an connector to communicate with PC. And it maybe a ID switch problem, I have no ides whether it is a dtb issue or a hardware issue. Maybe it is kind of off-topic, I will open a new issue. Thanks again.