USB Host mode for Desire

Search This thread

gr0gmint

Senior Member
Feb 23, 2008
64
7
since i have the MCR3.1 what kernel should i flash after this to un host ???? or it must be 2.2 ???

You could do a nandroid backup.
Or backup your boot image like this: cat /dev/mtd/mtd2ro > /sdcard/boot.img.backup
And then to reflash the boot.img in recovery: cat /sdcard/boot.img.backup > /dev/mtd/mtd2
 
Last edited:

gr0gmint

Senior Member
Feb 23, 2008
64
7
When the ehci-hcd module loads, it throws a -14 (Bad address) error. I wonder if this is easily fixable

Edit: fixed
 
Last edited:

Daelyn

Senior Member
Dec 17, 2006
671
155
I'm just wondering... is it possible to add this to a boot script and make the phone execute the commands at boot time?

Not the best of ideas because when you load these modules you'll loose the normal functions of the micro-USB port like removable storage/interetshare etc.

Use them when needed, unload when not needed.

It should be simple for one with experience in android coding to write widget/script so that you can toggle host USB on and off. Give it a few days at most and someone will sort it.

I'm a linux user, but never had a android, so I'm in the process of reading through all that I need to know before getting my hands dirty.
 

lambrospower

Senior Member
Jul 5, 2009
508
2
Nicosia
www.mastergenius.net
hey, i received the cable today....

firstly: i have a screen problem with the kernel..whenever i touch the screen many white lines appear randomly

i loaded the 3 modules i want (the two you say and usb-storage one) and then i try to mount the usb i attached to the cable with the command

mount -t vfat /dev/block/sda1 /mnt/sdcard/usb-storage

as it is described in sven's tutorial here: http://sven.killig.de/android/N1/2.2/usb_host/

but i get mounting failed because there is no such file or directory...

some notes::::
- i am using MCR3.1
- i attached the usb directly onto the cable...not a powered hub
 

BrandonG777

Senior Member
Jan 29, 2010
88
4
Tulsa, OK
Modaco R20 didn't boot for me with this kernel. This project is awesome, hopefully it'll get swooped up into Cyanogen and have a settings option to switch back and forth.

I have a 2008 Pontiac G8 and people have been putting a USB touch screen overlay over the factory display, that has NTSC composite inputs. I'm planning the ultimate car/phone integration ;) After of course flashing the GM LAN bus so the screen will stay on over 2MPH. :mad:
 

lambrospower

Senior Member
Jul 5, 2009
508
2
Nicosia
www.mastergenius.net
hey, i received the cable today....

firstly: i have a screen problem with the kernel..whenever i touch the screen many white lines appear randomly

i loaded the 3 modules i want (the two you say and usb-storage one) and then i try to mount the usb i attached to the cable with the command

mount -t vfat /dev/block/sda1 /mnt/sdcard/usb-storage

as it is described in sven's tutorial here: http://sven.killig.de/android/N1/2.2/usb_host/

but i get mounting failed because there is no such file or directory...

some notes::::
- i am using MCR3.1
- i attached the usb directly onto the cable...not a powered hub


ok today i received my powered usb hub and i tried again. followed the same steps but no result.....
mobules are inserted just fine but when i try to mount the usb storage it says 'file or directory not found'.
i dunno if it's 2.1's fault but i will flash a 2.2 rom tomorrow and test it again...

did anyone had success with 2.1 ????

in addition why is there a screen line flickering with this kernel ???
 

amraving

Senior Member
Jul 5, 2010
104
34
Hi everyone.
This is my first post on xda. I wanted to ask someone who has got this host working if its possible to get a usb dvb (digital video broadcast) receiver to work on android or if it would even be possible.

Thanks guys
 

sonic74

Senior Member
Jan 3, 2010
163
18
Schwabach
sven.killig.de

bemymonkey

Senior Member
Aug 12, 2007
2,524
118
Any news on this? Is there now a way to get host support without reflashing the kernel every time you need it?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Hi,
    I've applied Sven Killig's patches to a 2.6.32 kernel similiar to DeFroST 0.9b with no-echo patches.
    Kernel update attached. I didn't do anything, please thank Sven Killig for his awesome work.

    r2: Some often used USB modules included. (USB storage built-in)
    r3: Modules are loading now
    r4: Fix for error -14 included

    THERE IS NO GUARANTEE THIS WILL WORK
    GUIDE, IF YOU WANNA TRY IT OUT:
    1. Flash kernel
    2. Go into Terminal emulator and write the following:
    insmod /system/lib/modules/usbcore.ko
    insmod /system/lib/modules/ehci-hcd.ko
    3. Load any other modules you want, ie. usb-storage.ko


    To "un host", just flash the kernel from DeFRoST 0.9b
    1
    Thanks m8 I recieved the OTG cable yesterday so I will try to test this tonight ;)
    1
    Oh, I just realized, if you do the
    git clone git://github.com/teamdesire/cm-kernel.git
    you probably won't get the 2.6.35.7 Kernel version anymore... either check out that version explicitly or just replace "2.6.35.7" by the version number you have anywhere it pops up...
    Sven Killing's patch probably still works... not sure though ;)
    1
    Hey guys,

    sorry I didn't answer for a while, I guess the notification E-Mail must have been filtered out by my spam filter and I didn't check for a while... Here's what I did to get FTDI running:

    1. Get the 2.6.35.7 Kernel source from
    git clone git://github.com/teamdesire/cm-kernel.git
    cd cm-kernel

    2. Apply the Hostmode Patch:
    http://sven.killig.de/android/N1/2.2/usb_host/android-kernel_msm-bca5320_Nexus-One_usb-host.patch

    3. Activate Hostmode in the config. Either manually with

    make cyanogen_bravo_defconfig
    to get the standard config and then

    make menuconfig
    to customize

    or you can take my .config file (see attachment)

    4. compile:

    make

    5. Take a Kernelimage, (I took cm_default.zip from the third post of the seventh page of this thread, http://xdaforums.com/attachment.php?attachmentid=421496&d=1287359589) and unzip it.

    6. Replace the kernel/zImage from the zip file with the zImage which you find in:
    cm-kernel/arch/arm/boot

    7. Copy new kernel modules into the folder to zip:
    - cd to system/lib/modules
    - create a folder: 2.6.35.7-cyanogenmod
    - create subfolder: kernel
    - copy all needed kernel modules which you find in your kernel source for example under "drivers/usb/" into the new folders, but keep the folder structure intact.
    - Files you need for Hostmode:
    drivers/usb/core/usbcore.ko
    drivers/usb/host/ehci-hcd.ko
    drivers/usb/serial/usbserial.ko
    drivers/usb/serial/ftdi_sio.ko

    I also copied all other modules which were included with the "cm_default.zip" into it's corresponding folders, though I'm not sure if they are needed.

    8. Zip the folder
    zip -r <YOUR_ZIPNAME.zip> kernel META-INF system

    9. Copy onto your device's sdcard

    10. Start in Recovery

    11. Apply zip from sdcard
    -> Select your ZIP file

    12. Reboot

    13. Now you need a terminal connection. Unfortunately that does not work any longer via USB, because it's now running only hostmode. There is a solution using "adbWireless" just install that from the marked and you can connect to your phone via WLAN using:
    adb connect <PHONE'S IP>:5555
    adb shell

    14. In a shell enter the following:
    su
    cd /system/lib/modules/2.6.35.7-cyanogenmod/kernel/drivers
    /system/bin/insmod usb/core/*
    /system/bin/insmod usb/host/*
    /system/bin/insmod usb/serial/usb*
    /system/bin/insmod usb/serial/ftdi*

    you should write a shell script for this, b/c it's annoying to do this by hand every time :D

    15. now the modules should be loaded.

    I also attached my kernel-image file, so you don't need to compile.

    I am currently working on writing a wrapper program for the FTDI device, since you need SU rights to control a ftdi device and there's no way to enable that for a Java app. I am using libftdi for this which works good so far.

    I hope I was able to help you.

    -Tim

    Hey there Mastaxlokks! Ive been trying to use your instructions to modify a kernel, but could not understand how to apply sven killings patch. Could you please clarify that?

    Thanks in advance
    1
    I haven tried to compile that kernel, but the old kernel patch does not work for 2.6.35.9, so I'm sure it won't work with your Kernel either.
    I found some other patch which I had to modify slightly, but now works with my kernel. You could try if it also works for your kernel. You'll find it attached.

    You will then need to download the kernel source:

    mkdir -p ~/android/kernel
    cd ~/android/kernel
    git clone git://github.com/teamdesire/cm-kernel.git
    cd cm-kernel
    git checkout android-msm-2.6.37-unified

    The rest should work like I explained in a previous post:
    http://xdaforums.com/showpost.php?p=12083199&postcount=117

    Just replace the kernel checkout with the above and take the attached patch instead of the old one...

    You can manually configure your Kernel, or try my config file for my 2.6.35.9 kernel which I attached. (It is named .config_host after unzipping, so it'll probably be invisible)

    Hope this works for you.