天嵌 ARM开发社区

 找回密码
 注册
查看: 6420|回复: 22

Qtopia 2.2.0下触摸屏无法使用的问题

[复制链接]
baifang20 发表于 2012-10-8 12:51:36 | 显示全部楼层 |阅读模式
使用的linux是2.6.25.8,根据TQ的一步一步移植手册移植好的,触摸屏驱动也是直接从TQ提供的源码里复制出来的
然后Qtopia2.2.0也是TQ提供的,编译出来。。。结果,总是无法进入矫正界面,更无法使用(鼠标使用到时正常)

我直接执行(我想试试这样能否进入矫正)
[root@EmbedSky /]# ts_calibrate
ts_open: No such file or directory
还没明白ts_open在哪里呢,看了驱动里也没找到。。。

在bin下写的Qtopia是这样的
export set HOME=/root
export set QTDIR=/opt/Qtopia
export set QPEDIR=/opt/Qtopia
export set KDEDIR=/opt/kde
export set QWS_KEYBOARD="TTY:/dev/tty1"
if [ -f /sys/devices/virtual/input/input0/uevent ];then
        export set TSLIB_TSDEVICE=/dev/event0
        export set TSLIB_CONFFILE=/etc/ts.conf
        export set TSLIB_PLUGINDIR=/lib/ts
        export set TSLIB_CALIBFILE=/etc/pointercal
        export set QWS_MOUSE_PROTO="TPanel:/dev/event0 USB:/dev/mouse0"
else
        export set QWS_MOUSE_PROTO="USB:/dev/mouse0"
        if [ - /etc/pointercal ];then
                echo only use mouse > tq2440_serial0
        else
                echo "1 0 1 0 1 1 65536" > /etc/pointercal
       fi
fi
export set PATH=$QPEDIR/bin:$PATH                                      
export set LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib                     
                                                           
if [ -f /etc/pointercal ];then                             
        qpe 1>/dev/null 2>/dev/null                        
else                                                      
        ts_calibrate                                       
        qpe 1>/dev/null 2>/dev/null                        
                                                
fi

每次启动,这个条件都无法成立if [ -f /sys/devices/virtual/input/input0/uevent ];then
但是在启动信息中又看到驱动安装成功了吖。。。是不是在2.6.25.8版本的linux下地址会不一样呢?

不知道肿么办,为什么光盘只提供了2.6.30版本的文件系统源码,而没有2.6.25的。。。

顺便提下开发板是TQ2440
 楼主| baifang20 发表于 2012-10-8 12:53:48 | 显示全部楼层
刚才试了下把Qropia注释成这样
#if [ -f /sys/devices/virtual/input/input0/uevent ];then
        export set TSLIB_TSDEVICE=/dev/event0
        export set TSLIB_CONFFILE=/etc/ts.conf
        export set TSLIB_PLUGINDIR=/lib/ts
        export set TSLIB_CALIBFILE=/etc/pointercal
        export set QWS_MOUSE_PROTO="TPanel:/dev/event0 USB:/dev/mouse0"
#else
#       export set QWS_MOUSE_PROTO="USB:/dev/mouse0"
#       if [ - /etc/pointercal ];then
  #              echo only use mouse > tq2440_serial0
  #      else
#               echo "1 0 1 0 1 1 65536" > /etc/pointercal
  #     fi
#fi

幻想着让他强制进入有触摸驱动下。。。结果开机后提示
Start Qtopia-2.2.0

Please press Enter to activate this console. Segmentation fault

[root@EmbedSky /]#

什么段错误?不知道神马意思呵呵。。。
cyd411 发表于 2012-10-8 15:34:50 | 显示全部楼层
删除pointercal 这个文件,启动后就调用你的触屏校验程序了
cyd411 发表于 2012-10-8 15:36:09 | 显示全部楼层
ts_open应该是你驱动有问题,看看是否加载触屏驱动
亚瑟王 发表于 2012-10-8 16:20:29 | 显示全部楼层
baifang20 发表于 2012-10-8 12:53
刚才试了下把Qropia注释成这样
#if [ -f /sys/devices/virtual/input/input0/uevent ];then
        expo ...

  export set TSLIB_TSDEVICE=/dev/event0这句话中的event0一定要是触摸设备的设备名哦。
/sys/devices/virtual/input/input0/uevent这句话是判断是否存在触摸设备(如果不存在,就执行else的。)
你的触摸设备名是什么呢?
 楼主| baifang20 发表于 2012-10-8 17:18:51 | 显示全部楼层
cyd411 发表于 2012-10-8 15:36
ts_open应该是你驱动有问题,看看是否加载触屏驱动

EmbedSky TouchScreen successfully loaded
input: EmbedSky TouchScreen as /class/input/input0

谢谢回答,这个启动信息能否说明加载成功了呢?
 楼主| baifang20 发表于 2012-10-8 17:27:35 | 显示全部楼层
亚瑟王 发表于 2012-10-8 16:20
export set TSLIB_TSDEVICE=/dev/event0这句话中的event0一定要是触摸设备的设备名哦。
/sys/devices/ ...

:$有点不好意思,我还不知道怎么查看触摸设备的设备名呢。。。

文件EmbedSky_ts.c驱动里的
static struct device_driver EmbedSky_ts_driver = {
       .name           = "EmbedSky-ts",
       .bus            = &platform_bus_type,
       .probe          = EmbedSky_ts_probe,
       .remove         = EmbedSky_ts_remove,
};

tsdev.c驱动里的
static struct input_handler tsdev_handler = {
        .event                = tsdev_event,
        .connect        = tsdev_connect,
        .disconnect        = tsdev_disconnect,
        .fops                = &tsdev_fops,
        .minor                = TSDEV_MINOR_BASE,
        .name                = "tsdev",
        .id_table        = tsdev_ids,
};
这两个的.name和设备名有没有关系呢?

谢谢亚瑟老大
亚瑟王 发表于 2012-10-8 17:52:03 | 显示全部楼层
baifang20 发表于 2012-10-8 17:27
有点不好意思,我还不知道怎么查看触摸设备的设备名呢。。。

文件EmbedSky_ts.c驱动里的

cat /proc/bus/input/devices就可以看到了。
 楼主| baifang20 发表于 2012-10-8 18:36:04 | 显示全部楼层
亚瑟王 发表于 2012-10-8 17:52
cat /proc/bus/input/devices就可以看到了。

[root@EmbedSky /]# cat /proc/bus/input/devices
I: Bus=0013 Vendor=dead Product=beef Version=0101
N: Name="EmbedSky TouchScreen"
P: Phys=ts0
S: Sysfs=/class/input/input0
U: Uniq=
H: Handlers=event0 ts0
B: EV=b
B: KEY=0
B: ABS=1000003

:dizzy:看上面的设备名应该是event0吧,怎么就是不行呢。。。555
460769013 发表于 2012-10-9 10:45:10 | 显示全部楼层
Start Linux ...
Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00300000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......
Uncompressing Linux..................................................................................................................................... done, booting the kernel.
Linux version 2.6.30.4-EmbedSky (root@EmbedSky) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-176) ) #11 Fri Oct 5 22:31:20 CST 2012
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
NR_IRQS:85
irq: clearing pending ext status 00080000
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 60444KB available (3668K code, 392K data, 248K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 936 bytes
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 97 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
cfg80211: Calling CRDA to update world regulatory domain
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (extended precision)
JFFS2 version 2.2. (NAND) (SUMMARY)  漏 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
yaffs Oct  2 2012 11:56:49 Installing.
msgmni has been set to 118
io scheduler noop registered (default)
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 60x34
fb0: s3c2410fb frame buffer device
backlight initialized
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
s3c2440-uart.0: tq2440_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: tq2440_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: tq2440_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
Driver 'sd' needs updating - please use bus_type methods
dm9000 Ethernet Driver, V1.31
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=2, 20ns Twrph0=3 30ns, Twrph1=2 20ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 663 at 0x0000052e0000
Bad eraseblock 961 at 0x000007820000
Bad eraseblock 1045 at 0x0000082a0000
Bad eraseblock 1394 at 0x00000ae40000
Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x000000000000-0x000000040000 : "EmbedSky_Board_uboot"
0x000000200000-0x000000500000 : "EmbedSky_Board_kernel"
0x000000500000-0x000010000000 : "EmbedSky_Board_yaffs2"
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
s3c2410_udc: debugfs dir creation failed -19
s3c2440-usbgadget s3c2440-usbgadget: S3C2440: increasing FIFO to 128 bytes
mice: PS/2 mouse device common for all mice
TQ2440 TouchScreen successfully loaded
input: TQ2440 TouchScreen as /class/input/input0
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
i2c /dev entries driver
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v0.1.0)
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.20.
ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
lib80211: common routines for IEEE802.11 drivers
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
end_request: I/O error, dev mtdblock2, sector 256
isofs_fill_super: bread failed, dev=mtdblock2, iso_blknum=64, block=128
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
block 624 is bad
block 922 is bad
block 1006 is bad
block 1355 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) on device 31:2.
Freeing init memory: 248K
hwclock: can't open '/dev/misc/rtc': No such file or directory
/etc/init.d/rcS: line 28: EmbedSky_wdg: not found
/etc/init.d/rcS: line 30: qt4: not found
insmod: can't insert '/lib/input-polldev.ko': No such file or directory
insmod: can't insert '/lib/mac80211.ko': No such file or directory
insmod: can't insert '/lib/rt2x00lib.ko': No such file or directory
insmod: can't insert '/lib/rt2x00usb.ko': No such file or directory
insmod: can't insert '/lib/rt73usb.ko': No such file or directory
insmod: can't insert '/lib/zd1211rw.ko': No such file or directory
insmod: can't insert '/lib/ov9650.ko': No such file or directory
/etc/init.d/rcS: line 44: net_set: not found
/etc/rc.d/init.d/leds: line 16: led-player: not found
/etc/rc.d/init.d/httpd: line 16: /sbin/boa: not found
Start Qtopia-2.2.0

Please press Enter to activate this console.
[root@EmbedSky /]# ts_calibrate
ts_open: No such file or directory
[root@EmbedSky /]# usb 1-1: new low speed USB device using s3c2410-ohci and address 2
usb 1-1: configuration #1 chosen from 1 choice
input: USB Optical Mouse as /class/input/input1
generic-usb 0003:0461:4D80.0001: input: USB HID v1.11 Mouse [USB Optical Mouse] on usb-s3c24xx-1/input0

[root@EmbedSky /]# cd /sys/devices      
[root@EmbedSky devices]# ls
platform  system
[root@EmbedSky devices]# cd ../
[root@EmbedSky /sys]# cd ../
[root@EmbedSky /]# cat /proc/bus/input/devices
I: Bus=0013 Vendor=dead Product=beef Version=0101
N: Name="TQ2440 TouchScreen"
P: Phys=
S: Sysfs=/class/input/input0
U: Uniq=
H: Handlers=event0
B: EV=b
B: KEY=0
B: ABS=1000003

:'( ;我也一样啊;;求解啊,我都搞了两天了;郁闷啊
 楼主| baifang20 发表于 2012-10-9 13:38:50 | 显示全部楼层
460769013 发表于 2012-10-9 10:45
Start Linux ...
Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00300000 ... Copy Kernel  ...

:'(同病相连。。。解决了记得上来告诉下我哦。。。谢谢吖。。。
亚瑟王 发表于 2012-10-9 14:23:56 | 显示全部楼层
460769013 发表于 2012-10-9 10:45
Start Linux ...
Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00300000 ... Copy Kernel  ...

请给出/etc/profile文件的内容和/bin/qt4(这个脚本名称请以实际为准)的内容。
460769013 发表于 2012-10-9 15:16:34 | 显示全部楼层
亚瑟王 发表于 2012-10-9 14:23
请给出/etc/profile文件的内容和/bin/qt4(这个脚本名称请以实际为准)的内容。

# Ash profile
# vim: syntax=sh

# No core files by default
#ulimit -S -c 0 > /dev/null 2>&1

export set HOME=/root
export set QTDIR=/opt/Qtopia
export set QPEDIR=/opt/Qtopia
export set KDEDIR=/opt/kde
export set QWS_KEYBOARD="TTY:/dev/tty1"
if [ -f /sys/devices/virtual/input/input0/uevent ] ; then
        export set TSLIB_TSDEVICE=/dev/event0
        export set TSLIB_CONFFILE=/etc/ts.conf
        export set TSLIB_PLUGINDIR=/lib/ts
        export set TSLIB_CALIBFILE=/etc/pointercal
        export set QWS_MOUSE_PROTO="TPanel:/dev/event0 USB:/dev/mouse0"
else
        export set QWS_MOUSE_PROTO="USB:/dev/mouse0"
fi
export set PATH=$QPEDIR/bin:$PATH
export set LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib

USER="`id -un`"
LOGNAME=$USER
PS1='[\u@\h \W]# '
PATH=$PATH

HOSTNAME=`/bin/hostname`

export USER LOGNAME PS1 PATH



bin/qtopia内容为
#!/bin/sh

echo Start Qtopia-2.2.0 > /dev/tq2440_serial0

export set HOME=/root
export set QTDIR=/opt/Qtopia
export set QPEDIR=/opt/Qtopia
export set KDEDIR=/opt/kde
export set QWS_KEYBOARD="TTY:/dev/tty1"
if [ -f /sys/devices/virtual/input/input0/uevent ] ; then
        export set TSLIB_TSDEVICE=/dev/event0
        export set TSLIB_CONFFILE=/etc/ts.conf
        export set TSLIB_PLUGINDIR=/lib/ts
        export set TSLIB_CALIBFILE=/etc/pointercal
        export set QWS_MOUSE_PROTO="TPanel:/dev/event0 USB:/dev/mouse0"
else
        export set QWS_MOUSE_PROTO="USB:/dev/mouse0"
        if [ -f /etc/pointercal ] ; then
                echo only use mouse > tq2440_serial0
        else
                echo "1 0 1 0 1 1 65536" >/etc/pointercal
        fi
fi
export set PATH=$QPEDIR/bin:$PATH
export set LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib

if [ -f /etc/pointercal ] ; then
        $QPEDIR/bin/qpe 1>/dev/null 2>/dev/null
else
        ts_calibrate
        $QPEDIR/bin/qpe 1>/dev/null 2>/dev/null
fi

460769013 发表于 2012-10-9 15:18:30 | 显示全部楼层
亚瑟王 发表于 2012-10-9 14:23
请给出/etc/profile文件的内容和/bin/qt4(这个脚本名称请以实际为准)的内容。

串口终端的env如下
[root@EmbedSky /]# env
USER=root
LD_LIBRARY_PATH=/opt/Qtopia/lib:/opt/Qtopia/lib
HOME=/root
QTDIR=/opt/Qtopia
PS1=[\u@\h \W]#
QWS_KEYBOARD=TTY:/dev/tty1
LOGNAME=root
TERM=vt102
PATH=/opt/Qtopia/bin:/sbin:/usr/sbin:/bin:/usr/bin
SHELL=/bin/sh
QPEDIR=/opt/Qtopia
PWD=/
KDEDIR=/opt/kde
QWS_MOUSE_PROTO=USB:/dev/mouse0
亚瑟王 发表于 2012-10-9 19:38:11 | 显示全部楼层
460769013 发表于 2012-10-9 15:18
串口终端的env如下
[root@EmbedSky /]# env
USER=root

根据你的信息,显示环境变量中TSLIB相关的都没有生效哦。
根据你在10楼给出来的信息显示event0就是触摸设备的设备名,那么/sys/devices/virtual/input/input0/uevent就应该存在。但是条件执行语句却判断出来event0不存在,所以确认一下/sys/devices/virtual/input/input1/uevent 文件是否存在吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-11-1 09:10 , Processed in 1.078125 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表