How to enable FTDI Support for your USB Host featuring Honeycomb Tablet (including sample native application)

For many projects it would be great to have an RFID-Reader on your tablet. Sadly there is no Tablet yet that has a built in NFC Chip. However, there are plenty of Readers that connect through USB to your device, and some of them use an FTDI USB Serial Converter for communication over the serial protocol.

Provided you have a USB Host Port and Root on your Tablet it is possible to communicate with a large number of peripherals that use the FTDI chip. And we want to show you how we did it.

To achieve this goal you will need to compile the Kernel Driver Module for FTDI Support in order to have an interface under “/dev/ttyUSB0″ in the end. You do this by downloading the recent Tegra Kernel from the Android Repos:
http://android.git.kernel.org/?p=kernel/tegra.git;a=tree;h=refs/heads/android-tegra-2.6.36;hb=refs/heads/android-tegra-2.6.36

For our purpose we just downloaded a Snapshot of the Kernel.

Note: if you are unsure which kernel version to use, execute step 1 first on your device and return to the repositories to choose the appropriate version.

Follow these steps to compile the new Kernel module.

1. First you need to find the appropriate Kernel version for your Android Tablet. Some manufacturers change the “Extraversion” parameter. Drop into a root shell on the tablet and find out which version you are running; also pull the current kernel config:
# cat /proc/version

extract the kernel config from your device
$ adb pull /proc/config.gz config.gz

2. Set up the current Kernel config for your freshly downloaded Kernel snapshot. Let’s assume you put the the Kernel into ~/kernel/ .
$ zcat config.gz > ~/kernel/tegra-android-tegra-2.6.36-f48009c/.config

3. Configure your new Kernel to create the FTDI module using menuconfig
Let’s say you have your Android NDK under /opt/android-ndk-r5…
~/kernel/tegra-f6874dc$ export PATH=/opt/android-ndk-r5/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/:$PATH
~/kernel/tegra-f6874dc$ make menuconfig ARCH=arm CROSS_COMPILE=arm-eabi- -j4

Navigate to “Device Drivers -> USB Support -> USB Serial Converter Support -> USB FTDI Single Port Serial Driver” [1]
Select it as a Module hitting the “M” key so that it reads “<M>”.

Now adjust the Makefile so the Extraversion fits your extracted version.

~/kernel/tegra-android-tegra-2.6.36-f48009c$ gedit Makefile

4. Compile the module for your system

If you did not yet export the path, then do so now:
~/kernel/tegra-f6874dc$ export PATH=/opt/android-ndk-r5/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/:$PATH

And start compiling the modules:
~/kernel/tegra-android-tegra-2.6.36-f48009c$ make modules ARCH=arm CROSS_COMPILE=arm-eabi- -j4

Your modules should be building now.

5. Your FTDI Kernel module is now located in the “drivers/usb/serial” directory. You can copy it to your tablet now:

~/kernel/tegra-android-tegra-2.6.36-f48009c$ adb push drivers/usb/serial/ftdi_sio.ko /sdcard/

load the module using insmod

~/kernel/tegra-android-tegra-2.6.36-f48009c$ adb shell
$ su
# cd sdcard
# insmod ftdi_sio.ko

And done you are! Connect your FTDI Device (for instance this USB FTDI-Board: http://www.sparkfun.com/tutorials/243) and use this Code to start communicating with your peripheral device (in this case an RFID Reader).

To compile the project files extract them and use Android’s “ndk-build” script.

~/simplectrl/jni$ /opt/android-ndk-r5/ndk-build

The executable file is found in simplectrl/lib/armeabi/simpleserial. Push it to your device, connect your FTDI device and make it executable:

~/simplectrl$ adb push lib/armeabi/simpleserial /data/local/
~/simplectrl$ adb shell
$ su
# cd /data/local/
# chmod 777 simpleserial
# ./simpleserial

This has been tested on a Rooted Acer Iconia Tab A500 with Android 3.0.1 and the Kernel Version 2.6.36.3

We hope we were able to get you started with serial programing over USB :)
Don’t hesitate to comment our post and give us some feedback to improve our mini-article.

[1] you will also find the “USB Profilic 2303 Single Port Serial Driver” there, which is used for many USB-Serial Converters.

75 thoughts on “How to enable FTDI Support for your USB Host featuring Honeycomb Tablet (including sample native application)”

  1. Hi,

    I’ve tried this on Android 3.1, everything work fine until the final step. When i run ./simpleserial, nothing come out n can send any signal.

    the program quit by itself by giving “error!”. Any idea?

  2. Hi, just wanted to say that this is an excellent article. I wanted to ask if the same approach can be applied so as to enable USB to serial for Beagleboard XM. I have been working with Linaro 11.05 build and have been trying to get my USB to serial adapter with Prolific 2303 chip to work under Android 2.2 but have not been able to enable the adapter to work.

  3. @Anthony Kavassis
    Thank you very much!

    The approach should also work for the Beagle XM; However, the Beagle uses another Kernel. My guess is that “Linaro” works with the following Kernel:
    http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=summary

    Depending on your Kernel you may already have the driver installed. Do you have a device called “/dev/ttyUSB0″ or similar if you connect your converter?

    @Sawfan
    I have not tested it yet on Android 3.1… sadly there is no 3.1 update yet for our Iconia A500 :(

    Cheers
    Manuel

  4. Hello Manuel. When I connect the USB adapter it is recognised but when I check it using dmesg but there is no ttyUSB on /dev.

  5. Hi Manuel unfortunately I don’t have the .ko files to do the insmod. I will try to follow the procedure that you outline here for my Xm board. If you have the files and wouldn’t mind send them to me I can certainly try them out and provide feedback :). I have also an FTDI USB to TTL adapter which could certainly be tested as well.

  6. Hey Anthony,

    Since our Kernels are diffrent the kernel module would not work for you… however, if you follow the instructions and compile the module against your current kernel sources you should be successfull :)

    You only need the kernel sources and the crosscompiler (I used the one from the NDK you can however use another one such as the one from codesourcery…)

    I hope I was able to point you into the right direction :)

    Cheers
    Manuel

  7. Manuel for sure you have pointed me in the right direction and many thanks again for your assistance! I do my best to follow the process you outlined and hope to have some positive feedback soon.

    Anthony

  8. Manuel just wanted to say thanks for the help. Although I could not load the kernel modules like the way you described in your article, I recompiled the Linux kernel to include USB serial support with the appropriate modules for FTDI and Prolific PL2303 and ttyUSB came up just fine in /dev/ .

  9. Hey Anthony

    Thank you for getting back here! So probably there must have been a problem with the Kernel module … or maybe with the old kernel? Anyways, it’s probably even the more elegant and convenient solution to include it statically :)

    Cheers
    Manuel

  10. By the way in case anyone is having problem with the omap3_beagle_defconfig, I have used the omap3_beagle_android_defconfig with success on my BB Xm rev B board.

  11. Hi all,

    with slightly different objective ( USB to serial adapter with Belkin chip ) : I was trying to use this guide to add belkin_sa.ko module to Kernel 2.6.32.39 – OC-UV-VFP_FP on Viewsonic G Tablet running Brilliant Corners 1.2.1 firmware. It is Android 2.2 based, but has USB Host Side support.

    No problem following guide using Ubuntu 10.10, NDK r5, but following adb push insmod fails on my Tablet with dmesg stating :

    belkin_sa: disagrees about version of symbol module_layout

    I obtained Kernel source from here : https://github.com/pershoot/gtab-2632/tree/master/arch

    When comparing “file -f” and “modinfo” of one of modules included with Kernel which works ( tun.ko ) and my module, they look identical :

    ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
    vermagic: 2.6.32.39-cyanogenmod SMP preempt mod_unload modversions ARMv7

    I tried to Google for info, most of the time results are about different kernel version used, but I was under impression I downloaded the right one.

    Does anybody have any suggestions of what did I do wrong ?

    Regards

    User

  12. Hi User

    If there is an issue with the version of the Kernel then the info pulled from /proc/version should differ from the Makefile of your Kernel sources …
    Though we ran into that problem I can’t recall getting the same error message :/ (ours was something with magic number …)

    Is it possible that the module itself makes some kind of version check of the system?

    Regards
    Manuel

  13. Hi Manuel,

    thanks for helping out.

    I did have wrong magic number, but that happens if you don’t edit Makefile to make it 100% match your Kernel version. Editing took care of that message.

    After that, when downloading Kernel as .gz and using NDK r6 with toolchains 4.3 it was giving me different error message.

    Finally, after downloading Kernel via git and using NDK r5, I was able to narrow it down just to this message.

    The only reference I found was this one :

    http://forums.gentoo.org/viewtopic-p-6689557.html

    This person happens to try the same module and he is getting the same message pointing out to “versioning”.

    I did edit Makefile again and turned off Module Versioning.

    When I do that, compile and adb push, then execute insmod, I get invalid format message ( same as before ), but I don’t get any message in dmesg at all.

    Not sure if belkin_sa.c source code checks on it, I will check that next.

  14. Hi Manuel,

    I forgot to mention that in order to rule out all possibilities, I did compile tun.ko module on my own and compare it with tun.ko they included with kernel.

    Although file -f and modinfo for both modules are identical :

    * file size of my tun.ko ends up different than the original tun.ko
    * tun.ko included with Kernel in /system/lib/modules in dmesg shows tun: disagrees about version of symbol module_layout
    when started with insmod, BUT the actual module loads fine vs my belkin_sa.ko and my tun.ko and belkin_sa.ko both showing :
    insmod: init_module ‘belkin_sa.ko’ failed ( Exec format error )
    as well as “disagrees about version of symbol module_layout”

    Exec format error indicates compiled for wrong architecture, but file and modinfo don’t indicate that.

    Regards

    User

  15. Hi User

    Maybe you can find out more about the module using “readelf”. It helped me a lot lately.

    Regards
    Manuel

  16. Hi Manuel,

    I compared -e and -h for working tun.ko and my belkin_sa.ko, look identical.

    I did find one person with this problem :

    http://forum.xda-developers.com/archive/index.php/t-444338.html

    He claims that setlocalversion was the problem. I will try to edit it to return -cyanogenmod and see if it works.

    It looks like his file and modinfo were identical for working and non-working modules too, just like in my case and also simple things like “hello world” didn’t work, so there must be general problem with setup considering I can’t get modules like tun.ko to work either, which seem to work fine in included version.

    Regards

    Ivan

  17. Hi,

    I have a microcontroller board connected to FTDI and FTDI connected to Acer Iconia A500 tablet with android 3.1. I don’t know anything about linux but I would like to comunicate with FTDI using Android Java APIs. Since Adnroid 3.1 is usb host enabled I thought that all could be done from the Java. I seems that I was wrong and I did not manage to read any data from the FTDI. I managed to open 2 BULK endpoints one for input other for output but I didn’t managed to get any data from the device. Is it possible to create FTDI “driver” in android java? and use it like that? if not…

    If I compile FTDI driver and add it to kernel under the android I suppose I will get /dev/ttyUSB0 . Do you think that after getting ttyUSB0 I can continue to work only under Android? how will I intercept with the FTDI in android?

    I think that after using kernel driver to support FTDI I won’t have to use Android USB host API and I will just use the “file” /dev/ttyUSB0 and I will read and write to it as it was normal file…and whole comunication should be done automaticaly by the driver. Is that correct? Or I will have to continue to work in linux and C just like your own sample code is written.

    I am very new to linux and I would like as much “Android Java only solution” as possible I was hoping to do everything in java after the Android 3.1 so I am sorry if I am completely wrong and I thank you for any help or advice..

    Juraj

    1. Hi Juraj

      You are right, with the right kernel (-module) a device /dev/ttyUSB0 should appear with wich you can communicate over a serial connection. However, I guess it is possible to communicate over the bulkendpoints (that’s what the serial driver does) and write some “serial driver” code in Java. I guess this can be pretty complex since you need to probably study the kernel driver to understand what happens low level.
      What you could do however is to write some NDK glue to send and receive bytes where you just open the device and implement two functions “write” and “read”.

      I guess there is no way around the C-Code :(

      Regards
      Manuel

  18. I’ve got this working on Asus eee pad transformer running Honeycomb 3.2. I’m talking to an XBee explorer.

    One problem I ran into is that the .ko wouldn’t load due to an ELF relocation error when using the compiler from NDK r6.

    NDK r6 includes arm-linux-androideabi-4.4.3 which seems to be a different ABI than the compiler used for the kernel.

    This gives you the necessary 4.4.3 compiler (arm-eabi-4.4.3):
    git clone git://android.git.kernel.org/platform/prebuilt.git

  19. Hi , I have android 3.1 Host tab device. i need to read data from external USB device.My External USB device is one type of scanner in which FDTI FT232BM chip.
    is a USB device that emulates a RS232 interface. i need to connect this device to my android tab device and read data from external device to my android application.
    when i use android inbuilt USB Host api than data not read and fetch from external device. Please suggest me how fetch / read data from external device to my android application. Which step follow for this type functionality.

  20. Hi , I need to develop functionality like read or fetch data from external USB device to android application.
    i have android 3.1 USB Host device. also i have external device scanner in which FDTI FT232BM chip
    and It is a USB device that emulates a RS232 interface it appears as a RS232 port to talk to the
    Atmel AT90LS8535 processor.

    1) can i read data from external device using inbuilt android USB Host Api ?
    2) when i use Android inbuilt USB Host Api than when data read using

    request.queue(buffer, dataLength);

    if (mConnection.requestWait() == request) {

    // read buffer
    }

    this than not getting or fetch data from external device.

    3) Using JNI read data from external device is possible ?
    4) My external device read data using USB than its possible serial port api is work for my device ?
    5) Can anyone please suggest me how its possible this type functionality ?

    1. Hello Samit!

      What you need to do is to write a Java RS232 driver. I guess it is possible using bulk transfers. Although you need to know how to emulate a Serial Line. I am actually not familiar with the driver internals from the FT232 but what you can do is to check out the Kernel driver and find out how the protocol is built and then create a Java implementation using the Java API with bulk transfers. My guess is, that you are not the only one struggling with this :)

      Cheers
      Manuel

  21. Thanks Manuel for your quickly response. but i have some question regarding this….. its possible using bulk transfer but for this which step follow for this ? . you have any idea / documentation or any good tutorial how to get data from external usb device ? can android inbuild USB Host api is not use for me ?

    1. Hey Samit,

      you best look at the FT232 Kernel driver module (ftdi_sio.ko). You can find it in the vanilla Kernel… or maybe there is even documentation somewhere. Hope that helps you a bit :)

      Cheers
      Manuel

  22. So I am having the hardest time getting this going. Owing in large part, I suspect, to the fact that I have never compiled linux kernel modules or any linux kernel stuff before.

    However, I did get the modules to compile, and I got the .ko file pushed to my device and (I think) installed. However, when I plug in an FTDI device to my tablet (Galaxy Tab 10.1 with the latest update), I get the message “Unknown USB device connected”, and when I try to run the simpleserial demo, it says TTYUSB0 not found, or something to that effect. That is with the FTDI device plugged in (I try to run simpleserial via a terminal program running on the device, since I can’t ADB into it when the FTDI is plugged in.

    my .ko file is at http://www.tlalexander.com/ftdi_sio.ko if looking at it would help.

    I have also tried recompiling the module (as I guessed on a lot of the problems I had for that process) but it doesn’t look like it recompiles, and it won’t let me install it again anyway because it says its already installed (which makes sense, since it didn’t actually recompile).

    The reason why I had a lot of problems originally was that my directory structure looked totally different for the NDK than what is listed here. My $PATH ended up as:

    taylor@ubuntu:~/kernel/tegra-android-tegra-2.6.36-9001adc$ echo $PATH
    /home/taylor/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/:/taylor/ndk/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:/home/taylor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

    Note that one says 4.4.0, and one says 4.4.3 – I have no idea if that is a problem. My NDK only has 4.4.3, so at first I just had that, but I was getting “make: arm-eabi-gcc: Command not found” until I added the other directory with 4.4.0 to my PATH.

    Sorry for all the info and for having basically no idea what I’m doing, but if anyone has any insight it would be greatly appreciated. Thanks!

    1. Hi Taylor!

      My best guess is that the kernel module is not compatible to your current kernel. What happens when you execute your insmod command?
      #insmod ftdi_sio.ko
      I believe you are on the right way there. Hang in there :)

      Cheers
      Manuel

  23. also here is a chunk of the output of DMESG. It properly sees the VID and PID, it just doesn’t think the device is supported. So, something is wrong with my module? Thanks.

    [ 992.917079] [ CONNECTOR_DRIVER (acc_notified,387) ] ACCESSORY=OTG : STATE=
    online
    [ 992.935169] tegra-ehci tegra-ehci.0: irq 52, io mem 0xc5000000
    [ 992.954452] tegra-ehci tegra-ehci.0: USB 2.0 started, EHCI 1.00
    [ 992.954656] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [ 992.954692] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumb
    er=1
    [ 992.954720] usb usb1: Product: Tegra EHCI Host Controller
    [ 992.954745] usb usb1: Manufacturer: Linux 2.6.36.3 ehci_hcd
    [ 992.954768] usb usb1: SerialNumber: tegra-ehci.0
    [ 992.958534] hub 1-0:1.0: USB hub found
    [ 992.958594] hub 1-0:1.0: 1 port detected
    [ 992.960846] tegra-otg tegra-otg: tegra_start_host-
    [ 992.960879] host_notify: ndev name=usb_otg: from state=2 -> to state=1
    [ 993.174354] usb 1-1: new full speed USB device using tegra-ehci and addres
    s 2
    [ 993.430075] usb 1-1: device v0403 p6001 is not supported
    [ 993.454173] host_notify: ndev name=tegra-ehci.0: from state=0 -> to state=
    5
    [ 993.457196] hub 1-0:1.0: unable to enumerate USB device on port 1
    [ 993.614686] usb 1-1: new full speed USB device using tegra-ehci and addres
    s 3
    [ 993.970312] usb 1-1: device v0403 p6001 is not supported
    [ 993.996310] host_notify: ndev name=tegra-ehci.0: from state=5 -> to state=
    5
    [ 993.996348] hub 1-0:1.0: unable to enumerate USB device on port 1
    [ 994.154746] usb 1-1: new full speed USB device using tegra-ehci and addres
    s 4
    [ 994.509164] usb 1-1: device v0403 p6001 is not supported
    [ 994.534210] host_notify: ndev name=tegra-ehci.0: from state=5 -> to state=
    5

  24. When I run the insmod command, it just echoes the command, but does not give any errors. If I run it again it says its already installed, and if I run lsmod it shows it running.

    I also tried some random .ko files I found for a different tablet, and one will install but the other one says “insmod: init_module ‘ftdi_sio.ko’ failed (Exec format error)” so I know some will refuse to install, but the one I built does install, it seems.

    The snapshot I downloaded was from the link in the original post, since I also have 2.6.36.3. The folder that unzipped was called “tegra-android-tegra-2.6.36-9001adc”.

    It seems like the last section of the name there doesn’t matter? So I imagine its kind of a nightly build rev or something? I copied my config file over and it shows the same extraversion as my tablet.

    cat /proc/version shows:
    shell@android:/data $ cat /proc/version
    cat /proc/version
    Linux version 2.6.36.3 (root@DELL155) (gcc version 4.4.3 (GCC) ) #1 SMP PREEMPT
    Thu Jul 28 20:00:29 KST 2011

    Hey… I did just realize it shows 4.4.3 there. So… maybe I need to make sure everything compiles against that instead of 4.4.0? Does that matter?

    Also, here is how I am installing the modules (I also run lsmod before and after install to show success):
    C:\Program Files (x86)\Android\android-sdk-windows\platform-tools>adb connect 192.168.1.163:5555
    connected to 192.168.1.163:5555

    C:\Program Files (x86)\Android\android-sdk-windows\platform-tools>adb push serial/ftdi_sio.ko /sdcard/
    504 KB/s (257036 bytes in 0.498s)

    C:\Program Files (x86)\Android\android-sdk-windows\platform-tools>adb shell
    shell@android:/ $ su
    su
    shell@android:/ # cd sdcard
    cd sdcard
    shell@android:/sdcard # lsmod
    lsmod
    dhd 230233 0 – Live 0xbf000000
    shell@android:/sdcard # insmod ftdi_sio.ko
    insmod ftdi_sio.ko
    shell@android:/sdcard # lsmod
    lsmod
    ftdi_sio 26588 0 – Live 0xbf043000
    dhd 230233 0 – Live 0xbf000000
    shell@android:/sdcard #

    Sorry for the long post, I just want to get as much info out there as I can! The biggest question I have is on compiling the modules. I followed the first few steps of this:
    http://forums.androidcentral.com/htc-hero-rooting-roms-hacks/8072-how-build-your-own-kernel-package-source.html
    to get the tools necessary to compile kernel source. Though I’m not even sure if I needed anything more than the NDK and the kernel snapshot.

    I did notice that I was not able to get Samsung’s kernel source compiled… Maybe I will have to look at why that is.

    Thanks!
    -Taylor

    1. Hey Taylor

      It seems very odd… generally the result when you then plug in a ftdi device should be a new device node ttyUSB0, as you mentioned … since the module is inserted properly, the version seem to match and lsmod showing the module running my only guess is that maybe the USB/Serial is not an FTDI one… is that somehow possible? Or maybe the VID/PID of the device doesn’t match for the driver?
      From your descriptions it looks to me that you do everything completely right.

      You can try to use the 4.4.0 toolchain although I highly doubt that this is the problem :/

      Do you have a Linux machine around? Could you check if the device node ttyUSB0 is created there?

      Sorry for not being able to help a lot :(
      Cheers
      Manuel

  25. Thanks for the response Manuel,

    I have several FTDI devices, and they properly show up in Windows and my Ubuntu 10.10 virtual machine as such.

    The Vendor ID and Product ID from dmesg also match what FTDI says on their website, and in the source code for the FTDI driver from the kernel where I compiled the modules.

    Specifically, when I run dmesg on the tablet it says “usb 1-1: device v0403 p6001 is not supported”, but that is the VID PID pair for the FTDI device.

    So you’re saying I probably compiled the modules properly if they load? Could I be missing some other component?

    Thanks, all your advice is appreciated!
    -Taylor

  26. Hi ,

    i need libftdi_sio.ko for my android acer iconia tab. i have same 2.6.36 kernel in my tab. when i will try to compile but problem in fire some command. So can you please me send or provide same libftdi_sio.ko file which you are create above steps.

    Thank you very much for sharing this info….

  27. Hey Manuel,
    I haven’t been able to figure out the problem. I set is aside for now. Annoyingly, no one seems to be responding to my threads on XDA either. Grr!

    Any ideas?
    -Taylor

    1. Hi Taylor

      Yeah sometimes xda can be frustrating. Next week I will have some time to look into the problem. Do you have an A500 as well?
      I am still astonished by the fact that dmesg says “Unknown device”. I am going to try it myself next week and will keep you informed about my results.

      Regards
      Manuel

  28. Hey Manuel,

    My device is in that table.

    Specifically:

    { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },

    in the table,
    where:

    /***** devices using FTDI VID *****/
    #define FTDI_VID 0×0403 /* Vendor Id */
    /*** “original” FTDI device PIDs ***/
    #define FTDI_8U232AM_PID 0×6001 /* Similar device to SIO above */

    is in ftdi_sio_ids.h

    Which is included at the top of ftdi_sio.c

    Any my VID and PID are 0403 and 6001, respectively. So that all checks out.

    I am having some issues with modprobe, so I will keep looking into it. Specifically, modprobe gives me the error:
    modprobe: chdir(/system/lib/modules): No such file or directory

    Apparently Android doesn’t put modules there. Maybe that is my problem? What happens when you run modprobe? Its sufficient for me to just run modprobe to get that error. You may need to have busybox installed.

    But maybe Samsung has the OS set up in such a way that it can’t actually use loaded modules properly?

    Luckily, we recently hired a programmer to write an Android app using this feature, and he said he may be able to help as he has more linux experience. Its for internal use, and as a fallback I assembled a bluetooth-based serial bridge which, while not ideal, will technically work.

    Let me know if you find anything else, or I will look at using modprobe and see what happens.

    Thanks,
    -Taylor

    1. Hey Taylor

      I have really good news. I have been tinkering around with my VNC2 controller in FT232 mode and stumbled upon some really helpful stuff that might interest you as well. First of all there is one key library for us: libftdi: http://www.intra2net.com/en/developer/libftdi/download.php

      What it does is enable us to talk to the USB-Serial chip using only the usb-endpoints. Actually it is really simple … Send messages to OUT endpoint and receive messages through the IN EP. Depending on your chip you might have to reset and set the baudrate first.

      Long story short: if you use some of the libftdi code you are able to avoid the serial driver entirely!

      I did my tests today with pyusb on Ubuntu and it seems to work. I am planing to write an article for the blog this weekend.

      Hope this helps!

      Regards
      Manuel

  29. Hi Manuel,

    First of all thank you very much for your excellent ideas!!

    I am using a chinese Tablet with a 2.6.29 kernel. I am about to get the source code of the kernel “some way”…

    Before I start, do you think kernels before 2.6.31 are going to work? I read that the drivers are only available from this kernel upwards, is that correct?

    Cheers,
    Zant

    1. Hey Zant, since the driver is around since much longer than Android this won’t be an issue :) look out for the “ftdi_sio” driver.
      Regards
      Manuel

  30. Hei,

    Thank you for this nice investigation, that helped FTDI to create their technical note http://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_132_Adding_FTDI_Devices_VCP_Driver_Support_to_Android.pdf

    I have tried to implement this on a Galaxy S2 phone, with Android 2.3.4 and kernel 2.6.35.11-ninphetamine-2.0.5+

    I ended up compiling usbserial.ko and ftdi_sio.ko, and could insmod them properly ( insmod /sdcard/download/ftdi_sio.ko vendor=0×0403 product=0×6001 ) and with OK looking dmesg and showing in lsmod.

    Still I get the [ 4367.771009] usb 2-1: device v0403 p6001 is not supported in dmesg… I can’t figure out how to solve that, it just as if the drivers where not there. Any hint on a solution or a way to investigate further? I already spent a couple of days on that exact state.

    Regards,
    Cyril

    1. Hey Cyrill!

      Thank you very much for helping and mentioning us in your TN :)
      Based on libftdi we created a way to communicate without the kernel driver. This might be interesting if building, configuring and installing the .ko does not work. Also note that this way you don’t need root.
      So one solution to access the serial interface would be based on implementing the driver on Android API level. What do you think about that? With a bit of effort I am sure there could be a nice library for Android users.

      See the recent post: http://android.serverbox.ch/?p=370

      Regards and Thank you!
      Manuel

  31. Hi there,
    I am trying to achieve a very similar thing – to enable the support for HIDRAW. I followed the steps you provided and changed
    #CONFIG_HIDRAW is not set
    to
    CONFIG_HIDRAW=y and compiled the modules, but I did not get the hidraw.ko. It just compiled to .o
    Is there a way to transform an .o file into .ko or should I do something totally different? Any ideas?

    1. Hello Piotr

      The Kernel Build process should create a .ko file … the difference between .o and .ko files seems to be related to linking (http://tldp.org/HOWTO/Module-HOWTO/linuxversions.html, 12.1.1).
      However, I do not recommend to just adjust the Makefile via editor since that can mess up your entire configuration.
      Use “menuconfig” instead and activate your drivers there.

      Regards
      Manuel

  32. “And done you are” …
    Not really, when I try to insmod ftdi_sio.ko (I was following your instructions and the instructions from the ftdi-site as well) there is an “no such file or directory” error
    and dmesg shows
    [20538.982604] ftdi_sio: Unknown symbol usb_serial_handle_sysrq_char (err 0)
    [20538.986175] ftdi_sio: Unknown symbol usb_serial_disconnect (err 0)
    [20538.989898] ftdi_sio: Unknown symbol usb_serial_generic_open (err 0)
    [20538.992431] ftdi_sio: Unknown symbol usb_serial_generic_close (err 0)
    [20538.998138] ftdi_sio: Unknown symbol usb_serial_generic_unthrottle (err 0)
    [20539.001403] ftdi_sio: Unknown symbol usb_serial_handle_break (err 0)
    [20539.001922] ftdi_sio: Unknown symbol usb_serial_generic_throttle (err 0)
    [20539.002532] ftdi_sio: Unknown symbol usb_serial_probe (err 0)
    [20539.002868] ftdi_sio: Unknown symbol usb_serial_register (err 0)
    [20539.003173] ftdi_sio: Unknown symbol usb_serial_deregister (err 0)

    Maybe you can help me with that? – I’m using the HTC-Flyer and an Honeycomb Kernel… At the moment, I am a bit desperate.
    That should be my first bigger project and I am stuck on the first step.

    Greets from Bavaria.

    1. Hi Bavaria,

      Are you sure the flyer supports host mode? One way to check that is to see if there is a /dev/bus/usb/ node / or /proc/bus/usb. Although the hardware supports host usb even on smartphones some manufacturers choose to not include host drivers or tend to disable usb otg.

      Regards
      Manuel

  33. Hmm…
    Thanks for your quick answer!
    If have no problem attaching a mouse or an usbstick. Its just the problem with the ftdi device.
    If these drivers are disabled, what can I do to enable? Do I have to write the driver on my own? – Would eventually not make too much sense as I have to program more than just one (do not know how many in fact..) tablet…

    Use another tablet?

    1. Hey There!

      There are two different approaches to the problem with your device.

      1. If you are not dependent on the serial driver (i.e. if you do not have any part of your application stack that depends on it) then I strongly recommend to do a “soft serial” implementation where you communicate with your ftdi device over plain bulk transfers (read more about this here: http://android.serverbox.ch/?p=370). You probably have to tweak the example a bit but it will ease both implementation and use (since no root is required).

      2. You could try to compile the kernel completely and flash it to your device, so you will get rid of the errors. It seems to me, that either the kernel has unmet dependencies for your driver or some parts of the kernel have been tempered with by HTC.

      Way 1 is probably a lot easier though it won’t work if you have code that depends of a tyy interface.

      I hope that helped you a bit.

      Cheers
      Manuel

  34. Hi,

    I am trying to add the ftdi driver to the archos 80 G9.
    i downloaded the source kernel and i managed to compile but when i try to do insmod ftdi_sio.ko i get:
    ” insmod: cannot insert ‘ftdi_sio.ko’: Invalid module format (-1): Exec format error”

    i use kernel Linux version 2.6.35.7+ (rd@archos) (gcc version 4.4.1 (GCC) )
    and toolchain: Linux version 2.6.35.7+ (rd@archos) (gcc version 4.4.1 (GCC) )

    what am i doint wrong?
    Please help.
    Thanks

  35. I finally solved my problem.
    Compiling the modules works when I use the correct toolchain version ;) (no matter why, but version android ndk r5 works, r7 not).
    BUT – of course the next problem…

    I can insmod my modules (usbserial.ko and ftdi_sio.ko);
    when I plug the ftdi-device the tablet says there’s an unknown device.
    Dmesg says:
    [ 6535.304412] msm_hsusb_host msm_hsusb_host.0: new USB bus registered, assigned bus number 1
    [ 6535.304565] msm_hsusb_host msm_hsusb_host.0: irq 60, io base 0xa3600000
    [ 6535.304565] [USBH] ehci_msm_run
    [ 6535.304565] [USBH] IRQ state: a_wait_bcon, otgsc = 0x00202f20
    [ 6535.304595] [USBH] msm_otg_irq: portsc = 80001803, sts = 4
    [ 6535.304595] [OTG] set power:200 (budget:200)
    [ 6535.304687] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [ 6535.304687] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [ 6535.304687] usb usb1: Product: Qualcomm On-Chip EHCI Host Controller
    [ 6535.304718] usb usb1: Manufacturer: Linux 2.6.35.10-g6ea054a ehci_hcd
    [ 6535.304718] usb usb1: SerialNumber: msm_hsusb_host.0
    [ 6535.307037] hub 1-0:1.0: USB hub found
    [ 6535.307067] hub 1-0:1.0: 1 port detected
    [ 6535.308197] [USBH] IRQ usb_oc_det on request
    [ 6535.384216] [AUD] spi_aic3254: aic3254_config: 3254 power down procedure ,flag 0×24=0×00(0×88)
    [ 6535.559082] [USBH] IRQ state: a_wait_bcon, otgsc = 0x00200f20
    [ 6535.559783] [USBH] msm_otg_irq: portsc = 80001805, sts = 84
    [ 6535.585052] aic3254_powerdown: disable CLK
    [ 6535.625030] usb 1-1: new full speed USB device using msm_hsusb_host and address 2
    [ 6535.682647] [USBH] IRQ state: a_wait_bcon, otgsc = 0x00202f20
    [ 6535.683380] [USBH] msm_otg_irq: portsc = 80001805, sts = 4808c
    [ 6535.775634] usb 1-1: not running at top speed; connect to a high speed hub
    [ 6535.781616] usb 1-1: New USB device found, idVendor=1a40, idProduct=0101
    [ 6535.782318] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
    [ 6535.782714] usb 1-1: Product: USB 2.0 Hub [Safe]
    [ 6535.796813] hub 1-1:1.0: USB hub found
    [ 6535.797637] hub 1-1:1.0: 4 ports detected
    [ 6535.807800] [USBH] B_CONN set
    [ 6535.808532] [USBH] msm_otg_sm_work: state:a_wait_bcon bit:0x0000001a
    [ 6535.808929] [USBH] b_conn
    [ 6535.809295] [USBH] deleting a_wait_vrise timer. remaining -505 msec
    [ 6536.075805] usb 1-1.1: new low speed USB device using msm_hsusb_host and address 3
    [ 6536.190673] usb 1-1.1: device v13ee p0003 is not supported
    [ 6536.191070] usb 1-1.1: New USB device found, idVendor=13ee, idProduct=0003
    [ 6536.191772] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 6536.192169] usb 1-1.1: Product: Optical Mouse
    [ 6536.192840] usb 1-1.1: Manufacturer: MosArt
    [ 6536.216766] input: MosArt Optical Mouse as /devices/platform/msm_hsusb_host.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input20
    [ 6536.234680] generic-usb 0003:13EE:0003.000C: input: USB HID v1.10 Mouse [MosArt Optical Mouse] on usb-msm_hsusb_host.0-1.1/input0
    [ 6536.334808] usb 1-1.2: new full speed USB device using msm_hsusb_host and address 4
    [ 6536.449645] usb 1-1.2: device v0403 p6001 is not supported
    [ 6536.450012] usb 1-1.2: New USB device found, idVendor=0403, idProduct=6001
    [ 6536.450683] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 6536.451080] usb 1-1.2: Product: USB Serial
    [ 6536.451751] usb 1-1.2: Manufacturer: FTDI
    [ 6536.459777] Class 0xff SubClass 0xff Protocol 0xff
    [ 6536.460479] [USBH] sending DEV_NOT_SUPPORTED, event
    [ 6561.301391] [BATT] [x0]3 [x8]10 20 7f f0 5d 80 ff be 6 a9
    [ 6561.301788] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6561.302246] [BATT] V=3650(5d8) I=-6(fffffff0) C=174.0/3850(6a9) id=2(7fe) T=270(102) KADC=69
    [ 6561.302947] [BATT] next_capacity_01p by weighted = 53
    [ 6561.303344] [BATT] ID=2, level=5, vol=3650, temp=270, curr=-6, chg_src=1, chg_en=0
    [ 6561.314178] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6561.314941] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [346915156]
    [ 6591.705993] [BATT] [x0]3 [x8]10 20 7f f0 5d 70 fe 30 6 a9
    [ 6591.706695] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6591.707427] [BATT] V=3647(5d7) I=-45(ffffff8c) C=174.0/3850(6a9) id=2(7fe) T=270(102) KADC=72
    [ 6591.707794] [BATT] voltage stable
    [ 6591.708465] [BATT] next_capacity_01p by weighted = 54
    [ 6591.708862] [BATT] ID=2, level=5, vol=3647, temp=270, curr=-45, chg_src=1, chg_en=0
    [ 6591.740570] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6591.741302] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [346945582]
    [ 6621.758483] [BATT] [x0]3 [x8]10 20 7f f0 5d 80 ff cb 6 a9
    [ 6621.759185] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6621.759582] [BATT] V=3650(5d8) I=-5(fffffff3) C=174.0/3850(6a9) id=2(7fe) T=270(102) KADC=69
    [ 6621.760009] [BATT] next_capacity_01p by weighted = 53
    [ 6621.760711] [BATT] ID=2, level=5, vol=3650, temp=270, curr=-5, chg_src=1, chg_en=0
    [ 6621.771301] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6621.772033] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [346975613]
    [ 6651.781463] [BATT] [x0]3 [x8]10 20 7f f0 5d 70 ff e7 6 a9
    [ 6651.781890] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6651.782623] [BATT] V=3647(5d7) I=-2(fffffffa) C=174.0/3850(6a9) id=2(7fe) T=270(102) KADC=67
    [ 6651.783325] [BATT] next_capacity_01p by weighted = 52
    [ 6651.783721] [BATT] ID=2, level=5, vol=3647, temp=270, curr=-2, chg_src=1, chg_en=0
    [ 6651.805633] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6651.805725] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347005646]
    [ 6681.503448] [WLAN] update pm: PM_FAST, wifiLock: 0
    [ 6681.824035] [BATT] [x0]3 [x8]10 10 7f f0 5d 70 fd 5f 6 a9
    [ 6681.824462] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6681.825195] [BATT] V=3647(5d7) I=-66(ffffff58) C=174.0/3850(6a9) id=2(7fe) T=270(101) KADC=75
    [ 6681.825897] [BATT] next_capacity_01p by weighted = 56
    [ 6681.826293] [BATT] ID=2, level=5, vol=3647, temp=270, curr=-66, chg_src=1, chg_en=0
    [ 6681.827026] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347035668]
    [ 6683.422454] [WLAN] update pm: PM_FAST, wifiLock: 0
    [ 6711.854278] [BATT] [x0]3 [x8]10 20 7f f0 5d 70 ff c7 6 a8
    [ 6711.854675] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6711.855377] [BATT] V=3647(5d7) I=-5(fffffff2) C=174.0/3850(6a8) id=2(7fe) T=270(102) KADC=67
    [ 6711.856079] [BATT] next_capacity_01p by weighted = 52
    [ 6711.856445] [BATT] ID=2, level=5, vol=3647, temp=270, curr=-5, chg_src=1, chg_en=0
    [ 6711.857147] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347065698]
    [ 6741.870574] [BATT] [x0]3 [x8]10 20 7f f0 5d 90 ff cf 6 a8
    [ 6741.871002] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6741.871734] [BATT] V=3652(5d9) I=-4(fffffff4) C=174.0/3850(6a8) id=2(7fe) T=270(102) KADC=71
    [ 6741.872436] [BATT] next_capacity_01p by weighted = 54
    [ 6741.872863] [BATT] ID=2, level=5, vol=3652, temp=270, curr=-4, chg_src=1, chg_en=0
    [ 6741.887176] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6741.887603] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347095728]
    [ 6771.901641] [BATT] [x0]3 [x8]10 20 7f f0 5d 90 ff c7 6 a8
    [ 6771.902343] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6771.902770] [BATT] V=3652(5d9) I=-5(fffffff2) C=174.0/3850(6a8) id=2(7fe) T=270(102) KADC=71
    [ 6771.903442] [BATT] next_capacity_01p by weighted = 54
    [ 6771.905426] [BATT] ID=2, level=5, vol=3652, temp=270, curr=-5, chg_src=1, chg_en=0
    [ 6771.905853] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347125746]
    [ 6801.941711] [BATT] [x0]3 [x8]10 20 7f f0 5d 90 ff cf 6 a8
    [ 6801.942443] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6801.942901] [BATT] V=3652(5d9) I=-4(fffffff4) C=174.0/3850(6a8) id=2(7fe) T=270(102) KADC=71
    [ 6801.943603] [BATT] next_capacity_01p by weighted = 54
    [ 6801.946411] [BATT] ID=2, level=5, vol=3652, temp=270, curr=-4, chg_src=1, chg_en=0
    [ 6801.947174] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347155788]
    [ 6831.956451] [BATT] [x0]3 [x8]10 20 7f f0 5d 90 ff 81 6 a8
    [ 6831.956481] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6831.956512] [BATT] V=3652(5d9) I=-12(ffffffe1) C=174.0/3850(6a8) id=2(7fe) T=270(102) KADC=72
    [ 6831.956542] [BATT] next_capacity_01p by weighted = 54
    [ 6831.956542] [BATT] ID=2, level=5, vol=3652, temp=270, curr=-12, chg_src=1, chg_en=0
    [ 6831.956573] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347185797]
    [ 6862.007598] [BATT] [x0]3 [x8]10 20 7f f0 5d 80 ff 1e 6 a7
    [ 6862.008026] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6862.008789] [BATT] V=3650(5d8) I=-22(ffffffc8) C=173.0/3850(6a7) id=2(7fe) T=270(102) KADC=72
    [ 6862.009765] [BATT] next_capacity_01p by weighted = 54
    [ 6862.010192] [BATT] ID=2, level=5, vol=3650, temp=270, curr=-22, chg_src=1, chg_en=0
    [ 6862.010894] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6862.011322] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347215852]
    [ 6892.023803] [BATT] [x0]3 [x8]10 20 7f f0 5d 50 ff df 6 a7
    [ 6892.025543] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6892.026031] [BATT] V=3642(5d5) I=-3(fffffff8) C=173.0/3850(6a7) id=2(7fe) T=270(102) KADC=62
    [ 6892.026763] [BATT] next_capacity_01p by weighted = 49
    [ 6892.027740] [BATT] ID=2, level=5, vol=3642, temp=270, curr=-3, chg_src=1, chg_en=0
    [ 6892.038787] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6892.039825] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347245880]
    [ 6922.073608] [BATT] [x0]3 [x8]10 20 7f f0 5d 80 ff df 6 a7
    [ 6922.075531] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6922.076263] [BATT] V=3650(5d8) I=-3(fffffff8) C=173.0/3850(6a7) id=2(7fe) T=270(102) KADC=69
    [ 6922.076995] [BATT] next_capacity_01p by weighted = 52
    [ 6922.077423] [BATT] ID=2, level=5, vol=3650, temp=270, curr=-3, chg_src=1, chg_en=0
    [ 6922.085723] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6922.086151] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347275927]
    [ 6943.562500] [USB] id interrupt
    [ 6943.562988] [USBH] IRQ state: a_host, otgsc = 0x00200f20
    [ 6943.563690] [USBH] msm_otg_irq: portsc = 8c00100a, sts = c408c
    [ 6943.564392] usb 1-1: USB disconnect, address 2
    [ 6943.565093] usb 1-1.1: USB disconnect, address 3
    [ 6943.565521] [USBH] usb_hcd_giveback_urb: status = -108
    [ 6943.602722] usb 1-1.2: USB disconnect, address 4
    [ 6943.611328] [USBH] usb_hcd_giveback_urb: status = -108
    [ 6943.621520] [USBH] B_CONN clear
    [ 6943.621948] [USBH] msm_otg_sm_work: state:a_host bit:0x0000000a
    [ 6943.622314] [USBH] !b_conn
    [ 6943.753906] [USB] accessory_detect_by_adc: usb ID pin = 1
    [ 6943.754302] [USB] accessory_detect_by_adc prev_type 5, type 0, stable_count 0
    [ 6943.954833] [USB] accessory_detect_by_adc: usb ID pin = 1
    [ 6943.955261] [USB] accessory_detect_by_adc prev_type 0, type 0, stable_count 1
    [ 6944.153991] [USB] accessory_detect_by_adc: usb ID pin = 1
    [ 6944.154418] [USB] accessory_detect_by_adc prev_type 0, type 0, stable_count 2
    [ 6944.354766] [USB] accessory_detect_by_adc: usb ID pin = 1
    [ 6944.355194] [USB] accessory_detect_by_adc prev_type 0, type 0, stable_count 3
    [ 6944.355895] [USB] accessory_type_switch accessory_type 5, type 0
    [ 6944.356567] [USB] Set IDGND = 1
    [ 6944.356994] [USBH] msm_otg_sm_work: state:a_wait_bcon bit:0x0000002a
    [ 6944.357360] [USBH] id_f/b/c || a_bus_drop ||a_wait_bcon_tmout
    [ 6944.358062] [USBH] deleting a_wait_vrise timer. remaining -409054 msec
    [ 6944.358428] [USBH] msm_hsusb_request_host: 0
    [ 6944.359130] msm_hsusb_host msm_hsusb_host.0: remove, state 1
    [ 6944.359588] usb usb1: USB disconnect, address 1
    [ 6944.360290] [USBH] usb_hcd_giveback_urb: status = -108
    [ 6944.361572] flyer_host_usb_switch: 0 (rev:128)
    [ 6944.362335] pm8058_gpio_mux_cfg: ok writing config for gpio 14 (0)
    [ 6944.362823] [USB] accessory_detect_work ID pin 1, type 0
    [ 6944.381011] msm_hsusb_host msm_hsusb_host.0: USB bus 1 deregistered
    [ 6944.381500] [USBH] otg_reset
    [ 6944.387603] msm_hsusb_phy_reset
    [ 6944.514007] [USBH] otg_reset: mode:0×00000012
    [ 6944.514404] [USBH] starting a_wait_vfall timer
    [ 6944.658233] [BATT] M2A_RPC: cable_update: none at 6938865130091 (2012-01-25 11:49:52.963356265 UTC)
    [ 6944.659332] [BATT] htc_cable_status_update: 1 -> 0
    [ 6944.660034] [USBH] htc_otg_set_vbus_state: 0
    [ 6944.660491] [BATT] (htc_cable_status_update)power_supply_changed: battery at 6938867357874 (2012-01-25 11:49:52.965614566 UTC)
    [ 6944.748779] [WLAN] update pm: PM_FAST, wifiLock: 0
    [ 6944.850219] [AUD] spi_aic3254: aic3254_ioctl: index 13 for 40047313
    [ 6944.850219] [AUD] spi_aic3254: aic3254_set_config: table(0×40047313) index(13)
    [ 6944.850311] aic3254_set_config: enable CLK
    [ 6944.850311] [AUD] spi_aic3254: aic3254_set_config: enable rx
    [ 6944.850311] [AUD] spi_aic3254: aic3254_config: size = 14
    [ 6944.852508] [AUD] spi_aic3254: aic3254_config: size = 11
    [ 6944.852752] [AUD][msm7x30.c:msm_device_put] device speaker_mono_rx set 1
    [ 6944.852752] [AUD] snd_soc_msm7kv2: [ALSA] msm_en_device (dev speaker_mono_rx, id 6, enable 1, opened 0)
    [ 6944.852752] [AUD][msm7x30.c:msm_device_put] device freq =48000
    [ 6944.852783] [AUD] snddev_icodec: snddev_icodec_open: device speaker_mono_rx
    [ 6944.856536] [AUD][adsp.c:msm_adsp_get] module AFETASK has been registered
    [ 6944.856567] [AUD][adsp.c:msm_adsp_enable] enable ‘AFETASK’state[0] id[17227119]
    [ 6944.860717] [AUD][adsp.c:adsp_rtos_mtoa_cb] rpc event=0, proc_id=2, module=17227119, image=0
    [ 6944.860748] [AUD][adsp.c:adsp_rtos_mtoa_cb] module AFETASK: READY
    [ 6944.860748] [AUD][afe.c:afe_dsp_event] unexpected message from afe
    [ 6944.915130] [AUD] board_flyer_audio: flyer_snddev_poweramp_on 1
    [ 6945.003875] [AUD] snd_soc_msm7kv2: set device speaker_mono_rx opened as 1
    [ 6945.003967] [AUD] htc-acoustic: open
    [ 6945.003997] [AUD] htc_acoustic_7x30: acoustic_ioctl update ACDB ID : (11, 6, 0, 607)
    [ 6945.003997] [AUD] htc-acoustic: release
    [ 6945.004028] [AUD] snd_soc_msm7kv2: [ALSA] msm_route_stream: session 5, dev 6, enable 1
    [ 6945.004058] [AUD] audio_out: audio_enable
    [ 6945.004058] [AUD] audio_out: ++++++++++++++++++++++++++++++
    [ 6945.004058] [AUD][ATS][play_music][successful] at 6939210253395 (2012-01-25 11:49:53.309211991 UTC)
    [ 6945.004150] [AUD] audio_acdb: acdb: 3098 bytes for device 607, rate 48000.
    [ 6945.004516] [AUD][adsp.c:msm_adsp_get] module AUDPPTASK has been registered
    [ 6945.004516] [AUD][adsp.c:msm_adsp_enable] enable ‘AUDPPTASK’state[0] id[17227122]
    [ 6945.005279] [AUD][adsp.c:adsp_rtos_mtoa_cb] rpc event=0, proc_id=2, module=17227122, image=0
    [ 6945.005279] [AUD][adsp.c:adsp_rtos_mtoa_cb] module AUDPPTASK: READY
    [ 6945.005279] [AUD][audpp.c:audpp_dsp_event] unhandled msg id ffff
    [ 6945.009399] [AUD][audpp.c:audpp_dsp_event] ENABLE
    [ 6945.013610] [AUD][adsp.c:msm_adsp_write] AUDPPTASK command took 77 attempts: rc 0
    [ 6945.014862] [USBH] expired a_wait_vfall timer
    [ 6945.014953] [USBH] msm_otg_sm_work: state:a_wait_vfall bit:0×00000028
    [ 6945.015106] [USBH] IRQ usb_oc_det on release
    [ 6945.015197] [USBH] msm_otg_sm_work: state:a_idle bit:0×00000020
    [ 6945.015411] [USBH] id && !id_a
    [ 6945.015472] [USBH] otg_reset
    [ 6945.033905] [USBH] otg_reset: mode:0×00000012
    [ 6945.033935] [USBH] msm_otg_sm_work: state:b_idle bit:0×00000020
    [ 6945.033935] [USBH] entering into lpm
    [ 6945.033935] [USBH] pm_runtime: idling…
    [ 6945.033966] [USBH] pm_runtime: suspending…
    [ 6945.033966] [USBH] lpm enter, __INVALID
    [ 6945.034057] [USBH] msm_otg_suspend: usb in low power mode
    [ 6948.046630] [USBH] pm_runtime: resuming…
    [ 6948.047027] [USBH] lpm exit
    [ 6948.048156] [USBH] msm_otg_resume: usb exited from low power mode
    [ 6948.048889] [USB] id interrupt
    [ 6948.243957] [USB] accessory_detect_by_adc: usb ID pin = 0
    [ 6948.244934] [BATT] htc_get_usb_accessory_adc_level
    [ 6948.258758] [BATT] htc_get_usb_accessory_adc_level: adc = 712
    [ 6948.259460] [USB] accessory adc = 0x2c8
    [ 6948.259948] [BATT] htc_get_usb_accessory_adc_level
    [ 6948.273559] [BATT] htc_get_usb_accessory_adc_level: adc = 771
    [ 6948.274902] [USB] [2nd] accessory adc = 0×303
    [ 6948.275390] [USB] accessory_detect_by_adc prev_type 0, type 5, stable_count 0
    [ 6948.368408] [AUD] audio_out: audio_disable
    [ 6948.368896] [AUD][audpp.c:audpp_dsp_event] DISABLE
    [ 6948.369628] [AUD][audpp.c:audpp_disable] Received CFG_MSG_DISABLE from ADSP
    [ 6948.371032] [AUD][adsp.c:msm_adsp_put] closing module AUDPPTASK
    [ 6948.371795] [AUD][ATS][stop_music][successful] at 6942577959697 (2012-01-25 11:49:56.676918293 UTC)
    [ 6948.372497] [AUD] audio_out: ——————————
    [ 6948.373016] [AUD] snd_soc_msm7kv2: [ALSA] msm_route_stream: session 5, dev 6, enable 0
    [ 6948.376556] [AUD] spi_aic3254: aic3254_ioctl: index 29 for 40047313
    [ 6948.376953] [AUD] spi_aic3254: aic3254_set_config: table(0×40047313) index(29)
    [ 6948.377655] [AUD] spi_aic3254: aic3254_set_config: enable rx
    [ 6948.378326] [AUD] board_flyer_audio: flyer_rx_amp_enable: curr_rx_mode 0×1, en 0
    [ 6948.378723] [AUD] board_flyer_audio: flyer_snddev_poweramp_on 0
    [ 6948.394012] [AUD] spi_aic3254: aic3254_config: size = 8
    [ 6948.394927] [AUD] board_flyer_audio: flyer_rx_amp_enable: curr_rx_mode 0×1, en 1
    [ 6948.395660] [AUD] board_flyer_audio: flyer_snddev_poweramp_on 1
    [ 6948.473937] [USB] accessory_detect_by_adc: usb ID pin = 0
    [ 6948.474639] [BATT] htc_get_usb_accessory_adc_level
    [ 6948.484130] [AUD][msm7x30.c:msm_device_put] device speaker_mono_rx set 0
    [ 6948.484863] [AUD] snd_soc_msm7kv2: [ALSA] msm_en_device (dev speaker_mono_rx, id 6, enable 0, opened 1)
    [ 6948.485565] [AUD] snddev_icodec: snddev_icodec_close: device speaker_mono_rx
    [ 6948.485961] [AUD] board_flyer_audio: flyer_snddev_poweramp_on 0
    [ 6948.487884] [BATT] htc_get_usb_accessory_adc_level: adc = 710
    [ 6948.488311] [USB] accessory adc = 0x2c6
    [ 6948.489105] [BATT] htc_get_usb_accessory_adc_level
    [ 6948.502777] [BATT] htc_get_usb_accessory_adc_level: adc = 781
    [ 6948.503479] [USB] [2nd] accessory adc = 0x30d
    [ 6948.504211] [USB] accessory_detect_by_adc prev_type 5, type 5, stable_count 1
    [ 6948.510223] [AUD][adsp.c:msm_adsp_disable] disable interrupt
    [ 6948.510650] [AUD][adsp.c:msm_adsp_put] closing module AFETASK
    [ 6948.511474] [AUD] snd_soc_msm7kv2: set device speaker_mono_rx opened as 0
    [ 6948.512054] [AUD] spi_aic3254: aic3254_powerdown: power off AIC3254
    [ 6948.512756] [AUD] spi_aic3254: aic3254_config: size = 31
    [ 6948.616363] [AUD] spi_aic3254: aic3254_config: 3254 power down procedure ,flag 0×24=0×00(0×88)
    [ 6948.704040] [USB] accessory_detect_by_adc: usb ID pin = 0
    [ 6948.704742] [BATT] htc_get_usb_accessory_adc_level
    [ 6948.718383] [BATT] htc_get_usb_accessory_adc_level: adc = 710
    [ 6948.718811] [USB] accessory adc = 0x2c6
    [ 6948.720825] [BATT] htc_get_usb_accessory_adc_level
    [ 6948.733917] [BATT] htc_get_usb_accessory_adc_level: adc = 779
    [ 6948.735046] [USB] [2nd] accessory adc = 0x30b
    [ 6948.735504] [USB] accessory_detect_by_adc prev_type 5, type 5, stable_count 2
    [ 6948.818389] aic3254_powerdown: disable CLK
    [ 6948.933898] [USB] accessory_detect_by_adc: usb ID pin = 0
    [ 6948.934600] [BATT] htc_get_usb_accessory_adc_level
    [ 6948.948608] [BATT] htc_get_usb_accessory_adc_level: adc = 710
    [ 6948.949401] [USB] accessory adc = 0x2c6
    [ 6948.949859] [BATT] htc_get_usb_accessory_adc_level
    [ 6948.964630] [BATT] htc_get_usb_accessory_adc_level: adc = 779
    [ 6948.965362] [USB] [2nd] accessory adc = 0x30b
    [ 6948.965820] [USB] accessory_detect_by_adc prev_type 5, type 5, stable_count 3
    [ 6948.966491] [USB] accessory_type_switch accessory_type 0, type 5
    [ 6948.966888] [USB] accessory_detect_work ID pin 0, type 5
    [ 6948.967590] [USB] USB_STATE_OFFLINE: usb_host_cable_detect
    [ 6948.967987] flyer_host_usb_switch: 1 (rev:128)
    [ 6948.980529] pm8058_gpio_mux_cfg: ok writing config for gpio 14 (0)
    [ 6948.980957] [USBH] otg_reset
    [ 6948.986785] msm_hsusb_phy_reset
    [ 6949.077301] [BATT] M2A_RPC: cable_update: USB at 6943283953346 (2012-01-25 11:49:57.382423661 UTC)
    [ 6949.078491] [BATT] htc_cable_status_update: 0 -> 1
    [ 6949.078857] [USBH] htc_otg_set_vbus_state: 1
    [ 6949.079284] [USBH] msm_otg_sm_work: state:b_idle bit:0×00002020
    [ 6949.079956] [USBH] b_sess_vld
    [ 6949.080322] [USB] msm_hsusb_set_vbus_state_internal: 1
    [ 6949.081115] [BATT] (htc_cable_status_update)power_supply_changed: battery at 6943287737526 (2012-01-25 11:49:57.386238358 UTC)
    [ 6949.114135] [USBH] otg_reset: mode:0×00000012
    [ 6949.135620] [USB] Set IDGND = 0, enter HOST mode
    [ 6949.135711] [USB] msm72k_udc: OFFLINE -> ONLINE
    [ 6949.135864] [USB] reset controller
    [ 6949.135925] [USBH] otg_reset
    [ 6949.136138] [USBH] msm_otg_sm_work: state:b_peripheral bit:0×00002002
    [ 6949.136322] [USBH] !id || id_a/b || !b_sess_vld
    [ 6949.136413] [USB] msm_hsusb_set_vbus_state_internal: 0
    [ 6949.136535] [USBH] otg_reset
    [ 6952.131072] [BATT] [x0]3 [x8]10 10 7f f0 5d 70 fe ed 6 a5
    [ 6952.131713] [BATT]battery.id_ohm=614754500, battery.id_index=2, batt_id_index=2, st_counter=0
    [ 6952.132476] [BATT] V=3647(5d7) I=-26(ffffffbc) C=172.0/3850(6a5) id=2(7fe) T=270(101) KADC=69
    [ 6952.133209] [BATT] next_capacity_01p by weighted = 52
    [ 6952.133636] [BATT] ID=2, level=5, vol=3647, temp=270, curr=-26, chg_src=1, chg_en=0
    [ 6952.145751] [BATT] htc_battery_update_change() power_supply_changed: battery
    [ 6952.146789] [BATT]S=2 P=46 chg=0 cable=000 flg=1100 dbg=0000 fst_dischg=46/175 [347305987]
    [ 6954.134002] msm_hsusb_phy_reset: phy_reset rpc failed! rc = -110
    [ 6954.134765] msm_hsusb_phy_reset: phy_reset rpc failed! rc = -110
    [ 6954.264038] [USBH] otg_reset: mode:0×00000013
    [ 6954.264434] [USBH] do nothing !!
    [ 6954.264831] [USBH] msm_otg_sm_work: state:b_idle bit:0×00002002
    [ 6954.265502] [USBH] !id || id_A
    [ 6954.265899] [USBH] otg_reset
    [ 6954.266296] [USBH] otg_reset: mode:0×00000013
    [ 6954.266998] [USB] ulpi: write 0×06 to 0×36
    [ 6954.267364] [USB] ulpi: write 0x0c to 0×31
    [ 6954.267761] [USB] ulpi: write 0×31 to 0×32
    [ 6954.268463] [USB] ulpi: write 0×01 to 0x0e
    [ 6954.268829] [USB] ulpi: write 0×01 to 0×11
    [ 6954.269226] [USB] usb: notify offline
    [ 6954.272033] [USBH] IRQ state: b_idle, otgsc = 0x00200f20
    [ 6954.272430] [USBH] msm_otg_irq: portsc = 80000803, sts = 1484
    [ 6954.273132] [USBH] msm_otg_irq: nobody handles IRQ
    [ 6954.284149] [USBH] otg_reset: mode:0×00000013
    [ 6954.284881] [USBH] msm_otg_sm_work: state:a_idle bit:0×00000002
    [ 6954.285278] [USBH] !a_bus_drop && (a_srp_det || a_bus_req)
    [ 6954.285980] [USBH] starting a_wait_vrise timer
    [ 6954.287231] flyer_config_9v_gpio: 1
    [ 6954.287658] pm8058_gpio_mux_cfg: ok writing config for gpio 31 (0)
    [ 6954.296325] flyer_config_9v_gpio: 0
    [ 6954.296783] pm8058_gpio_mux_cfg: ok writing config for gpio 31 (0)
    [ 6954.297454] [USB] not AC charger
    [ 6954.297851] [USB] msm72k_udc: ONLINE -> OFFLINE
    [ 6954.298217] [USB] usb: notify offline
    [ 6954.298919] set usb_configuration = 0
    [ 6954.299377] [USB] send connect type 0
    [ 6954.299743] [USBH] IRQ state: a_wait_vrise, otgsc = 0x00200f20
    [ 6954.300445] [USBH] msm_otg_irq: portsc = 80000803, sts = 1484
    [ 6954.300842] [USBH] msm_otg_irq: nobody handles IRQ
    [ 6954.301513] fsg_set_ums_state: 0
    [ 6954.301879] [BATT] online=0
    [ 6954.302246] [BATT]USB BUG! online=0 != chargingsource => skip
    [ 6954.386383] [USBH] expired a_wait_vrise timer
    [ 6954.386840] [USBH] msm_otg_sm_work: state:a_wait_vrise bit:0x0000000a
    [ 6954.387542] [USBH] a_vbus_vld
    [ 6954.387908] [USBH] msm_hsusb_request_host: 1
    [ 6954.388397] msm_hsusb_host msm_hsusb_host.0: Qualcomm On-Chip EHCI Host Controller
    [ 6954.389190] msm_hsusb_host msm_hsusb_host.0: new USB bus registered, assigned bus number 1
    [ 6954.390167] msm_hsusb_host msm_hsusb_host.0: irq 60, io base 0xa3600000
    [ 6954.390533] [USBH] ehci_msm_run
    [ 6954.391235] [USBH] IRQ state: a_wait_bcon, otgsc = 0x00202f20
    [ 6954.391632] [USBH] msm_otg_irq: portsc = 80001803, sts = 84
    [ 6954.392333] [OTG] set power:200 (budget:200)
    [ 6954.392944] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [ 6954.393646] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [ 6954.397613] usb usb1: Product: Qualcomm On-Chip EHCI Host Controller
    [ 6954.398437] usb usb1: Manufacturer: Linux 2.6.35.10-g6ea054a ehci_hcd
    [ 6954.401763] usb usb1: SerialNumber: msm_hsusb_host.0
    [ 6954.414825] hub 1-0:1.0: USB hub found
    [ 6954.415252] hub 1-0:1.0: 1 port detected
    [ 6954.419219] [USBH] IRQ usb_oc_det on request
    [ 6954.669250] [USBH] IRQ state: a_wait_bcon, otgsc = 0x00202f20
    [ 6954.669982] [USBH] msm_otg_irq: portsc = 80001805, sts = 8c
    [ 6954.734130] usb 1-1: new full speed USB device using msm_hsusb_host and address 2
    [ 6954.791229] [USBH] IRQ state: a_wait_bcon, otgsc = 0x00202f20
    [ 6954.791625] [USBH] msm_otg_irq: portsc = 80001805, sts = 4808c
    [ 6954.886199] usb 1-1: not running at top speed; connect to a high speed hub
    [ 6954.890167] usb 1-1: New USB device found, idVendor=1a40, idProduct=0101
    [ 6954.890899] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
    [ 6954.891296] usb 1-1: Product: USB 2.0 Hub [Safe]
    [ 6954.901611] hub 1-1:1.0: USB hub found
    [ 6954.903228] hub 1-1:1.0: 4 ports detected
    [ 6954.912597] [USBH] B_CONN set
    [ 6954.913330] [USBH] msm_otg_sm_work: state:a_wait_bcon bit:0x0000001a
    [ 6954.913726] [USBH] b_conn
    [ 6954.915252] [USBH] deleting a_wait_vrise timer. remaining -528 msec
    [ 6955.185363] usb 1-1.1: new low speed USB device using msm_hsusb_host and address 3
    [ 6955.300201] usb 1-1.1: device v13ee p0003 is not supported
    [ 6955.300628] usb 1-1.1: New USB device found, idVendor=13ee, idProduct=0003
    [ 6955.301330] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 6955.301727] usb 1-1.1: Product: Optical Mouse
    [ 6955.302398] usb 1-1.1: Manufacturer: MosArt
    [ 6955.335876] input: MosArt Optical Mouse as /devices/platform/msm_hsusb_host.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input21
    [ 6955.355407] generic-usb 0003:13EE:0003.000D: input: USB HID v1.10 Mouse [MosArt Optical Mouse] on usb-msm_hsusb_host.0-1.1/input0

    ???

  36. Sorry for this long post.
    Shortend:
    I seem to have the same problem as Taylor has or had.
    The other stuff with the libs included did not work for me…

  37. how to download the recent Tegra Kernel from the Android Repos?My device is Thinkpad tablet.

  38. hello,i also need libftdi_sio.ko for my android thinkpad tablet. i have same 2.6.36 kernel in my tablet. and how to download the recent Tegra Kernel from the Android Repos?could you help me ? thanks a lot.

  39. # insmod /sdcard/ftdi_sio.ko
    insmod: init_module ‘/sdcard/ftdi_sio.ko’ failed (Exec format error)

    i get this ….why?

    1. Probably the magic number of your module does not match (check dmesg). You need to find out the exact version (including minor version) of the kernel you are running.

      All the best
      Manuel

  40. thank you Manuel! i use command # cat /proc/version
    cat /proc/version
    Linux version 2.6.36.3 (build@build-desktop) (gcc version 4.4.3 (GCC) ) #1 SMP P
    REEMPT Mon Mar 5 18:01:11 CST 2012
    the last number 3 is exact version? how can i change it ?

  41. when i use dmesg i just see this: ftdi_sio:unkonwn relocation:27!!! i want to make a boot.img,but it is difficult to me!!!can anyone help me? My tablet is thinkpad tablet….

  42. I just successfully added module ftdi_sio.ko to the kernel! !!!
    Before that, I use /~/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/ to compile,but failed!! however,when i use /home/zhouxiao/MyAndroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/:/home/zhouxiao/bin to compile, success!!! i dont know why!

    now when i plug telosb node in tablet, i can find /dev/ttyUSB0!!! thank everyone!!!

  43. It seems that i have opposite problem – i’d like to detach FTDI kernel driver in Android:
    https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=58873

    Does anyone know how to do it?
    I’m trying to do it using libftdi (libusb) and the result is ok (0) but it hurts interaction so i have persistent problem across different android devices, ftdi-boards and android os versions.

  44. Hi,

    I am using BSNL Penta IS701C tablet. I am not able to find the kernel source code for this tablet.
    Can anyone send me a link from where I can download the source code.

    Regards,
    Manasi

Leave a Reply

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


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>