I have solved the problems and got everything to work as it should, here is what one has to do:
- Clone fenix ( GitHub - khadas/fenix: One-stop script set to build Ubuntu/Debian images ) on a ubuntu machine
( Next inmake kernel-config
) - Enable gadget support, the Dummy HCD driver and the HID driver
- Put the USB in slave only mode
( save withmake kernel-saveconfig
) - 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
) - Flash the image on the VIM3 ( obviously )
- go to
/boot/env.txt
( you need sudo ) and addotg-device dwc2
to the overlays ( dwc2 argument is not documented in the file but it works ) - save, run
sync
and reboot - 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!