Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[WIP] USB Host support (working)

OP verygreen

22nd January 2012, 02:18 AM   |  #1  
OP Recognized Contributor
TN
Thanks Meter: 2,588
 
1,289 posts
Join Date:Joined: Feb 2011
Donate to Me
Hello!

I have been asked into looking for usb host support for nook touch. The hardware appears to be pretty similar to Nook Color, so there were no troubles in that area.



The kernel used by B&N for the Nook Touch is somewhat older than .32 kernel used for Nook Color, so the patch itself required some massage. Surprisingly B&N kernel already has usb host support compiled in, so you don't even need to change anything in kernel config, just apply the patch.

Just like in Nook Color, the id pin in the usb receptacle is not connected anywhere, so a special app is needed to switch the host mode on and off. The Nook Color usbhost switcher should work: https://github.com/verygreen/Nook-Co...bhost-switcher though I cannot compile it for eclair, so I guess that needs some more massage and help here would be appreciated.

Meanwhile you can simply switch the mode from adb, type
Code:
echo host > /sys/devices/platform/musb_hdrc/mode
to enable usb host mode and type
Code:
echo peripheral > /sys/devices/platform/musb_hdrc/mode
to disable it.
The LED at the bottom that usually indicates charging status will light up in usb host mode even if the power is not connected.

The upside is you don't need a special OTG cable and can just use gender changer on your existing nook cable if you so desire.

Now, problems
  • I have not tracked why yet, but self powered mode only works when you try to enable it first with external power plugged in first.
  • The user-friendly tool for usbhost mode switching needs to be compiled for eclair
  • The self-powered mode is very faint. Keeps up with my keyboard, but not even with a simple usb hub.
  • Battery drain is significant, though not sure what part of it is attributed to the usbhost mode and what to adb over wifi
  • Eclair init is buggy so input devices are unusable without a patch, see commit 6405c6953fa02d41d9f6377f4cdb947604f481c4 in google tree to sytem/core/init. I am attaching recompiled init binary that works.

Attachments: binary.zip contains:
  • uImage - prebuilt 1.1 kernel with the patch
  • uRamdisk - root ramdisk with fixed init, adb over wifi
  • init - just recompiled init binary for those who might need it
usbhost_patch.zip - just the patch itself in it's current form.

THANKS TO:
andrewed, who asked me to do this and also provided me with a device. He is on a quest to touchtype on e-paper with a USB physical keyboard, all described here: Project: E-Paper Tablet (typable!)
Attached Files
File Type: zip binaries.zip - [Click for QR Code] (2.00 MB, 1208 views)
File Type: zip usbhost_patch.zip - [Click for QR Code] (13.5 KB, 1330 views)
Last edited by verygreen; 23rd January 2012 at 11:30 PM.
The Following 18 Users Say Thank You to verygreen For This Useful Post: [ View ]
22nd January 2012, 02:38 AM   |  #2  
Senior Member
Thanks Meter: 134
 
208 posts
Join Date:Joined: Jun 2007
Donate to Me
Thats just awesome, thanks!
22nd January 2012, 04:24 PM   |  #3  
Member
Thanks Meter: 6
 
43 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Now the only thing missing is a good ebook composer and publisher, and it becomes symetrical.
The Following User Says Thank You to notriddle For This Useful Post: [ View ]
24th January 2012, 04:30 PM   |  #4  
Member
Thanks Meter: 11
 
49 posts
Join Date:Joined: Nov 2011
That is awesome! How about audio and serial ports?

Thanks!
24th January 2012, 05:39 PM   |  #5  
OP Recognized Contributor
TN
Thanks Meter: 2,588
 
1,289 posts
Join Date:Joined: Feb 2011
Donate to Me
Quote:
Originally Posted by bisbal

That is awesome! How about audio and serial ports?

Thanks!

Audio will most probably require external power source. Also to make audio work there would need to be some changes to the libaudio, likely similar in nature to stuff I did for Nook Color, only for this older release of Android.

Serial ports will likely work as is as I don't think they draw too much power. The kernel support for usbserial would need to be added of course.
24th January 2012, 05:39 PM   |  #6  
Member
Thanks Meter: 17
 
95 posts
Join Date:Joined: Mar 2010
Possibility for Bluetooth dongle? And thus audio?

Sent from my GT-I8150 using xda premium
24th January 2012, 11:11 PM   |  #7  
OP Recognized Contributor
TN
Thanks Meter: 2,588
 
1,289 posts
Join Date:Joined: Feb 2011
Donate to Me
Quote:
Originally Posted by Thiso

Possibility for Bluetooth dongle? And thus audio?

Should be possible, but would require external power for the bt dongle I would think.
25th January 2012, 11:27 AM   |  #8  
Senior Member
Flag Sao Paulo
Thanks Meter: 30
 
266 posts
Join Date:Joined: Mar 2011
Verygreen,

As of now, what is the use? Can I put an external keyboard as it is? Does it need a driver (or something of the sort) for that? Can I put a usb stick? Audio and BT, as I can see, need an extra effort...
Anyway, thank you for your effort. I thought I'd never see something like that for the STR.
25th January 2012, 03:15 PM   |  #9  
OP Recognized Contributor
TN
Thanks Meter: 2,588
 
1,289 posts
Join Date:Joined: Feb 2011
Donate to Me
Quote:
Originally Posted by apeine

Verygreen,

As of now, what is the use? Can I put an external keyboard as it is? Does it need a driver (or something of the sort) for that? Can I put a usb stick? Audio and BT, as I can see, need an extra effort...
Anyway, thank you for your effort. I thought I'd never see something like that for the STR.

You can use keyboard and mouse as is with just the files posted, no extra drivers need. Everything else would need more work at the android side.
25th January 2012, 04:26 PM   |  #10  
Senior Member
Thanks Meter: 24
 
147 posts
Join Date:Joined: Sep 2010
for some phones it is possible to buy usb to audio jack converter, e.g.
http://www.amazon.com/Headphones-Ear...7504575&sr=1-6
I don't know how much effort and changes is needed on kernel side to make it work though.

---------- Post added at 04:26 PM ---------- Previous post was at 04:21 PM ----------

Do I need to copy all three binaries? Also, could you prepare uRamdisk with adb over usb (not wifi) enabled? Thank you in advance.

Post Reply Subscribe to Thread

Tags
usb host, usbhost
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes