I have a imx8mm with type-C connector and Power Delivery chip. When I set up usbotg1 as a host, it works fine. I can connect mass storage device and it's working. Dts settings:
&usbotg1 {
dr_mode = "host";
hnp-disable;
srp-disable;
adp-disable;
disable-over-current;
status = "okay";
};
When I try to set it as a peripheral in dts, load some gadget module and then connect it to host PC there is complete silence on host PC. No usb detection, no error messages, nothing. Dts settings:
&usbotg1 {
dr_mode = "peripheral";
hnp-disable;
srp-disable;
adp-disable;
disable-over-current;
status = "okay";
};
It looks like gadget is configured.
# cat /sys/kernel/debug/usb/ci_hdrc.0/role
gadget
When I load g_ether I can see:
cat /sys/kernel/debug/usb/ci_hdrc.0/device
speed = 0
max_speed = 3
is_otg = 0
is_a_peripheral = 0
b_hnp_enable = 0
a_hnp_support = 0
a_alt_hnp_support = 0
name = 32e40000.usb
gadget function = g_ether
gadget max speed = 5
and usb0 interface is present, but still nothing on host PC.
Is there something more that must be configured to let imx8mm work as usb peripheral?
Solved! Go to Solution.
It turned out that USB1_VBUS line was not correctly asserted and it's watched by chipidea driver I think, so gadget was probably in some sleep mode or something.
It's working now.
Hi I seem to have encountered the same trouble, even setting it to OTG does not work properly.
Can you tell me what you have modified? thank you
I had to set USB1_VBUS line to high when host device is connected to your gadget device. I did it using gpio from power delivery chip.
Solution from this thread helped me also.
https://community.nxp.com/t5/i-MX-Processors/i-MX8-USB-VBUS-voltage/m-p/1266085
Thank you very much for your reply.
I measured the voltage of my S32G-VNP-RDB2 board USB1_VBUS, Looks like it's okay(5v)
And I found some information for Gadget, it seems that before use the OTG-Device function, some configuration (just like PID VID) must be set, so I consulted the manual and made the settings, and then it can run normally.
It turned out that USB1_VBUS line was not correctly asserted and it's watched by chipidea driver I think, so gadget was probably in some sleep mode or something.
It's working now.
The usb1 support dual roles.
How about set it as otg, you can try to see if it can work.