Welcome, Guest

Author Topic: g_hid module results in kernel crash if used with Windows  (Read 1079 times)

ramtheconqueror

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
g_hid module results in kernel crash if used with Windows
« on: May 25, 2017, 05:55:44 PM »
I have A20-SoM and want to use this as an HID keyboard. Selected "HID Gadget" in USB Gadget support in the config, compiled the kernel and it doesn't work.

Code: [Select]
moprobe g_hid results in "(////g_hid) No such device" error.

Then followed these forum posts:
Code: [Select]
http://www.linuxquestions.org/questions/linux-newbie-8/linux-usb-gadget-hid-driver-problem-840733/
https://communities.intel.com/thread/58917

and added the required details as per this https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt

from this point, loading g_hid module resulting in kernel crash and this error shows up on windows:

Code: [Select]
Unknown USB Device (Device Descriptor Request Failed)
This is the console output:

Code: [Select]
# modprobe g_hid
<6>g_hid: loading keyboard HID descriptor
[sw_udc]: [sw_usb_udc]: binding gadget driver 'g_hid'
[sw_udc]: alloc request: ep(0xc06c8e88, ep0, 64), req(0xee9612c0)
[sw_udc]: alloc request: ep(0xc06c8ed4, ep1-bulk, 512), req(0xee961440)
<6>g_hid gadget: HID Gadget, version: 2010/03/16
<6>g_hid gadget: g_hid ready
[sw_udc]: CONFIG_USB_GADGET_DUALSPEED
[sw_udc]: usbd_start_work
# [sw_udc]: IRQ: suspend
[sw_udc]: ERR: usb speed is unkown
[sw_udc]: IRQ: reset
[sw_udc]: irq: reset happen, throw away all urb
[sw_udc]:
+++++++++++++++++++++++++++++++++++++
[sw_udc]:  usb enter high speed.
[sw_udc]:
+++++++++++++++++++++++++++++++++++++
[sw_udc]: Set address 15
WRN:L1043(drivers/usb/sunxi_usb/udc/sw_udc.c):ERR: dev->driver->setup failed. (-22)
WRN:L1043(drivers/usb/sunxi_usb/udc/sw_udc.c):ERR: dev->driver->setup failed. (-22)
<6>g_hid gadget: high-speed config #1: HID Gadget
[sw_udc]: ep enable: ep1(0xc06c8ed4, ep1-bulk, 128, 8)
nuke: ep num is 0
WRN:L1041(drivers/usb/sunxi_usb/udc/sw_udc.c):ERR: Operation not supported
WRN:L1355(drivers/usb/sunxi_usb/udc/sw_udc.c):handle_ep0: ep0 setup end
[sw_udc]: IRQ: reset
[sw_udc]: irq: reset happen, throw away all urb
[sw_udc]: IRQ: reset
[sw_udc]: irq: reset happen, throw away all urb
[sw_udc]: Set address 15
[sw_udc]: ep disable: ep1(0xc06c8ed4, ep1-bulk, 128, 8)
<6>g_hid gadget: high-speed config #1: HID Gadget
[sw_udc]: ep enable: ep1(0xc06c8ed4, ep1-bulk, 128, 8)
nuke: ep num is 0


If I connect this to Ubuntu 16.04 system, it works as expected.

I'm using 3.4.103 (followed these instructions: https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A20/A20-build-3.4.103-release-5/BUILD_DESCRIPTION_A20_Olimex_kernel_3.4.103%2B_Jessie_rel_5.txt)

Has anyone successfully used OTG as HID keyboard? Any pointers would be appreciated..

Thanks,
Ram

aljumail.mustafa

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: g_hid module results in kernel crash if used with Windows
« Reply #1 on: February 26, 2018, 10:46:08 AM »
Pleas did you manage to solve this problem !

vikaskundu

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: g_hid module results in kernel crash if used with Windows
« Reply #2 on: March 17, 2018, 03:36:13 PM »
Have you been able to work it out? I've been encountering this same "(////g_hid) No such device" error. Couldn't get a way around.