VIM3 USB-C port hid mouse emulation

I have solved the problems and got everything to work as it should, here is what one has to do:

  1. Clone fenix ( GitHub - khadas/fenix: One-stop script set to build Ubuntu/Debian images ) on a ubuntu machine
    ( Next in make kernel-config )
  2. Enable gadget support, the Dummy HCD driver and the HID driver
  3. Put the USB in slave only mode
    ( save with make kernel-saveconfig )
  4. Edit the kvims_config ( file is at build/linux/arch/arm64/kvims_config - path was a little different for me, but you should find it around that path )
    ( make image )
  5. Flash the image on the VIM3 ( obviously )
  6. go to /boot/env.txt ( you need sudo ) and add otg-device dwc2 to the overlays ( dwc2 argument is not documented in the file but it works )
  7. save, run sync and reboot
  8. run the tester from here: Linux USB HID gadget driver — The Linux Kernel documentation

Hope this helps anyone who is in the same situation I was.

Thank you @Electr1 for the advice, helped me a lot!

2 Likes