|
|
#1 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
[WIP] USB Host Mode
I recently bought a USB OTG cable and a powered USB hub in the hopes of getting USB host mode working on my Glo. I'm just stumbling through this, so I decided to go ahead and post what I've figured out so far, and maybe I can get some advice here and there.
![]() References
My setup is this: USB keyboard > powered USB hub > USB OTG cable > Kobo. I've compiled a kernel from the KoboLabs imx507 source with built-in support for USB Host mode on the OTG port, as described in the Freescale imx507 documentation. I also added support for USB HID devices (I'm assuming this is what I need for keyboard support). The only change I had to make to get the kernel and modules to compile was to add the line "#include <mach/mx51.h>" to arch/arm/plat-mcx/ehci.c. My kernel config: Spoiler:
The new kernel runs with no problems that I've noticed on my Glo, but trying to insmod the g_hid.ko module gives the error: Code:
g_hid: Unknown symbol usb_gadget_register_driver (err 0) g_hid: Unknown symbol usb_gadget_unregister_driver (err 0) Using strace on "insmod g_hid.ko" shows that it fails on init_module. Code:
uname({sys="Linux", node="(none)", ...}) = 0
open("g_hid.ko", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0664, st_size=30541, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\1\0(\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 30720) = 30541
read(3, "", 179) = 0
close(3) = 0
init_module(0x95040, 30541, "") = -1 ENODEV (No such device)
write(2, "insmod: can't insert 'g_hid.ko':"..., 48insmod: can't insert 'g_hid.ko': No such device
) = 48
exit_group(1) = ?
Output of dmesg after reboot and trying to load g_ether and g_hid: Spoiler:
If anyone has any suggestions I'd love to hear them. Like I said, I don't have any real clear idea what I'm doing, but I figured I'd try to do it anyway.
|
|
|
|
|
|
#2 |
|
Time Waster
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 422
Karma: 289160
Join Date: May 2011
Device: Kobo Glo and Aura HD
|
Maybe "insmod g_hid" needs an argument? I see here: init_module(0x95040, 30541, "")
That empty string is suspect. Anyhow. Despite having g_hid loaded or not, when you attach the usb keyboard dmesg should show something, if it does not there's probably something wrong. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Here's the output of dmesg after plugging in my keyboard:
Code:
usb wakeup is here the otgsc is 0x82c0f20, usbsts is 0x80, portsc is 0x1c000804, wakeup_irq is 0x80000000 otg udc vbus rising wakeup try_wake_up_udc: udc out low power mode [msp_int-1573] MSP430 interrupt triggered !!! usb plugged 1-0 power_supply mc13892_charger: charger status: online Code:
filename: g_hid.ko license: GPL author: Fabien Chouteau, Peter Korsgaard description: HID Gadget depends: arcotg_udc vermagic: 2.6.35.3-850-gbc67621+ preempt mod_unload modversions ARMv7 parm: iSerialNumber:SerialNumber string parm: iProduct:USB Product string parm: iManufacturer:USB Manufacturer string parm: bcdDevice:USB Device version (BCD) parm: idProduct:USB Product ID parm: idVendor:USB Vendor ID |
|
|
|
|
|
#4 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
g_hid is the gadget driver. That means it is the driver that would allow the Kobo to _act_ as a HID _device_, not as a host to a device. What you would need is:
- the HCD (host controller) driver, - basic USB device drivers (hub), - USB HID _device_ driver |
|
|
|
|
|
#5 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Much thanks for the clarification, hawhill. I'll keep trying stuff and see what I come up with.
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
I most likely won't be able to work on this for a while, so I'm posting what I've got so far. USB Host mode is working, I tested with a USB keyboard, USB mouse, and USB flash drive. They all work as long as you provide power (for example with a powered USB hub). But the kernel is Host mode only. This means that you cannot manage your Kobo with your computer via USB anymore, since that requires device mode.
This is possible thanks to the great work of some people over on the Top Hat forums, who based their work on the Kobo XCSoar USB Host kernel. The kernel can be found in the USB-hot-plug branch of the XCSoar-Kobo-Build GitHub repository. My kernel config file, which has the selections needed for USB HID devices, I've uploaded on PasteBin. |
|
|
|
|
|
#7 |
|
Addict
![]() ![]() ![]() ![]() ![]() Posts: 257
Karma: 432
Join Date: May 2014
Location: New York, NY
Device: NG,NSTG,NST,AuraHD,OnyxT68,Lynx, BoyueT62,NGP,Aura1,Oasis,Mars
|
Will the Kobo charge when in Host mode ?
|
|
|
|
|
|
#8 |
|
Addict
![]() ![]() ![]() ![]() ![]() Posts: 257
Karma: 432
Join Date: May 2014
Location: New York, NY
Device: NG,NSTG,NST,AuraHD,OnyxT68,Lynx, BoyueT62,NGP,Aura1,Oasis,Mars
|
Also: is the powered hub absolutely necessary ?
For instance Nook Simple Touch is able to drive an external USB keyboard w/out a powered hub. |
|
|
|
|
|
#9 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
I believe the Kobo did still charge while in host mode.
I wasn't able to get my USB keyboard to work on my Kobo without using a powered hub, so it does seem necessary. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| USB Host Mode on Kobo? | meskusala | Kobo Reader | 17 | 09-25-2013 06:29 PM |
| USB Host Mode (Master Mode) on K3 | ericepe | Kindle Developer's Corner | 1 | 01-24-2012 05:59 AM |
| USB host mode hacking | scotsman | iRex | 22 | 08-04-2010 07:29 PM |
| 302 USB host mode, or: WOW! | Serif | PocketBook | 5 | 06-10-2010 06:35 AM |
| USB Host Mode? | brecklundin | PocketBook | 2 | 11-19-2009 03:49 AM |