[Q] Compiling FTDI Kernel Module Fails - EVO 4G General

To start: Yes, I have searched the forums for similar items. There are no helpful responses. Hopefully this extra info helps.
Phone: HTC Evo 4G
OS: Cyanogenmod 7.1.0 Supersonic
Kernel Info: 2.6.37.6-cyanogenmod-01509-g8913be8
Background: I need to speak with serial devices via the USB port. The specific device I want to send data is an FTDI device. I am successfully communicating with the device via my Linux-based desktop. The challenge is porting my code to Android.
Here we go.
I started here: http://android.serverbox.ch/?p=285
To get the development environment and kernel for my phone I followed this:
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source
When compiling my kernel I ran into a problem with the environment variables defined in the tutorial. I replaced CCOMPILE with CROSS_COMPILE and pointed it to my Code Sourcery install:
export CROSS_COMPILE=/home/LINUX_USER/Hardware/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-
I updated my kernel configuration (according to the FTDI tutorial) and tried to build the kernel and FTDI kernel module. My first attempt to "make" the kernel didn't work. I found this:
http://forum.xda-developers.com/archive/index.php/t-932190.html
Which provided me with a flag to get make to run:
# make EXTRA_AFLAGS=-mfpu=neon
The FTDI kernel module built successfully and I pushed the module to the SD card and tried to install module:
# /home/LINUX_USER/Hardware/android/android-sdk-linux/platform-tools/adb push drivers/usb/serial/ftdi_sio.ko /sdcard/
# insmod /sdcard/ftdi_sio.ko
insmod: init_module '/sdcard/ftdi_sio.ko' failed (Exec format error)
Since it didn't work I checked dmesg
# dmesg shows this:
[snip]
<3>[20821.873504] ftdi_sio: version magic '2.6.37.6-cyanogenmod-g996b70e preempt mod_unload ARMv7 ' should be '2.6.37.6-cyanogenmod-01509-g8913be8 preempt mod_unload ARMv7 '
I validated the kernel version on my phone and looked for a fix:
# uname -a
Linux localhost 2.6.37.6-cyanogenmod-01509-g8913be8 #1 PREEMPT Wed Jul 27 21:34:30 EDT 2011 armv7l GNU/Linux
The following tutorial provided me with instructions on how to address this issue:
http://glandium.org/blog/?p=2214
I changed the subversion number for the kernel by updating .scmversion to contain the following data:
-01509-g8913be8
After recompiling I tried to load the FTDI module again and got the following messages:
# insmod ftdi_sio.ko
insmod: init_module 'ftdi_sio.ko' failed (No such file or directory)
# dmesg | tail -15
<6>[58392.044647] batt: batt power_supply_changed: battery at 58389757684756 (2011-11-16 17:35:59.423392893 UTC)
<4>[58392.053100] at 58389762414981 (2011-11-16 17:35:59.413322092 UTC)
<4>[58413.600006] ftdi_sio: Unknown symbol usb_register_driver (err 0)
<4>[58413.602172] ftdi_sio: Unknown symbol usb_serial_handle_sysrq_char (err 0)
<4>[58413.604858] ftdi_sio: Unknown symbol usb_serial_disconnect (err 0)
<4>[58413.607910] ftdi_sio: Unknown symbol usb_serial_generic_open (err 0)
<4>[58413.610290] ftdi_sio: Unknown symbol usb_serial_generic_close (err 0)
<4>[58413.612609] ftdi_sio: Unknown symbol usb_control_msg (err 0)
<4>[58413.615142] ftdi_sio: Unknown symbol usb_deregister (err 0)
<4>[58413.617340] ftdi_sio: Unknown symbol usb_serial_generic_unthrottle (err 0)
<4>[58413.619262] ftdi_sio: Unknown symbol usb_serial_handle_break (err 0)
<4>[58413.622161] ftdi_sio: Unknown symbol usb_serial_generic_throttle (err 0)
<4>[58413.622955] ftdi_sio: Unknown symbol usb_serial_probe (err 0)
<4>[58413.624511] ftdi_sio: Unknown symbol usb_serial_register (err 0)
<4>[58413.630371] ftdi_sio: Unknown symbol usb_serial_deregister (err 0)
Since this failed I tried other compilers as well with the same results.
export CROSS_COMPILE=/home/LINUX_USER/Hardware/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
export CROSS_COMPILE=/home/LINUX_USER/Hardware/android/cyanogenmod/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
I need help understanding what I should try next.
Thank you,
cutaway

If you still haven't gotten it running I posted a kernel on the cyanogenmod site with these modules in /system/lib/modules.
Load usbcore.ko, usbserial.ko, then ftdi_sio.ko
Unfortunately I don't have any devices to test, so let me know if it works.

sbradymobile said:
If you still haven't gotten it running I posted a kernel on the cyanogenmod site with these modules in /system/lib/modules.
Load usbcore.ko, usbserial.ko, then ftdi_sio.ko
Unfortunately I don't have any devices to test, so let me know if it works.
Click to expand...
Click to collapse
Link please. I have looked but I cannot locate it.
Thank you,
cutaway

http://db.tt/JQVbCGQS

sbradymobile said:
Load usbcore.ko, usbserial.ko, then ftdi_sio.ko
Unfortunately I don't have any devices to test, so let me know if it works.
Click to expand...
Click to collapse
Okay, I tried but it failed for the reason I thought it would. The .scmversion extensions don't match the kernel I have. I am not going to load the whole kernel as I don't want to trouble shoot the whole system or worry about other issues.
I appreciate your effort.
I need somebody to help me understand why I can successfully build a kernel module with my kernel's .config but it does not have the proper symbols to run the module. I would have thought it would fail to compile. /me sighs

You need host mode for this to work, so the main issue is you have to strip out msm_hsusb and gadget code that is built in to the kernel. This means you need a new kernel image for this to work as there is no module to unload.
The kernel I posted earlier will not work because msm_hsusb is still registered on boot, preventing the ehci-hcd module from loading.
You can try this one if you like http://db.tt/0s7xRlYW; I was able to get ehci-hcd to load, but the dmesg output shows an irq problem.
It is the most recent CM7 kernel.

sbradymobile said:
You need host mode for this to work, so the main issue is you have to strip out msm_hsusb and gadget code that is built in to the kernel. This means you need a new kernel image for this to work as there is no module to unload.
The kernel I posted earlier will not work because msm_hsusb is still registered on boot, preventing the ehci-hcd module from loading.
You can try this one if you like link was here; I was able to get ehci-hcd to load, but the dmesg output shows an irq problem.
It is the most recent CM7 kernel.
Click to expand...
Click to collapse
Was you succeded to bring FTDI up and running?

Related

[Android] TouchPad Android kernel mini howto

It seems there is little information on the internet regarding how to compile the kernel and how to convert to the correct image format so the boot loader will recognise and how to transfer it over to the touchpad. I ended up spent a few hours and finally figured out. I hope this will be useful for someone. I will try to make it concise as this is mainly aimed for developers.
What you will need
A linux development machine with uboot mkimage tool installed.
Sourcery G++ Lite 2010q1-188 for ARM EABI cross compile tool chain
https://sourcery.mentor.com/sgpp/lite/arm/portal/release1294
Touchpad kernel source
https://github.com/CyanogenMod/hp-kernel-tenderloin
CM7 Alpha 3 image (zip file)
http://goo-inside.me/roms/cmtouchpad/alpha3/update-cm-7.1.0-tenderloin-a3-fullofbugs-signed.zip
Prepare
Download CM7 Alpha 3 image and extract the boot.img to a temporary place.
Download Sourcery G++ Lite and install it. Add the G++ Lite tool chain binaray path to the PATH env variable. Get the kernel source from git hub and extract to local disk and change directory to the kernel source.
Compile the kernel
Still in the kernel source directory run
Code:
make ARCH=arm CROSS_COMPILE=arm-none-eabi- tenderloin_android_defconfig
make ARCH=arm CROSS_COMPILE=arm-none-eabi- uImage
Prepare the initramfs U-boot image
Extract the initramfs from the boot.img saved in temporary folder and convert it to uboot-image format
Code:
dd if=boot.img bs=1 skip=3577748 of=img.gz
mkimage -A arm -O linux -T ramdisk -C none -a 0x60000000 -e 0x60000000 -n "Image" -d ./img.gz arch/arm/boot/uRamdisk
(The dd offset for alpha 2.1 image is 3561152)
Combine the kernel and initramfs into a single U-boot image
Create a combined U-boot image (kernel and initramfs)
Code:
mkimage -A arm -O linux -T multi -a 0x40208000 -e 0x40208000 -C none -n "multi image" -d arch/arm/boot/uImage:arch/arm/boot/uRamdisk uImage.CyanogenMod.new
Transfer it to the device
Boot your touchpad into recovery mode and run
Code:
adb shell mount /dev/block/mmcblk0p13 /boot
adb push uImage.CyanogenMod.new /boot/uImage.CyanogenMod.new
adb shell umount /boot
adb shell reboot
After it reboot you should be able to see a new CyanogenMod.new item from the boot menu.
That's it!
Optimisation
For those who wants to experiment with GCC build options you can update the entry "arch-$(CONFIG_CPU_32v7" in file arch/arm/Makefile and I set mine to
Code:
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -O2 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
Warning
Please be aware you are working on the bleeding edge kernel for touchpad and there is no guarantee that the latest git version will work for you. Please try an earlier version if that's the case.
As of 2011-11-23 you will need the latest kernel source to build kernel for alpha 3. Please do not mix the kernel with an initramfs from a different version, i.e. don't use initramfs extracted from alpha 2.1 and use it with alpha3.
Thanks for this. Last weekend spent a while trying to figure this out.
Sent from my HP Touchpad using Tapatalk
x2. Huge thanks
Thank you soooooo much for this guide. Quick question if you don't mind though.. I am using an mkimage that goes back to my nook kernel days. Is there anything newer out, or would this still be ok,?
Divine_Madcat said:
Thank you soooooo much for this guide. Quick question if you don't mind though.. I am using an mkimage that goes back to my nook kernel days. Is there anything newer out, or would this still be ok,?
Click to expand...
Click to collapse
As long as the mkimage can generate a standard U-boot image it should be fine.
You can always try it yourself. In worst case you have to hard reboot the touchpad by pressing the power button and home button at the same time for more than 10 minutes. As long as you keep the original image files (UImage.*) untouched I don't think you can brick it even if you want to.
S7
I have been trying to compile the kernel for some time now, and was hopeful reading your guide (and this last post) However, still following the steps to merge the ramdisk, i cannot make a booting kernel. I can get it flashed, as i am using the update.zip method, but moboot always gives me a crc error when booting it.
Though, before i totally go nuts, i think i need to try the source forgery toolchain, as i am using the Android ndk r6b...
Divine_Madcat said:
S7
I have been trying to compile the kernel for some time now, and was hopeful reading your guide (and this last post) However, still following the steps to merge the ramdisk, i cannot make a booting kernel. I can get it flashed, as i am using the update.zip method, but moboot always gives me a crc error when booting it.
Though, before i totally go nuts, i think i need to try the source forgery toolchain, as i am using the Android ndk r6b...
Click to expand...
Click to collapse
Could you check the md5sum of the u-boot image crated on disk and the one installed by update.zip file? Do they match? If they do then you probably will need to upgrade your mkimage tool.
s7mx1 said:
Could you check the md5sum of the u-boot image crated on disk and the one installed by update.zip file? Do they match? If they do then you probably will need to upgrade your mkimage tool.
Click to expand...
Click to collapse
I will give it a check; just in case, know where to get a newer mkimage?
Thanks so much for this guide
s7mx1 said:
You can always try it yourself. In worst case you have to hard reboot the touchpad by pressing the power button and home button at the same time for more than 10 minutes.
Click to expand...
Click to collapse
It feels like 10 mins.. doesn't it
WEll, i checked the MD5 sums, and it looks good. So, i guess it is time to try again with the toolchain listed here, and perhaps a new mkimage (if there is a "modern" one i should using, please point me to it...)
edit: Never mind.. in all my looking, i never saw that ubuntu had a nice one waiting for me.... doh
edit2: Woo! After getting the probably correct mkimage, and the CS toolchain, looks like i finally got it to pass the crc check. Now, lets see if it finishes booting. Thanks again for the guide!
Nope.. no boot. I get a dmesg with this:
<3>[ 69.978716] init: untracked pid 224 exited
<6>[ 70.086076] android_usb gadget: high speed config #1: android
<6>[ 70.086209] gadget_event: schedule host_connected
<6>[ 70.096953] max8903b_current_setup: CURRENT_500MA
<6>[ 70.097040] gadget_event: source=bus mA=500 (no change)
<4>[ 70.910953] UDC-CHG (2-2-2): usb_multi_chg_detect (591) : USB host Adaptor
(500mA)!
<6>[ 70.912805] gadget_event: schedule host_disconnected
<6>[ 70.925482] max8903b_current_setup: CURRENT_ZERO
<6>[ 71.164066] android_usb gadget: high speed config #1: android
<6>[ 71.164220] gadget_event: schedule host_connected
<6>[ 71.173640] max8903b_current_setup: CURRENT_500MA
<6>[ 71.178212] gadget_event: source=bus mA=500 (no change)
<6>[ 72.160955] gadget_event: host_connected=1 (no change)
<6>[ 74.142224] request_suspend_state: wakeup (0->0) at 74121495501 (2011-11-1
1 22:49:33.378031648 UTC)
<3>[ 74.143675] init: untracked pid 266 exited
<3>[ 74.155217] init: untracked pid 273 exited
<6>[ 79.285016] request_suspend_state: wakeup (0->0) at 79264287462 (2011-11-1
1 22:49:38.520824942 UTC)
The last three lines repeat alot, with different pid's .
Alrighty.. figured this one out - You cannot use the latest repository commits with the 2.1 alpha build. However, i was able to build commit fd70bb7aae, and it builds and actually boots. Now, i can actually play around and tweak it. Thank you again for the guide, and sorry for the edit spamming.. heh.
myn said:
x2. Huge thanks
Click to expand...
Click to collapse
Myn, do you have a touchpad???!!!? God I hope so!
vinscuzzy said:
Myn, do you have a touchpad???!!!? God I hope so!
Click to expand...
Click to collapse
He does
Sent from my PG86100 using Tapatalk
Divine_Madcat said:
WEll, i checked the MD5 sums, and it looks good. So, i guess it is time to try again with the toolchain listed here, and perhaps a new mkimage (if there is a "modern" one i should using, please point me to it...)
edit: Never mind.. in all my looking, i never saw that ubuntu had a nice one waiting for me.... doh
edit2: Woo! After getting the probably correct mkimage, and the CS toolchain, looks like i finally got it to pass the crc check. Now, lets see if it finishes booting. Thanks again for the guide!
Nope.. no boot. I get a dmesg with this:
<3>[ 69.978716] init: untracked pid 224 exited
<6>[ 70.086076] android_usb gadget: high speed config #1: android
<6>[ 70.086209] gadget_event: schedule host_connected
<6>[ 70.096953] max8903b_current_setup: CURRENT_500MA
<6>[ 70.097040] gadget_event: source=bus mA=500 (no change)
<4>[ 70.910953] UDC-CHG (2-2-2): usb_multi_chg_detect (591) : USB host Adaptor
(500mA)!
<6>[ 70.912805] gadget_event: schedule host_disconnected
<6>[ 70.925482] max8903b_current_setup: CURRENT_ZERO
<6>[ 71.164066] android_usb gadget: high speed config #1: android
<6>[ 71.164220] gadget_event: schedule host_connected
<6>[ 71.173640] max8903b_current_setup: CURRENT_500MA
<6>[ 71.178212] gadget_event: source=bus mA=500 (no change)
<6>[ 72.160955] gadget_event: host_connected=1 (no change)
<6>[ 74.142224] request_suspend_state: wakeup (0->0) at 74121495501 (2011-11-1
1 22:49:33.378031648 UTC)
<3>[ 74.143675] init: untracked pid 266 exited
<3>[ 74.155217] init: untracked pid 273 exited
<6>[ 79.285016] request_suspend_state: wakeup (0->0) at 79264287462 (2011-11-1
1 22:49:38.520824942 UTC)
The last three lines repeat alot, with different pid's .
Alrighty.. figured this one out - You cannot use the latest repository commits with the 2.1 alpha build. However, i was able to build commit fd70bb7aae, and it builds and actually boots. Now, i can actually play around and tweak it. Thank you again for the guide, and sorry for the edit spamming.. heh.
Click to expand...
Click to collapse
That's because dalingrin has updated the default configuration to use the HIGHMEM which seems to kill all the apps. The latest git actually works if you disable all the HIGHMEM related stuff.
decalex said:
Thanks so much for this guide
It feels like 10 mins.. doesn't it
Click to expand...
Click to collapse
Absolutely
I just hope there is a rest button as the touchscreen occasionally will not respond at all after wake up and I have to reboot to webos and then reboot back to get the touchscreen back.
Great guide and I got the kernel all built, but how do you change the kernel arguments for booting? e.g. where does moboot get its whole root=/dev/ram0 ro fb...stuff, and how does the CyanogenMod kernel know where to look for the rootfs partition?
crimsonredmk said:
Great guide and I got the kernel all built, but how do you change the kernel arguments for booting? e.g. where does moboot get its whole root=/dev/ram0 ro fb...stuff, and how does the CyanogenMod kernel know where to look for the rootfs partition?
Click to expand...
Click to collapse
The root parameter (root=/dev/ram0) that passed to kernel is not useful to you. The root / is mere extracted initramfs in memory. I assume you are looking for system, data partitions etc. With TP we have LVM partitions which you can do really fancy stuff with. The actual mount device and mount point is defined (hard coded) in file init.tenderloin.rc which you can find in the initramfs (i.e. the img.gz which is a gzipped cpio file). You can extract all the contents out from img.gz and modify init.tenderloin.rc to suit your need and then create an updated initramfs file to go with the kernel.
Since Android (at least CM7 on TP) does not use pivot_root any changes made to the initramfs will appear automatically when you boot up the device.
You can google if you are not sure how to work with initramfs file.

Connecting Android to a serial device using USB-Serial Converter

I am attempting to connect to a serial device from a Android tablet, via
USB-Serial Converter. In order to interface with this particular serial
device, a linux library must be used as an interface.
This library takes an integer as an argument, and tries to connect to the
device at the following location : /dev/ttySx, where x is the arguement. If
2 is provided to the library, it will look for the device at /dev/ttyS2.
Very simple.
When I connect the device to Ubuntu, there's is one simple extra step for
this device to work with the USB-Serial convert. The converter is exposed
at the location /dev/ttyUSB1. I just need to create a simple soft-link with
the serial port pattern (etc "ln -s /dev/ttyUSV1 /dev/ttyS99"). It works
perfectly.
Now the problem arises for Android. The converter is seen at
/dev/bus/usb/01/01. I never seen this convention in other project. The
question is how can I direct the I/O from /dev/ttySX to /dev/bus/usb/01/01
ehpaul said:
I am attempting to connect to a serial device from a Android tablet, via
USB-Serial Converter. In order to interface with this particular serial
device, a linux library must be used as an interface.
This library takes an integer as an argument, and tries to connect to the
device at the following location : /dev/ttySx, where x is the arguement. If
2 is provided to the library, it will look for the device at /dev/ttyS2.
Very simple.
When I connect the device to Ubuntu, there's is one simple extra step for
this device to work with the USB-Serial convert. The converter is exposed
at the location /dev/ttyUSB1. I just need to create a simple soft-link with
the serial port pattern (etc "ln -s /dev/ttyUSV1 /dev/ttyS99"). It works
perfectly.
Now the problem arises for Android. The converter is seen at
/dev/bus/usb/01/01. I never seen this convention in other project. The
question is how can I direct the I/O from /dev/ttySX to /dev/bus/usb/01/01
Click to expand...
Click to collapse
Which android device are you using and with which kernel and android build? In my case I am using kernel 3.0.+ with CM9 on a Kindle Fire and I do see the /dev/ttyUSBx getting created along with the /dev/bus/01/01. It has been a month since I tried it but I was able to see the problem you see and here is what I remember. When you plug the serial convertor both /dev get created but since the Android USB support only uses /dev/bus/usb/01/01, the kernel in order to save power "unmounts" the unused /dev/ttyUSBx after a certain time period. You can try using dmesg to see if that is happening in your case also. There is a kernel build flag that tells the kernel not to "unmount" it but I dont remember it off-hand. Best would be to use the Android USB support to talk to your device instead of the linux library if you can.
--------Update after testing it out again and checking dmesg etc---------------------------
When I plug the FTDI cable this is what shows up in dmesg:
<6>usb 1-1: new full speed USB device number 8 using musb-hdrc
<3>usb 1-1: device v0403 p6001 is not supported
<6>ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
<6>usb 1-1: Detected FT232RL
<6>usb 1-1: Number of endpoints 2
<6>usb 1-1: Endpoint 1 MaxPacketSize 64
<6>usb 1-1: Endpoint 2 MaxPacketSize 64
<6>usb 1-1: Setting MaxPacketSize 64
<6>usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
At this point if I check the filesystem I see both /dev/ttyUSB0 and /dev/bus/usb/001/0xx [ xx being the current device number ]
I can work with /dev/ttyUSB0 and all is well. Now as soon as I invoke any app that uses Android USB Host Mode API to connect
to USB (for enumeration, connection or whatever) the /dev/ttyUSB0 gets disconnected with following message from dmesg:
<6>ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
<6>ftdi_sio 1-1:1.0: device disconnected
At this point /dev/bus/usb/001/0xx is still alive and if I enumerate the USB devices using android API I see the same as the adaptor
name. So looks like till the Android USB API takes over the FTDI is available as /dev/ttyUSB0 but not afterwards.
------------------------Update ends--------------------------------
(a) If you see a /dev/ttyUSB1 device node created, then you can try the following in an Android terminal:
Code:
stty -F /dev/ttyUSB1 raw
cat /dev/ttyUSB1
If this shows data from your device, then you can use directly the device node to read()/write(), POSIX-style, without needing any library.
(b) If you cannot see a /dev/ttyUSB1 in your Android device, this means that you need to load the ftdi_sio kernel module (check android.serverbox.ch/?p=285 for instructions).
Let me link that for you:
"How to enable FTDI Support for your USB Host featuring Honeycomb Tablet (including sample native application)"
Also have a look at FTDI's Android Paper:
"White Paper: Connecting Peripherals to an Android Platform"
and this relevant blog, from this XDA thread.
pankaj013 said:
Which android device are you using and with which kernel and android build? In my case I am using kernel 3.0.+ with CM9 on a Kindle Fire and I do see the /dev/ttyUSBx getting created along with the /dev/bus/01/01. It has been a month since I tried it but I was able to see the problem you see and here is what I remember. When you plug the serial convertor both /dev get created but since the Android USB support only uses /dev/bus/usb/01/01, the kernel in order to save power "unmounts" the unused /dev/ttyUSBx after a certain time period. You can try using dmesg to see if that is happening in your case also. There is a kernel build flag that tells the kernel not to "unmount" it but I dont remember it off-hand. Best would be to use the Android USB support to talk to your device instead of the linux library if you can.
--------Update after testing it out again and checking dmesg etc---------------------------
When I plug the FTDI cable this is what shows up in dmesg:
<6>usb 1-1: new full speed USB device number 8 using musb-hdrc
<3>usb 1-1: device v0403 p6001 is not supported
<6>ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
<6>usb 1-1: Detected FT232RL
<6>usb 1-1: Number of endpoints 2
<6>usb 1-1: Endpoint 1 MaxPacketSize 64
<6>usb 1-1: Endpoint 2 MaxPacketSize 64
<6>usb 1-1: Setting MaxPacketSize 64
<6>usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
At this point if I check the filesystem I see both /dev/ttyUSB0 and /dev/bus/usb/001/0xx [ xx being the current device number ]
I can work with /dev/ttyUSB0 and all is well. Now as soon as I invoke any app that uses Android USB Host Mode API to connect
to USB (for enumeration, connection or whatever) the /dev/ttyUSB0 gets disconnected with following message from dmesg:
<6>ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
<6>ftdi_sio 1-1:1.0: device disconnected
At this point /dev/bus/usb/001/0xx is still alive and if I enumerate the USB devices using android API I see the same as the adaptor
name. So looks like till the Android USB API takes over the FTDI is available as /dev/ttyUSB0 but not afterwards.
------------------------Update ends--------------------------------
Click to expand...
Click to collapse
are you using ftdi's code to modify it?
change /system/etc/permissions
this is from a question on stackoverflow titled "Android USB host and hidden devices" (sorry, i can't add external URLs yet). it worked like a charm on a micromax A120 canvas 2 phone (kitkat 4.4.2). now i can control my Arduino! i used busybox tools to do all the command line work (otherwise chmod wouldn't work). my steps (perhaps some were not required):
(0) install PDAnet drivers on my Windows 8 computer.
(1) root the phone using Vroot (now called iRoot). Very simple, only catch is that the su grant/deny page is partly in chinese, no big deal.
(2) install busybox and jackpal's Android-Terminal-Emulator available on github and the google play store (free).
(3) open a terminal window and become the superuser:
# su
(4) the file system may be read-only, so you might have to remount it:
# mount -o rw,remount -t yaffs2 /
or
# mount -o rw,remount -t rootfs /
or
# mount -o rw,remount -t rootfs rootfs /system
(5) make default.prop read/write:
chmod 666 /default.prop
(6) edit /default.prop, make the following changes:
ro.secure=0
ro.debuggable=1
persist.service.adb.enable=1
... And this is the real meat of it:
(7) To enable USB host API support you should add a file named
android.hardware.usb.host.xml and containing the following lines:
<permissions>
<feature name="android.hardware.usb.host"/>
</permissions>
into folder
/system/etc/permissions
in that folder find file named
handheld_core_hardware.xml or tablet_core_hardware.xml
and add
<feature name="android.hardware.usb.host" />
into <permissions> section.
(8) Reboot your device. Usb host api should work.

[Q]insmod test.ko mTIMA: lkmauth--verification failed -1

Hello All,
I'm unable to insert a simple kernel module on my rooted S4 I9505.
below are the errors
Code:
insmod /data/local/tmp/testHello.ko
insmod: init_module '/data/local/tmp/testHello.ko' failed (Exec format error)
and kmsg's are
Code:
<4>[ 2127.554107] TIMA: lkmauth--launch the tzapp to check kernel module; module len is 71334
<4>[ 2127.554168] TIMA: lkmauth -- hdr before kreq is : e337b000
<4>[ 2127.554199] TIMA: lkmauth--send cmd (lkmauth) cmdlen(304:320), rsplen(264:320) id 0x00050000, req (0xE352A000), rsp(0xE352A140), module_start_addr(0xE337B000) module_len 71334
<3>[ 2127.581909] TIMA: lkmauth--verification failed -1
<4>[ 2127.582183] TIMA: MSG=lkm_modified; result (TIMA_RESULT=MSG=lkm_modified;)
<6>[ 2129.417541] [debug_wake_locks]active wake lock msm_otg
Any help or pointers would be of great help
Best Regards
Basha
did u manage to insmod your module? im having same issue on my i9505 stock kernel rooted. it seems to also come up prevention information in the status bar
DipSprayArc said:
did u manage to insmod your module? im having same issue on my i9505 stock kernel rooted. it seems to also come up prevention information in the status bar
Click to expand...
Click to collapse
This means that module format is not same as stock kernel even if you compile your module based on the stock kernel config.
Also for the "Detection information" dialog in status bar you need to tweak as explained in this and/or this thread based on your model
Hit thanks if this helps
Am trying to run a ATH9K_htc driver. I compiled as a module with the kernel but no good same extra version. Is there anyway to do this? Mayb modify kernel to take insmod --forced? Or this may already be set can't remember.
Thanks for solution to detection information. Had been looking
Cheers
---------- Post added at 01:29 AM ---------- Previous post was at 01:24 AM ----------
Also read that they may need some kind of digital signing? ELF?
DipSprayArc said:
Am trying to run a ATH9K_htc driver. I compiled as a module with the kernel but no good same extra version. Is there anyway to do this? Mayb modify kernel to take insmod --forced? Or this may already be set can't remember.
Thanks for solution to detection information. Had been looking
Cheers
---------- Post added at 01:29 AM ---------- Previous post was at 01:24 AM ----------
Also read that they may need some kind of digital signing? ELF?
Click to expand...
Click to collapse
either you add extra version in Makefile like
Code:
VERSION = 3
PATCHLEVEL = 4
SUBLEVEL = 0
EXTRAVERSION =-431985 // this string should match with target kernel version(extra)
Or
try to disable CONFIG_MODVERSIONS check in your kernel config.
HIT Thanks if its helps

[Q] ppp widget not working

Dear friends,
I have rooted nexus 7 2012, and installed PPP widget. I have configured the APN. It says "connected", but the internet is not working. Here is the PPP widget log, please help me:
PPP Widget version 1.3.3
USB_ModeSwitch log from Mon Dec 23 15:00:41 IST 2013
Raw args from udev: 2-1/2-1:1.0
Using top device dir /sys/bus/usb/devices/2-1
----------------
USB values from sysfs:
manufacturer USB Modem
product USB Modem
serial 1234567890ABCDEF
----------------
bNumConfigurations is 1 - don't check for active configuration
SCSI attributes not needed, moving on
checking config: /data/data/de.draisberghof.pppwidget/app_tmp/1c9e.f000
! matched. Reading config data
devList 1:
config: TargetVendor set to 1c9e
config: TargetProductList set to 9000,9603,9605,9607
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1
Command to be run:
usb_modeswitch -I -W -D -s 20 -u -1 -b 2 -g 2 -v 1c9e -p f000 -f $cB
Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------
Reading long config from command line
* usb_modeswitch: handle USB devices with multiple modes
* Version 1.2.7 (C) Josua Dietze 2012
* Based on libusb0 (0.1.12 and above)
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x1c9e
DefaultProduct= 0xf000
TargetVendor= 0x1c9e
TargetProduct= not set
TargetClass= not set
TargetProductList="9000,9603,9605,9607"
DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
QuantaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
BlackberryMode=0
PantechMode=0
MessageEndpoint= not set
MessageContent="55534243123456788000000080000606f50402527000000000000000000000"
NeedResponse=0
ResponseEndpoint= not set
InquireDevice disabled
Success check enabled, max. wait time 20 seconds
System integration mode enabled
Use given bus/device number: 002/002 ...
Looking for default devices ...
bus/device number matched
searching devices, found USB ID 1c9e:f000
found matching vendor ID
found matching product ID
adding device
Found device in default mode, class or configuration (1)
Skipping the check for the current configuration
Using interface number 0
Using endpoints 0x01 (out) and 0x81 (in)
USB description data (for identification)
-------------------------
Manufacturer: USB Modem
Product: USB Modem
Serial No.: 1234567890ABCDEF
-------------------------
Looking for active driver ...
OK, driver found; name unknown, limitation of libusb1
OK, driver "unkown" detached
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01
Bus/dev search active, referring success check to wrapper. Bye.
ok:busdev
--------------------------------
(end of usb_modeswitch output)
Checking success of mode switch for max. 20 seconds ...
Reading attributes ...
Reading attributes ...
Mode switch has completed
Mode switching was successful, found 1c9e:9605 (USB Modem: USB Modem)
Device class of first interface is ff
Now checking for bound driver ...
Driver has bound, device is known
All done, exiting

building lineageos error

[ 75% 3/4] glob device/coolpad/C106/bluetooth
ninja: error: '/home/mamarma9904/lineage/out/target/product/C106/obj_arm/SHARED_LIBRARIES/libtfa9890_intermediates/export_includes', needed by '/home/mamarma9904/lineage/out/target/product/C106/obj_arm/SHARED_LIBRARIES/audio_amplifier.msm8952_intermediates/import_includes', missing and no known rule to make it
14:11:12 ninja failed with: exit status 1
I have above error. how to fix this error?
this phone's kernel source does not released so I use similar device kernel.
or there is prebuilt kernel zImage.
https://github.com/mamarama9904/android_device_c106
https://github.com/mamarama9904/proprietary_vendor_coolpad_c106
https://github.com/LineageOS/android_kernel_leeco_msm8976
https://forum.xda-developers.com/cool1/development/kernel-stockpatched-t3830919

Categories

Resources