您尚未登录。

楼主 #1 2019-09-16 15:17:55

shiqx429
会员
注册时间: 2019-09-04
已发帖子: 48
积分: 48

nano板子ns2009软件驱动和硬件问题

使用的是荔枝派Nano 跨界核心板,板子的tp芯片是ns2009,  之后我下载了(zero-4.13.y分支:  git clone https://github.com/Lichee-Pi/linux.git -b zero-4.13.y, 将zero板子代码中的ns2009.c拿出来,   添加到nano内核中并且使能, 编译都正常

suniv-f1c100s-licheepi-nano.dts 如下:

&i2c0 {
	status = "okay";

	ns2009: ns2009@48 {
		compatible = "nsiway,ns2009";
		reg = <0x48>;
	};
};

开机log如下:

U-Boot 2018.01-05679-g013ca45 (Sep 11 2019 - 11:53:25 +0800) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM:  32 MiB
MMC:   SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

Setting up a 800x480 lcd console (overscan 0x0)
In:    serial@1c25000
Out:   serial@1c25000
Err:   serial@1c25000
Net:   No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot:  0 
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x4000
SF: 16384 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 80c00000
   Booting using the fdt blob at 0x80c00000
   Loading Device Tree to 80e5f000, end 80e6448f ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.15.0-next-20180202-licheepi-nano+ (steven@ubuntu) (gcc version 7.2.1 2019
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Nano
[    0.000000] Memory policy: Data cache writeback
[    0.000000] random: fast init done
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfs2
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Memory: 23736K/32768K available (5120K kernel code, 206K rwdata, 1240K rodata, 1024K ini)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc2800000 - 0xff800000   ( 976 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (6112 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 207 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 240 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000054] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000122] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000797] Console: colour dummy device 80x30
[    0.000890] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070248] pid_max: default: 32768 minimum: 301
[    0.070727] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070771] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.072347] CPU: Testing write buffer coherency: ok
[    0.074257] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076873] devtmpfs: initialized
[    0.084176] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 191126044627s
[    0.084244] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.084565] pinctrl core: initialized pinctrl subsystem
[    0.086914] NET: Registered protocol family 16
[    0.088807] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.090789] cpuidle: using governor menu
[    0.115754] SCSI subsystem initialized
[    0.116024] pps_core: LinuxPPS API ver. 1 registered
[    0.116051] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.116143] PTP clock support registered
[    0.118079] clocksource: Switched to clocksource timer
[    0.148213] NET: Registered protocol family 2
[    0.149791] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.149862] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.149932] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.149981] TCP: Hash tables configured (established 1024 bind 1024)
[    0.150251] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.150309] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.150886] NET: Registered protocol family 1
[    0.152110] RPC: Registered named UNIX socket transport module.
[    0.152155] RPC: Registered udp transport module.
[    0.152171] RPC: Registered tcp transport module.
[    0.152187] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.154401] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.156465] Initialise system trusted keyrings
[    0.157097] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    0.178480] NFS: Registering the id_resolver key type
[    0.178562] Key type id_resolver registered
[    0.178581] Key type id_legacy registered
[    0.178694] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.193716] Key type asymmetric registered
[    0.193757] Asymmetric key parser 'x509' registered
[    0.194009] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.194043] io scheduler noop registered
[    0.194060] io scheduler deadline registered
[    0.194862] io scheduler cfq registered (default)
[    0.194899] io scheduler mq-deadline registered
[    0.194919] io scheduler kyber registered
[    0.205992] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.395609] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.403059] console [ttyS0] disabled
[    0.423349] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 25, base_baud = 6250000) is a 16550A
[    0.877819] console [ttyS0] enabled
[    0.889839] panel-simple panel: panel supply power not found, using dummy regulator
[    0.899548] SCSI Media Changer driver v0.25 
[    0.907582] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.912437] spi0.0: parsing partitions cmdlinepart
[    0.918381] spi0.0: got parser (null)
[    0.922071] spi0.0: parsing partitions ofpart
[    0.926422] spi0.0: got parser ofpart
[    0.930235] spi0.0: parser ofpart: 4
[    0.933814] 4 ofpart partitions found on MTD device spi0.0
[    0.939356] Creating 4 MTD partitions on "spi0.0":
[    0.944169] 0x000000000000-0x000000100000 : "u-boot"
[    0.951916] 0x000000100000-0x000000110000 : "dtb"
[    0.959530] 0x000000110000-0x000000510000 : "kernel"
[    0.967177] 0x000000510000-0x000001000000 : "rootfs"
[    0.976618] input: 1c23400.lradc as /devices/platform/soc/1c23400.lradc/input/input0
[    0.985567] i2c /dev entries driver
[    0.991986] input: ns2009_ts as /devices/platform/soc/1c27000.i2c/i2c-0/0-0048/input/input1
[    1.030615] sunxi-mmc 1c0f000.mmc: base:0x520166ba irq:21
[    1.038872] NET: Registered protocol family 17
[    1.043565] Key type dns_resolver registered
[    1.050296] Loading compiled-in X.509 certificates
[    1.066162] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc0638e90)
[    1.074194] sun4i-tcon 1c0c000.lcd-controller: Missing LVDS properties, Please upgrade your DT
[    1.082882] sun4i-tcon 1c0c000.lcd-controller: LVDS output disabled
[    1.090158] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc06380a8)
[    1.097823] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.104545] [drm] No driver support for vblank timestamp query.
[    1.311341] Console: switching to colour frame buffer device 100x30
[    1.351010] sun4i-drm display-engine: fb0:  frame buffer device
[    1.358054] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    1.366663] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.384089] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.391906] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.400652] cfg80211: failed to load regulatory.db
[    1.499931] random: crng init done
[    2.941568] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[    2.949507] devtmpfs: mounted
[    2.959233] Freeing unused kernel memory: 1024K
Starting logging: OK
Initializing random number generator... done.
Starting network: OK

其中有如下这log,代表我驱动应该没问题吧?

[    0.985567] i2c /dev entries driver
[    0.991986] input: ns2009_ts as /devices/platform/soc/1c27000.i2c/i2c-0/0-0048/input/input1

之后执行
ts_calibrate

# ts_calibrate 
[   58.088255] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   58.094818] input input1: Poll touch data failed: -110
xres = 800, yres = 480
[   60.248158] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   60.254759] input input1: Poll touch data failed: -110
[   62.408158] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   62.414729] input input1: Poll touch data failed: -110
[   64.568155] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   64.574722] input input1: Poll touch data failed: -110
[   66.728180] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   66.734750] input input1: Poll touch data failed: -110
[   68.888171] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   68.894738] input input1: Poll touch data failed: -110
[   71.048183] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   71.054752] input input1: Poll touch data failed: -110

我有些疑问,  有论坛上的热心朋友说是触控芯片I2C没有上拉电阻, 帖子我都看了,但是看他们log信息,基本上都是v3s板子, 我是nano板子,难道也是这个样子吗?要额外去焊接两个上拉电阻, 我手头上只有3.3k电阻,可行不?
我仔细看过置顶的帖子"荔枝派nano(f1c100s)的SPI-Flash系统编译创建全过程"这个帖子, 是2月份的帖子,里面没有提到上拉电阻的问题,哪位能给我个准确的信息,nano板子到底要不要接上拉电阻,我是偏软件的,焊工不行,担心板子搞坏了,板子太小了

离线

楼主 #2 2019-09-16 16:36:54

shiqx429
会员
注册时间: 2019-09-04
已发帖子: 48
积分: 48

Re: nano板子ns2009软件驱动和硬件问题

离线

#3 2019-09-16 16:57:26

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,348
积分: 9202

Re: nano板子ns2009软件驱动和硬件问题

这个错误一般就是没有接上拉电阻, 3.3k估计也没有问题,请个硬哥帮忙焊一下。





离线

楼主 #4 2019-09-16 16:59:05

shiqx429
会员
注册时间: 2019-09-04
已发帖子: 48
积分: 48

Re: nano板子ns2009软件驱动和硬件问题

https://whycan.cn/files/members/1951/333490307.jpeg
我的板子好像跟上个帖子不太一样, 我的新一点? 尤其是触控芯片那里

离线

楼主 #5 2019-09-16 17:01:11

shiqx429
会员
注册时间: 2019-09-04
已发帖子: 48
积分: 48

Re: nano板子ns2009软件驱动和硬件问题

感谢!!!! 我试试自己弄吧

E11(E12) 飞线出来至 电阻一端, 之后电阻另一端接板子上的地,  对吧??


晕哥 说:

这个错误一般就是没有接上拉电阻, 3.3k估计也没有问题,请个硬哥帮忙焊一下。

离线

#6 2019-09-16 17:08:19

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,348
积分: 9202

Re: nano板子ns2009软件驱动和硬件问题

一端接I2C,一端接3v3





离线

楼主 #7 2019-09-16 19:01:20

shiqx429
会员
注册时间: 2019-09-04
已发帖子: 48
积分: 48

Re: nano板子ns2009软件驱动和硬件问题

谢谢,可以了,就是加上拉电阻!

离线

#8 2019-09-16 19:17:03

我思故我在
会员
注册时间: 2019-09-03
已发帖子: 244
积分: 243.5

Re: nano板子ns2009软件驱动和硬件问题

那个 ns2009 的驱动没有用中断, 而是驱动不停轮询, 机制不太好.

离线

楼主 #9 2019-09-16 19:35:32

shiqx429
会员
注册时间: 2019-09-04
已发帖子: 48
积分: 48

Re: nano板子ns2009软件驱动和硬件问题

啊,这样, 那应该用哪个? 还是自己想办法去改?

我思故我在 说:

那个 ns2009 的驱动没有用中断, 而是驱动不停轮询, 机制不太好.

离线

#10 2019-09-16 19:37:59

我思故我在
会员
注册时间: 2019-09-03
已发帖子: 244
积分: 243.5

Re: nano板子ns2009软件驱动和硬件问题

没事, 可以用, 只是有点浪费CPU而已.

你可以接一个中断脚, 然后驱动实现中断优化一下, 当然,不改也是一样的用.

离线

楼主 #11 2019-09-16 19:46:31

shiqx429
会员
注册时间: 2019-09-04
已发帖子: 48
积分: 48

Re: nano板子ns2009软件驱动和硬件问题

好的,谢谢提醒!

我思故我在 说:

没事, 可以用, 只是有点浪费CPU而已.

你可以接一个中断脚, 然后驱动实现中断优化一下, 当然,不改也是一样的用.

离线

#12 2019-09-16 19:50:33

达克罗德
会员
注册时间: 2018-04-10
已发帖子: 1,138
积分: 1090.5

Re: nano板子ns2009软件驱动和硬件问题

f1c100s不是自带电阻触摸吗?

离线

#13 2019-09-16 20:02:09

我思故我在
会员
注册时间: 2019-09-03
已发帖子: 244
积分: 243.5

Re: nano板子ns2009软件驱动和硬件问题

达克罗德 说:

f1c100s不是自带电阻触摸吗?

占了四个 IO 口, 不爽 ;(

用 ns2009 就不用占 io了

最近编辑记录 我思故我在 (2019-09-16 20:02:29)

离线

#14 2019-10-28 08:34:50

歌以咏志
会员
注册时间: 2019-09-21
已发帖子: 219
积分: 210

Re: nano板子ns2009软件驱动和硬件问题

ns2009 得把中断加上,又多占了一个中断口。

离线

#15 2019-10-28 10:45:43

mango
会员
所在地: 芒果派1
注册时间: 2017-12-02
已发帖子: 780
积分: 726

Re: nano板子ns2009软件驱动和硬件问题

在我看来,iic总线板子上忘加上拉电阻这种问题不该犯






歪朵拉开源硬件: https://widora.cn
淘宝:  https://widora.taobao.com/

离线

#16 2019-11-22 10:27:54

cris8259
会员
注册时间: 2019-09-25
已发帖子: 273
积分: 77

Re: nano板子ns2009软件驱动和硬件问题

IO口不能芯片内部上拉吗

离线

#17 2022-10-14 15:19:05

笔走天下
会员
注册时间: 2021-08-13
已发帖子: 126
积分: 0.5

Re: nano板子ns2009软件驱动和硬件问题

达克罗德 说:

f1c100s不是自带电阻触摸吗?

IO资源很紧张,只能花钱省IO

离线

#18 2022-10-28 13:32:47

Chin
会员
注册时间: 2020-10-19
已发帖子: 61
积分: 39

Re: nano板子ns2009软件驱动和硬件问题

需要上拉电阻

离线

页脚

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

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