HTC Desire USB Host Mode HOWTO

I have my kernels loading, but the device is unusable, locking up for 5-10 seconds at a time and constantly prompting to “wait or close” applications. Investigating…..

 

New instructions, trying to get ICS working on HTC Desire with USB Host Mode:

  1. Boot into recovery mode (volume down + power etc…) – I’m running Revolutionary CWM v4.0.1.4
  2. Go to Advanced > Partition SD card
  3. I have a 2GB sd card, I selected 1024 mb for the “ext” partition and 256mb for swap partition. Took about a minute to format.
  4. This will setup an app2sd partition for you so that all installed apps go directly on the sd card, handy because the HTC desire only has like 250mb of storage and ICS will fill this up very quickly causing all sorts of issues.
  5. Then install ICS on phone as per these instructions: http://frenchtouch.pro/tutorial/android-ics-for-your-htc-desire/2
  6. Make sure you select the Tiamat Kernel from the ICS Custom Installation menu
  7. Don’t worry about step 7 (Install patched A2SDX) in the above instructions, just reboot the device (and wait quite a few minutes for it to start first time)
  8. (more coming soon)

Building custom kernel 2.6.38 with USB Host Mode Support for ICS installation

  1. See here: http://forum.xda-developers.com/showthread.php?t=2260871 for my step by step
  2. sudo apt-get install lib32ncurses5-dev for make menuconfig to work
  3. git reset –hard  (this will reset our cloned kernel folder to original, deleting all changes)
  4. git clean -f -x -d (this will reset our cloned kernel folder to original, deleting all changes)
  5. patch -p1 < ../HTC_Desire_Hostmode_kernel_2-6-37.patch
  6. make tiamat_bravo_defconfig
  7. make menuconfig (needed to do a sudo apt-get install lib32ncurses5-dev to get this step working )
  8. (if you are using the arm-linux-androideabi-4.4.3 toolchain (instead of arm-eabi-4.4.0) then change the kernel Makefile as per this post)
  9. select all the USB modules you want to build
    1. make sure “Support for Qualcomm MSM7201/QSD8X50 on-chip EHCI USB controller” is selcted
    2. (full list coming)
  10. exit menuconfig and save configuration
  11. make -j4
  12. cp arch/arm/boot/zImage ../new-kernel/kernel/
  13. find . -name “*.ko” -exec cp {} ../new-kernel/system/lib/modules \;
  14. zip up new-kernel along with other files from ( same format at this file http://tim.mactory.com/HTC_Desire/2.6.37_host_mod.zip )
  15. push zip to android in recovery mode and install zip

EDIT: old instructions that worked once for me, but no longer work. Just for reference:

  1. Follow the “Gaining S-OFF” instructions from here: http://wiki.cyanogenmod.org/w/Install_CM_for_bravo
  2. Download the Cyanogenmod ZIP file: http://get.cm/get/jenkins/3075/cm-7.2.0.1-bravo.zip (or another version from http://get.cm/?device=bravo )
  3. Download the USB Host Mode enabled kernel from here: http://tim.mactory.com/HTC_Desire/2.6.37_host_mod.zip ( more details about kernel here: http://tim.mactory.com/htc-desire/ )
  4. Download Google Apps ZIP file from here:  http://goo.im/gapps/gapps-gb-20110828-signed.zip ( or another version from http://goo.im/gapps )
  5. Format the SD card (fat32) from your Desire (mine was a 2GB one) and copy the 3 zip files to the SD card.
    1. (full instructions here http://wiki.cyanogenmod.org/w/Install_CM_for_bravo )
    2. Hold volume down + power, select recovery, wait a few moments, run both “wipe” options
    3. then choose the “install zip” option and “select zip” option and install all 3 zip files:  cm-7.2.0.1-bravo.zip  then  2.6.37_host_mod.zip then  gapps-gb-20110828-signed.zip
    4. press back and choose the restart option
    5. the phone will now boot into the new “cyanogenmod” with usb host mode support
  6. Follow the instructions from here: http://tim.mactory.com/htc-desire/ Connect the USB device, then over a shell/terminal enter these commands: insmod /system/lib/modules/$(uname -r)/kernel/drivers/usb/core/usbcore.ko insmod /system/lib/modules/$(uname -r)/kernel/drivers/usb/host/ehci-hcd.ko
  7. Install one of these apps through Google Play store to check any problems and see if it’s working: https://play.google.com/store/apps/details?id=eu.chainfire.usbhostdiagnostics&hl=en

2 thoughts on “HTC Desire USB Host Mode HOWTO

  1. uldics

    Not working the insmod part, both gives me:
    insmod: init_module ‘usbcore.ko’ failed (Exec format error)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *