您尚未登录。

楼主 # 2021-10-15 00:19:39

Cs6610402
会员
注册时间: 2021-10-14
已发帖子: 10
积分: 0

大佬求救~全志V3S 荔枝派ZERO BSP 内核如何使用触摸屏

现小弟有一块FT5316电容屏 使用的是荔枝派ZERO BSP内核
主要系统配置如下:

1,sys_config.fex

;----------------------------------------------------------------------------------
;capacitor tp configuration
;ctp_twi_id : twi controller ID
;ctp_twi_addr : I2C slave address, 7bit
;ctp_screen_max_x/_y : resolution of touch panel
;ctp_revert_x/_y_flag : whether need to revert x/y
;ctp_exchange_x_y_flag: whether need to exchange the value of x and y
;ctp_int_port : port for tp's interrupt signal
;ctp_wakeup : port for wakeup tp
;----------------------------------------------------------------------------------
[ctp_para]
ctp_used            = 1
ctp_name            = "ft5x_ts"
ctp_twi_id          = 0
ctp_twi_addr        = 0x38
ctp_screen_max_x    = 800
ctp_screen_max_y    = 480
ctp_revert_x_flag   = 0
ctp_revert_y_flag   = 0
ctp_exchange_x_y_flag = 1

ctp_int_port        = port:PG04<6><default><default><default>
ctp_wakeup          = port:PG03<1><default><default><1>

2,内核编译选项:

 CONFIG_TOUCHSCREEN_FT5X_TS:                                             │  
  │                                                                         │  
  │ ft5x touchscreen driver                                                 │  
  │                                                                         │  
  │ Symbol: TOUCHSCREEN_FT5X_TS [=y]                                        │  
  │ Type  : tristate                                                        │  
  │ Prompt: ft5x touchscreen driver                                         │  
  │   Defined at drivers/input/touchscreen/ft5x/Kconfig:5                   │  
  │   Depends on: !S390 && !UML && INPUT_TOUCHSCREEN [=y] && INPUT [=y]\    │  
  │  && I2C [=y]                                                            │  
  │   Location:                                                             │  
  │     -> Device Drivers                                                   │  
  │       -> Input device support                                           │  
  │         -> Generic input layer (needed for keyboard, mouse, ...) (INPUT │  
  │           -> Touchscreens (INPUT_TOUCHSCREEN [=y])                      │  
  │                                                     

配置过后能识别FT5316芯片

 ***CTP******************************init begin*************************************
[    1.361434] =====ctp_fetch_sysconfig_para=====.
[    1.366681] ctp_fetch_sysconfig_para: ctp_power_ldo script_get_item err.
[    1.374446] ctp_fetch_sysconfig_para: ctp_power_ldo_vol script_get_item err.
[    1.382491] ctp_fetch_sysconfig_para: ctp_power_io script_get_item err.
[    1.390157] ctp_irq gpio number is 196
[    1.394431] wakeup gpio_request is failed
[    1.399088] ft5x_ts_init:ctp_ops.init_platform_resource err.
[    1.399097] ***CTP***info.ctp_used:1
[    1.399103] ***CTP***info.twi_id:0
[    1.399109] ***CTP***info.screen_max_x:800
[    1.399115] ***CTP***info.screen_max_y:480
[    1.399121] ***CTP***info.revert_x_flag:0
[    1.399127] ***CTP***info.revert_y_flag:0
[    1.399133] ***CTP***info.exchange_x_y_flag:1
[    1.399139] ***CTP***info.irq_gpio_number:196
[    1.399145] ***CTP***info.wakeup_gpio_number:195
[    1.399154] ***CTP******CTP*** ctp_wakeup:status:0,ms = 10
[    1.400673] [mmc]: sdc0 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.404182] [mmc]: sdc0 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
[    1.404272] [mmc]: sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
[    1.404382] [mmc]: sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B
[    1.404467] mmc0: new high speed SDHC card at address aaaa
[    1.411123] mmcblk0: mmc0:aaaa SD32G 29.7 GiB
[    1.417902]  mmcblk0: p1 p2
[    1.421990] mmcblk mmc0:aaaa: Card claimed for testing.
[    1.427915] mmc0:aaaa: SD32G 29.7 GiB
[    1.432458] i2c-core: driver [ft5x_ts] using legacy suspend method
[    1.439430] i2c-core: driver [ft5x_ts] using legacy resume method
[    1.446549] platform reg-20-cs-dcdc2: Driver reg-20-cs-dcdc2 requests probe deferral
[    1.455308] *******************sd init ok*******************
[    1.461888] platform reg-20-cs-dcdc3: Driver reg-20-cs-dcdc3 requests probe deferral
[    1.470922] platform reg-20-cs-ldo1: Driver reg-20-cs-ldo1 requests probe deferral
[    1.479487] ***CTP***addr:0x38,chip_id_value:0x0
[    1.479641] ***CTP***====ft5x_ts_probe begin=====.
[    1.479821] ***CTP***====ft5x_init_events begin=====.
[    1.480922] ***CTP***==ft5x_ts_probe over =
[    1.480979] ***CTP*******************************init end************************************
[    1.481034] sunxi-rtc sunxi-rtc: setting system clock to 1970-01-01 00:07:22 UTC (442)
[    1.490318] platform reg-20-cs-ldo2: Driver reg-20-cs-ldo2 requests probe deferral
[    1.498988] ***CTP***addr:0x38,chip_id_value:0x0
[    1.500426] ALSA device list:
[    1.503851]   #0: audiocodec
[    1.507500] platform reg-20-cs-ldo3: Driver reg-20-cs-ldo3 requests probe deferral
[    1.516475] ***CTP***addr:0x38,chip_id_value:0x0
[    1.517087] platform reg-20-cs-ldo4: Driver reg-20-cs-ldo4 requests probe deferral
[    1.525891] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    1.535281] platform reg-20-cs-ldoio0: Driver reg-20-cs-ldoio0 requests probe deferral
[    1.544343] ***CTP***addr:0x38,chip_id_value:0x0
[    1.544767] platform reg-20-cs-ldo1: Driver reg-20-cs-ldo1 requests probe deferral
[    1.553531] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[    1.562904] platform reg-20-cs-dcdc3: Driver reg-20-cs-dcdc3 requests probe deferral
[    1.571764] ***CTP***addr:0x38,chip_id_value:0x0
[    1.572143] platform reg-20-cs-dcdc2: Driver reg-20-cs-dcdc2 requests probe deferral
[    1.590376] ***CTP***addr:0x38,chip_id_value:0x0
[    1.600342] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.609515] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.616687] ***CTP***addr:0x38,chip_id_value:0x0
[    1.618908] devtmpfs: mounted
[    1.622711] Freeing init memory: 140K
[    1.630296] ***CTP***addr:0x38,chip_id_value:0x0
[    1.650311] ***CTP***addr:0x38,chip_id_value:0x0
[    1.670320] ***CTP***addr:0x38,chip_id_value:0x0
[    1.690312] ***CTP***addr:0x38,chip_id_value:0x0
[    1.710277] ***CTP***addr:0x38,chip_id_value:0x0
[    1.730329] ***CTP***addr:0x38,chip_id_value:0x0
[    1.730346] ***CTP***read chip_id timers,timers=12
[    1.730355] fts_ctpm_fw_upgrade_with_i_file.
[    1.739529] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
[    1.840480] =========buf[0] = 0x0
[    1.840495] =========buf[1] = 0x0
[    1.840502] a == 0,  b== 34
[    1.900249] Step 1: Reset CTPM test
[    1.940226] Step 2: Enter update mode.
[    1.960229] Step 2: Enter update mode.
[    1.980226] Step 2: Enter update mode.
[    2.000237] Step 2: Enter update mode.
[    2.020230] Step 2: Enter update mode.
[    2.060461] Step 3: CTPM ID,ID1 = 0x79,ID2 = 0x7
[    2.196175] gmac0: probed
[    2.199384] platform reg-20-cs-dcdc2: Driver reg-20-cs-dcdc2 requests probe deferral
[    2.208631] gmac0 gmac0: eth0: eth0: PHY ID 00441400 at 0 IRQ poll (gmac0-0:00)
[    2.217125] platform reg-20-cs-dcdc3: Driver reg-20-cs-dcdc3 requests probe deferral
[    2.236906] platform reg-20-cs-ldo1: Driver reg-20-cs-ldo1 requests probe deferral
[    2.245842] platform reg-20-cs-ldoio0: Driver reg-20-cs-ldoio0 requests probe deferral
[    2.260714] platform reg-20-cs-ldo4: Driver reg-20-cs-ldo4 requests probe deferral
[    2.269333] platform reg-20-cs-ldo3: Driver reg-20-cs-ldo3 requests probe deferral
[    2.282868] platform reg-20-cs-ldo2: Driver reg-20-cs-ldo2 requests probe deferral
[    4.180019] Step 4: erase.
[    4.180038] Step 5: start upgrade.
[    4.220029] upgrade the 0x0 th byte.
[    4.540020] upgrade the 0x400 th byte.
[    4.860018] upgrade the 0x800 th byte.
[    5.180028] upgrade the 0xc00 th byte.
[    5.500023] upgrade the 0x1000 th byte.
[    5.820019] upgrade the 0x1400 th byte.
[    6.140018] upgrade the 0x1800 th byte.
[    6.200157] PHY: gmac0-0:00 - Link is Up - 100/Full
[    6.460019] upgrade the 0x1c00 th byte.
[    6.780018] upgrade the 0x2000 th byte.
[    7.100031] upgrade the 0x2400 th byte.
[    7.420023] upgrade the 0x2800 th byte.
[    7.740019] upgrade the 0x2c00 th byte.
[    8.060018] upgrade the 0x3000 th byte.
[    8.200145] PHY: gmac0-0:00 - Link is Down
[    8.380030] upgrade the 0x3400 th byte.
[    8.700019] upgrade the 0x3800 th byte.
[    9.020019] upgrade the 0x3c00 th byte.
[    9.200153] PHY: gmac0-0:00 - Link is Up - 100/Full
[    9.340022] upgrade the 0x4000 th byte.
[    9.660019] upgrade the 0x4400 th byte.
[    9.980018] upgrade the 0x4800 th byte.
[   10.300022] upgrade the 0x4c00 th byte.
[   10.620017] upgrade the 0x5000 th byte.
[   10.940018] upgrade the 0x5400 th byte.
[   11.260022] upgrade the 0x5800 th byte.
[   11.580047] upgrade the 0x5c00 th byte.
[   11.900037] upgrade the 0x6000 th byte.
[   12.220023] upgrade the 0x6400 th byte.
[   12.590364] Step 6:  ecc read 0xcb, new firmware 0xcb.
[   12.900042] [FTS] upgrade successfully.

---------------------------------------------------------
-------但是触摸没有反应,经测量没有中断信号!!!!
-----------------------------------

离线

楼主 #1 2021-10-15 00:22:16

Cs6610402
会员
注册时间: 2021-10-14
已发帖子: 10
积分: 0

Re: 大佬求救~全志V3S 荔枝派ZERO BSP 内核如何使用触摸屏

强制短接线,将EINT管脚拉低,内核进入FT5X中断,但是读不到触摸信息

[   21.107780] ***CTP***==========ft5x_ts TS Interrupt============
[   21.108808] ***CTP***touch point = 0
[   21.108825] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.132772] ***CTP***==========ft5x_ts TS Interrupt============
[   21.133551] ***CTP***==========ft5x_ts TS Interrupt============
[   21.133805] ***CTP***touch point = 0
[   21.133819] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.133949] ***CTP***==========ft5x_ts TS Interrupt============
[   21.134161] ***CTP***==========ft5x_ts TS Interrupt============
[   21.134809] ***CTP***touch point = 0
[   21.134817] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.135017] ***CTP***==========ft5x_ts TS Interrupt============
[   21.135791] ***CTP***touch point = 0
[   21.135798] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.135973] ***CTP***==========ft5x_ts TS Interrupt============
[   21.136780] ***CTP***touch point = 0
[   21.136787] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.137767] ***CTP***touch point = 0
[   21.137774] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.159013] ***CTP***==========ft5x_ts TS Interrupt============
[   21.159221] ***CTP***==========ft5x_ts TS Interrupt============
[   21.160263] ***CTP***touch point = 0
[   21.160281] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.161272] ***CTP***touch point = 0
[   21.161281] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.162057] ***CTP***==========ft5x_ts TS Interrupt============
[   21.163049] ***CTP***touch point = 0
[   21.163058] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.163946] ***CTP***==========ft5x_ts TS Interrupt============
[   21.164928] ***CTP***touch point = 0
[   21.164936] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.166723] ***CTP***==========ft5x_ts TS Interrupt============
[   21.167735] ***CTP***touch point = 0
[   21.167743] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.167853] ***CTP***==========ft5x_ts TS Interrupt============
[   21.168839] ***CTP***touch point = 0
[   21.168846] ***CTP***ft5x_ts_pen_irq_work:ret:1
[   21.318312] ***CTP***==========ft5x_ts TS Interrupt============
[   21.319318] ***CTP***touch point = 0
[   21.319332] ***CTP***ft5x_ts_pen_irq_work:ret:1

求教大佬,在荔枝派ZERO  BSP 内核中如何使用触摸屏啊,GT911和FT5X都可以的,望赐教!!

离线

#2 2021-10-15 09:45:11

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 大佬求救~全志V3S 荔枝派ZERO BSP 内核如何使用触摸屏

说明中断正常,看起来 i2c 通讯有问题,fex你先不配ft5x,用 i2ctools的 i2cdetect 看能否检测到0x38地址有反应?





离线

楼主 #3 2021-10-15 09:51:28

Cs6610402
会员
注册时间: 2021-10-14
已发帖子: 10
积分: 0

Re: 大佬求救~全志V3S 荔枝派ZERO BSP 内核如何使用触摸屏

哇酷小二 说:

说明中断正常,看起来 i2c 通讯有问题,fex你先不配ft5x,用 i2ctools的 i2cdetect 看能否检测到0x38地址有反应?

感谢大佬指点,ft5x_probe 里面是有反应的,如果不挂iic或者iic通信错误 这个函数直接就报错了~
刚刚我的中断是我手动触发的,不是触摸屏触发的
我测试了一下触摸屏似乎不产生中断

离线

楼主 #4 2021-10-15 22:51:49

Cs6610402
会员
注册时间: 2021-10-14
已发帖子: 10
积分: 0

Re: 大佬求救~全志V3S 荔枝派ZERO BSP 内核如何使用触摸屏

# i2cdump -f -y 0 0x38
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................


读出来  全是0

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn