The error message you had before 'error inserting 'g_hid.ko': -1 No such device.' is due to incomplete hid gadget driver. You can followDocumentation/usb/gadget_hid.txt to add your