ckuethe / usbarmory

Scripts, learnings, sample configurations, and random whining
GNU General Public License v2.0
145 stars 21 forks source link

gadgetfs for HID #3

Closed azman0101 closed 9 years ago

azman0101 commented 9 years ago

Hi,

I'm trying to get usbarmory acting as a keyboard with Gadgetfs.

Using this: https://github.com/ckuethe/usbarmory/wiki/USB-Gadgets

And this: https://wiki.tizen.org/wiki/USB/Linux_USB_Layers/Configfs_Composite_Gadget/Usage_eq._to_g_hid.ko

I'm not understand the line: "#echo ci_hdrc.0 > UDC" I get an error "Device busy"

g_ether is already loaded and I'm user usb0 as CDC to communicate with usbarmory by ssh.

Do you have a simple tutorial for gadgetfs ?

ckuethe commented 9 years ago

Writing the driver's name into the UDC file causes the configuration to be loaded and activated. That first line is commented out since I'd prefer to automatically retrieve the name of the driver, which can be found in /sys/class/udc

Yes, you will get device busy since the controller is already in use as an ethernet device; you can add another function to your combindation device and reboot, or connect via a proper serial console and reconfigure the USB interfaces.

I've updated the Gadgets page with an example integration of a HID functions, which causes my host to see a keyboard.

[18219.193815] hid-generic 0003:1D6B:0104.0003: input,hidraw1: USB HID v1.01 Keyboard [Inverse Path USB Armory] on usb-0000:00:1a.0-1.2.4/input4