TI中文支持网
TI专业的中文技术问题搜集分享网站

AM335X 配置GPIO防抖异常

目前使用AM335X平台做GPIO相关控制,部分GPIO做输入功能,配置了AM335X的debounce功能,概率出现Unhandled fault: external abort on non-linefetch异常,启动打印如下:

BIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "data"
UBIFS: file system size: 148815872 bytes (145328 KiB, 141 MiB, 1172 LEBs)
UBIFS: journal size: 7491584 bytes (7316 KiB, 7 MiB, 59 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 4952683 bytes (4836 KiB)
system start init
wellcom to sysbox init
root@unix:/$ Disabling lock debugging due to kernel taint
Create memory pool(size:524288) OK!
Unhandled fault: external abort on non-linefetch (0x1028) at 0xf9e07150
Internal error: : 1028 [#1]
Modules linked in: product(O+) hwdriver(O) syslink(O)
CPU: 0 Tainted: G O (3.2.0 #100)
PC is at gpio_debounce+0x7c/0x114
LR is at gpio_debounce+0x50/0x114
pc : [<c01cc3dc>] lr : [<c01cc3b0>] psr: 20000093
sp : c0a17db8 ip : c0a17de8 fp : c0a17de4
r10: bf016000 r9 : c0069e40 r8 : 00000001
r7 : f9e07000 r6 : 00000150 r5 : a0000013 r4 : cf004434
r3 : cf04f2c0 r2 : 00000154 r1 : 00002000 r0 : c1093f24
Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: 80a34019 DAC: 00000015
Process insmod (pid: 1105, stack limit = 0xc0a162f0)
Stack: (0xc0a17db8 to 0xc0a18000)
7da0: c0a17de4 c0a17dc8
7dc0: c01cbfec 0000000d 60000013 cf004434 00000000 00002710 c0a17e14 c0a17de8
7de0: c01ca1c0 c01cc36c 10624dd3 00000000 0000000d 0000000d bf00bf28 00000000
7e00: bf00bf10 c09ee7c0 c0a17e2c c0a17e18 bf00b238 c01ca110 cf003a00 00000000
7e20: c0a17e54 c0a17e30 bf00b340 bf00b210 00000031 bf00bf10 00000001 00000001
7e40: c0a16000 0000001c c0a17e74 c0a17e58 bf009134 bf00b274 00000031 00000000
7e60: bf01418c c10dd640 c0a17e8c c0a17e78 bf00919c bf009118 bf014058 bf014058
7e80: c0a17e9c c0a17e90 bf016074 bf009178 c0a17ef4 c0a17ea0 c0008a18 bf01600c
7ea0: c0a17ec4 c0a17eb0 00000002 00000000 ce7cf300 d09fc000 c0a17ee4 c0a17ec8
7ec0: bf014058 bf014058 c0810180 bf014058 bf014058 c0810180 00000001 0000001c
7ee0: c0069e40 0000013c c0a17fa4 c0a17ef8 c006b2d8 c00088fc bf014064 00000000
7f00: 00000000 c0069f40 d09fc460 d09fc980 00000000 bf0140a0 c00be770 c04f448c
7f20: 00000000 00000000 00000000 00000000 00000000 00000000 d09fc000 00000e44
7f40: d09fc6b0 d09fc5f1 d09fcd08 c0810280 0000028c 000002cc 00000000 00000000
7f60: 00000011 00000012 00000009 00000007 00000005 00000000 c0a17fa4 00000000
7f80: beb67e24 00000069 00000080 c0014ba8 c0a16000 00000000 00000000 c0a17fa8
7fa0: c0014a00 c006af00 00000000 beb67e24 00145900 00000e44 00134d9a 00000000
7fc0: 00000000 beb67e24 00000069 00000080 beb67e28 beb67e28 00000000 00000000
7fe0: 00000000 beb67ab8 000285c9 0000afb0 60000010 00145900 8fffe821 8fffec21
Backtrace:[<c01cc360>] (gpio_debounce+0x0/0x114) from [<c01ca1c0>] (gpio_set_debounce+0xbc/0xf0)
r8:00002710 r7:00000000 r6:cf004434 r5:60000013 r4:0000000d
[<c01ca104>] (gpio_set_debounce+0x0/0xf0) from [<bf00b238>] (PI_setInPut.isra.3.constprop.4+0x34/0x64 [hwdriver])
r8:c09ee7c0 r7:bf00bf10 r6:00000000 r5:bf00bf28 r4:0000000d
[<bf00b204>] (PI_setInPut.isra.3.constprop.4+0x0/0x64 [hwdriver]) from [<bf00b340>] (PI_regiest+0xd8/0x170 [hwdriver])
r4:00000000 r3:cf003a00
[<bf00b268>] (PI_regiest+0x0/0x170 [hwdriver]) from [<bf009134>] (hw_driver_add_pi+0x28/0x60 [hwdriver])
r8:0000001c r7:c0a16000 r6:00000001 r5:00000001 r4:bf00bf10
r3:00000031
[<bf00910c>] (hw_driver_add_pi+0x0/0x60 [hwdriver]) from [<bf00919c>] (HW_A0001_hwdriver_init+0x30/0x58 [hwdriver])
r6:c10dd640 r5:bf01418c r4:00000000 r3:00000031
[<bf00916c>] (HW_A0001_hwdriver_init+0x0/0x58 [hwdriver]) from [<bf016074>] (init_module+0x74/0x94 [product])
r5:bf014058 r4:bf014058
[<bf016000>] (init_module+0x0/0x94 [product]) from [<c0008a18>] (do_one_initcall+0x128/0x1a8)
[<c00088f0>] (do_one_initcall+0x0/0x1a8) from [<c006b2d8>] (sys_init_module+0x3e4/0x1b68)
[<c006aef4>] (sys_init_module+0x0/0x1b68) from [<c0014a00>] (ret_fast_syscall+0x0/0x30)
Code: e594306c e5147030 e594004c e1d361b8 (e7973006)—[ end trace a99c53d11fc19f9d ]—

root@unix:/$ Segmentation fault

发现并不是毕现,而是概率出现,某几次重启板子后会出现该问题。

查了相关手册,本来怀疑是没有配置相关时钟,但是看了clock33XX_data.c里面,struct omap_clk am33xx_clks[]已经配置了gpio的dbclk时钟,

请协助定位一下。

Eggsy Pang:

用的哪一个版本的SDK?在上面文件修改了哪部分代码呢?

wuqiong le1:

回复 Eggsy Pang:

内核版本为linux-3.2.0-release-v1.2-lite-nand-2016-10-20

没有修改相关内核代码,只是自己编写驱动,gpio输入状态读取,调用gpio_set_debounce接口配置10ms防抖,就偶尔出现那个异常。

weifeng liang:

回复 wuqiong le1:

您好,

请问您的问题现在解决了吗?

赞(0)
未经允许不得转载:TI中文支持网 » AM335X 配置GPIO防抖异常
分享到: 更多 (0)