USB OTG on VIM3 does not work with ubuntu mainline

I am trying to use USB OTG on VIM3 with Ubuntu 20.04 Kernel 5.18 Mainline image.

I enable the option in /boot/env.txt
overlays=… otg-device

And followed this forum

But still not work

5.x kernel doesn’t support such overlays.

I try on ubuntu 20.04 kernel 4.9 image and found this error when start usb-gadget-khadas.service

khadas@Khadas:~$ sudo systemctl status usb-gadget-khadas.service
● usb-gadget-khadas.service - USB Gadget
Loaded: loaded (/lib/systemd/system/usb-gadget-khadas.service; disabled; vendor preset: enabled)
Active: active (exited) since Wed 2022-10-26 22:50:58 UTC; 8s ago
Process: 4354 ExecStart=/usr/local/bin/usb-gadget (code=exited, status=0/SUCCESS)
Main PID: 4354 (code=exited, status=0/SUCCESS)

Oct 26 22:50:56 Khadas systemd[1]: Starting USB Gadget…
Oct 26 22:50:57 Khadas usb-gadget[4354]: Done creating RNDIS USB Gadget…(unnamed net_device)
Oct 26 22:50:57 Khadas usb-gadget[4354]: Configuring ADB USB gadget driver…
Oct 26 22:50:57 Khadas usb-gadget[4395]: adbd: error while loading shared libraries: cannot open shared object file: No such file or dire>
Oct 26 22:50:58 Khadas usb-gadget[4354]: /usr/local/bin/usb-gadget: 85: echo: echo: I/O error
Oct 26 22:50:58 Khadas systemd[1]: Finished USB Gadget.

Can you try this ?

$ cd /tmp
$ wget
$ sudo cp /usr/lib
$ sync
$ sudo reboot

And try again.


Thank you. It’s worked. ^^

If I want to use VIM3 usb-c as OTG on Mainline, do you have patchs file?