0

I'm running PetaLinux on a K26 SoM. There is an HID device connected to my custom board via USB. It is listed under /dev/ directory as /dev/input and it works fine.

What I want to achieve is that I want to redirect this incoming HID data to another device connected to my FPGA via USB connection.

This should work in such a way that the HID device connected to the FPGA should be able to control the computer that is also connected to my FPGA via USB, so during this communication FPGA must be detected as an HID device to the external computer.

I'm open to ideas on how to implement such a thing.

I've done some preliminary research and keywords such as uhidd, libevdev and usbip came up, but I couldn't make sure if any of those would work.

One other thing I found is this wiki page on allowing an FPGA to be detected as an HID device to another computer, I've tried this with my own modifications and it seems to work fine but this is just the detection side of things and my question is about forwarding this HID data.

Thanks.

Tungdil
  • 13
  • 4
  • Look at `usbip`. It does proxy USB traffic over network. – 0andriy Jun 26 '23 at 20:36
  • Hey, I was able to achieve this my using ConfigFS. thanks. – Tungdil Jul 04 '23 at 10:52
  • Ah, okay, there is existing HID gadget, so yes, this way it may work if your USB supports device mode. – 0andriy Jul 04 '23 at 12:29
  • Yes, I had a USB dwc3 on my FPGA so by writing a script for the configuration of ConfigFS and an extra app to redirect the incoming HID data to this virtual device I was able to achieve this. [This link](https://github.com/karacanil/linux-mouse-gadget) is the script I used as a template to achieve this. I know configuration of the ConfigFS has some bugs but this is a good starting point. – Tungdil Jul 06 '23 at 11:34

0 Answers0