Resistive Touchscreen Calibration Program on iMX6Q with Android ICS 4.0.4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Resistive Touchscreen Calibration Program on iMX6Q with Android ICS 4.0.4

9,684 Views
SumitVaidya
Contributor II

Hi,

I was able to boot uboot, uImage and rootfs on iMX6Q with Android ICS 4.0.4. I am running uImage and rootfs using NFS (over a network).

I can see my touchscreen showing a pointer and even accepts touchs events. I verified it on "/dev/input/event1" and can see my touch events getting in through. The only problem I have is that touchscreen is not calibrated. So my pointer does not match with my touch.

FYI: It is a resistive touchscreen from OKAYA Electric that gets shipped as a standard package from Boundary.

I tried applying R13.3 patches from Boundary git with no success. There is "ts_calibrator" program on rootfs that exits abruptly after running manually without displaying any output on screen. When I integrate R13.2 patches from Boundary, "ts_calibrator" program runs with "Touch out of range" error.

Can you please point me in right direction to resolve this error and calibrate touchscreen properly?

Thanks.

Regards,

Sumit

Labels (2)
13 Replies

2,231 Views
xinyu_chen
NXP Employee
NXP Employee

Hi Sumit

First, you must add calibration support in you TS drivers, like

drivers/input/touchscreen/mxc_ts.c did:

linux-2.6-imx.git - Freescale i.MX Linux Tree

Second, you would have to make this ts_calibrator run on boot by adding it into init.rc:

on boot                                                                                                         

# basic network init                                                                                            

    ifup lo                                                                                                     

    hostname localhost                                                                                          

    domainname localdomain                                                                                      

                                                                                                                

    mkdir /data/system 0775 system system                                                                       

    exec /sbin/ts_calibrator

Last thing, define the following things in your BoardConfig.mk:

TARGET_TS_CALIBRATION := true                                                                                    

TARGET_TS_DEVICE := "mxc_ts"    // this is your touchscreen driver name

2,231 Views
SumitVaidya
Contributor II

Thanks Xinyu, That worked.

Now I see "Encryption unsuccessful" window providing only option to "Rest phone" as mentioned by Larry above.

I followed the link http://source.android.com/tech/encryption/android_crypto_implementation.html and disabled CONFIG_DM_CRYPT variable in kernel configuration with no success.

I think it has something to do with communication between android framework and kernel or has something to relate with 'vold' process. How can I disable the encryption at boot up and get access to complete Android UI?

Thanks.


Regards,

Sumit

0 Kudos

2,231 Views
xinyu_chen
NXP Employee
NXP Employee

Sumit Vaidya wrote:

Thanks Xinyu, That worked.

Now I see "Encryption unsuccessful" window providing only option to "Rest phone" as mentioned by Larry above.

I followed the link http://source.android.com/tech/encryption/android_crypto_implementation.html and disabled CONFIG_DM_CRYPT variable in kernel configuration with no success.

I think it has something to do with communication between android framework and kernel or has something to relate with 'vold' process. How can I disable the encryption at boot up and get access to complete Android UI?

Thanks.


Regards,

Sumit

I'm not sure about this issue, Looks like you have not make your /data partition clean and mounted correctly?

Have you enable the encryption features in Setting APK?

0 Kudos

2,231 Views
SumitVaidya
Contributor II

Thanks Xinyu.

The problem was with mounting /data partition. I edited init.rc file and added following line to it.

"mount tmpfs tmpfs /data mode=0775,gid=1000"

In init.freescale.rc I had to comment following line

"mount ext4 /dev/block/mmcblk0p7 /data nosuid nodev nodiratime noatime noauto_da_alloc errors=panic"

With these changes touchscreen made to work. I can browse through menus correctly.

When I go to "Messages" menu or to other menu that needs virtual keyboard, the keys touched on screen will not get typed in. I observed there is some offset in the keys touched and keys that are actually getting typed in. I need to touch by some offset towards right side of "Backspace" key to delete the characters. It seems to be a problem with keyboard key map.

Do you have any idea, what could be wrong here?

Regards,

Sumit

0 Kudos

2,232 Views
ujalakumar
Contributor II

Hi sumit,

I am also currently facing exactly the similar issues of  "Touch panel not responding"  and  "Virtual keypad offset towards right side"  and have no clues whatsoever.. :smileycry:

in fact , i have been searching in the community from last 7 days for any help , clue or some relevant discussion before i could get this excellant work explored by yourself and Xinyu...

I am working on a i.MX6S based custom board which is actually a "toned-down" version of  i.MX6DL SABRE-SD board.     This hardware is using  24-bit 800x480, parallel LCD display Panel and a 5-point capacitive touch panel. .  The BSP is ICS 4.0.4 Android 13.4.1.

1)

The Touch panel is working as we can register and see the events  as well as touch points/traces  on the display while a touch action is performed, but  the inputs seems to be not taken by the Android UI and no action happens ...!!!   even the unlock not happens even though touch point is on the unlock icon and sliding action is done.

2)

The Android Virtual Keypad behaves differetently and appears to be shifted ....    On touching any key on the screen, 1 or 2 places before key appears on the screen .. ( touching "p" , "i"appears  and toucing "o" , "u" appears..)  ...   ".

Attached here pl. find the "logcat" of  our hardware for reference and analysis,

would like to request your help and guidance to please let me through this poblem...

warm regards,

Ujala

0 Kudos

2,231 Views
xinyu_chen
NXP Employee
NXP Employee

Sumit Vaidya wrote:

Thanks Xinyu.

The problem was with mounting /data partition. I edited init.rc file and added following line to it.

"mount tmpfs tmpfs /data mode=0775,gid=1000"

In init.freescale.rc I had to comment following line

"mount ext4 /dev/block/mmcblk0p7 /data nosuid nodev nodiratime noatime noauto_da_alloc errors=panic"

With these changes touchscreen made to work. I can browse through menus correctly.

When I go to "Messages" menu or to other menu that needs virtual keyboard, the keys touched on screen will not get typed in. I observed there is some offset in the keys touched and keys that are actually getting typed in. I need to touch by some offset towards right side of "Backspace" key to delete the characters. It seems to be a problem with keyboard key map.

Do you have any idea, what could be wrong here?

Regards,

Sumit

I do not know why you mount /data as a tmpfs? It will eat your memory quickly, and you will get application running failed in some cases as lack of /data space. What's the "Meassage" menu?

0 Kudos

2,231 Views
SumitVaidya
Contributor II

Hello Xinyu,

I am using network file system and hence having "/data" partition on my linux machine. If I do not mount /data as a tmpfs it gives me "Encryption unsuccessful" screen.  "Messaging" menu takes me to write a new text message. If I use virtual keyboard to write a text message, it doesn't show me characters that I am typing in as I have described above.

I found one more issue while debugging today. If I do not do any activity on touchscreen it automatically locks my screen. After that I cannot unlock it by touching "Unlock" symbol. I used "getevent /dev/input/event0" command to verify touch events and I can see touch events are getting processed. I have found an option to delay this sleep state to 30 minutes but this is certainly not a solution. Is there a way to disable this feature or how do I get touch events on the locked screen?

I am also working on writing an android image on SD card and boot through it.

Thanks.

Regards,

Sumit

0 Kudos

2,232 Views
xinyu_chen
NXP Employee
NXP Employee

Sumit Vaidya wrote:

Hello Xinyu,

I am using network file system and hence having "/data" partition on my linux machine. If I do not mount /data as a tmpfs it gives me "Encryption unsuccessful" screen.  "Messaging" menu takes me to write a new text message. If I use virtual keyboard to write a text message, it doesn't show me characters that I am typing in as I have described above.

Yes, the /data partition must be mounted to use encryption feature, I think you can use one of your disk or storage on hw to do that, but not using memory.

I'm not sure about the virtual keyboard not echo issue.

I found one more issue while debugging today. If I do not do any activity on touchscreen it automatically locks my screen. After that I cannot unlock it by touching "Unlock" symbol. I used "getevent /dev/input/event0" command to verify touch events and I can see touch events are getting processed. I have found an option to delay this sleep state to 30 minutes but this is certainly not a solution. Is there a way to disable this feature or how do I get touch events on the locked screen?

It's weird, lock screen should take the same touch event as home. One way disable lock: Settings->Security->Screen Lock -> None

I am also working on writing an android image on SD card and boot through it.

Thanks.

That's a formal way to boot an android system

0 Kudos

2,231 Views
SumitVaidya
Contributor II

Hello,

Now I have a working and properly calibrated touchscreen over NFS. I also found an option "Settings->Security->Screen Lock -> None" to disable lock. Its still not stable. I cannot unlock the screen all the times. But still "getevent /dev/input/event0" shows events getting in. I am debugging this.

Also, I programmed MicroSD card with android image having boot.img, recovery.img, system.img. I used a freescale prebuilt script "fsl-sdcard-partition.sh" to parition and format SD card in 9 partitions. When I execute "booti mmc1" command at the bootloader prompt, I get following error

"booti: bad boot image magic"

I checked other commands for "mmc". Here is the output I get.

MX6Q SABRELITE U-Boot > mmc part
Card did not respond to voltage select! Unknown partition table

Can you please provide some light on this? Is there any other script through which I can partition SD card in 9 partitions with one bootable partition and flash boot.img, recovery.img, system.img?

Regards,

Sumit

0 Kudos

2,231 Views
xinyu_chen
NXP Employee
NXP Employee

Hi Sumit

Did you select the correct mmc device when trying booti?

0 Kudos

2,231 Views
SumitVaidya
Contributor II

Yes. This is my bootargs.

"console=ttymxc1,115200 rw video=mxcfb0:dev=lcd CLAA-WVGA, if=RGB666 root=/dev/mmcblk0p1 ip=dhcp rootwait fixrtc"

I am using "booti mmc1" command to boot android from Micro SD Card. I assume it uses uboot from NOR flash and load uImage and root file system from Micro SD card after I use "booti mmc1" command.

Following is the output of "mmc list" command on the bootloader prompt.

MX6Q SABRELITE Android U-Boot 09/18/2012 A > mmc list

FSL_USDHC: 0

FSL_USDHC: 1

How can I make sure, MMC card has been detected successfully? Am I missing something?

Regards,

Sumit

0 Kudos

2,232 Views
xinyu_chen
NXP Employee
NXP Employee

Please use mmcinfo to check your MMC card is detected successfully or not.

0 Kudos

2,232 Views
SumitVaidya
Contributor II

'mmcinfo' gives me the correct information. I tried with linux micro SD card with linux rootfs and it boots up successfully.

Its only when I try to boot android from root file system on micro SD card, I see a problem.

Regards,

Sumit

0 Kudos