Firefly开源社区

打印 上一主题 下一主题

分享一个在linux app层调用/dev/mem来控制WORK_LED的方法

91

积分

0

威望

0

贡献

技术小白

积分
91
发表于 2016-11-21 11:04:35      楼主
busybee 发表于 2015-5-13 17:57
Android 下也有个类似命令 /system/xbin/io,  源码在 external/io 里。

用io写寄存器时会出现panic, 是存在这样的问题吗

[ 1229.428037] Unhandled fault: imprecise external abort (0x1c06) at 0xb6f12000
[ 1229.428152] Internal error: : 1c06 [#1] PREEMPT SMP ARM
[ 1229.440116] Modules linked in: mali_kbase
[ 1229.444054] CPU: 3 PID: 1345 Comm: io Not tainted 3.10.0 #139
[ 1229.449675] task: dc353f00 ti: dbb54000 task.ti: dbb54000
[ 1229.454975] PC is at klist_remove_lock+0x3f1364d0/0x4
[ 1229.459902] LR is at 0xb6f91de0
[ 1229.462984] pc : [<ffff0008>]    lr : [<b6f91de0>]    psr: 60070093
[ 1229.462984] sp : dbb55ff8  ip : 00000000  fp : b6fd3f98
[ 1229.474229] r10: 00001000  r9 : 00000000  r8 : b6f12000
[ 1229.479348] r7 : 00000006  r6 : b6f12001  r5 : 00000002  r4 : b6f12001
[ 1229.485743] r3 : 00000001  r2 : 00000002  r1 : b6f12000  r0 : 00000003
[ 1229.492145] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1229.499220] Control: 10c5387d  Table: 1bb6006a  DAC: 00000015
[ 1229.504842]
[ 1229.504842] PC: 0xfffeff88:
[ 1229.509017] ff88  ******** ******** ******** ******** ******** ******** ******** ********
[ 1229.517034] ffa8  ******** ******** ******** ******** ******** ******** ******** ********
[ 1229.525050] ffc8  ******** ******** ******** ******** ******** ******** ******** ********
[ 1229.533066] ffe8  ******** ******** ******** ******** ******** ******** ea0003ff ea000465
[ 1229.541082] 0008  e59ffff0 ea000443 ea000422 ea000481 ea000400 ea000480 e7fddef1 e7fddef1
[ 1229.549099] 0028  e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1
[ 1229.557115] 0048  e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1
[ 1229.565131] 0068  e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1 e7fddef1
[ 1229.573151]
[ 1229.573151] SP: 0xdbb55f78:
[ 1229.577326] 5f78  00000001 dbb54000 00000000 c00ee8a0 00000001 000ff7f0 00000003 000ff7f0
[ 1229.585343] 5f98  00000001 ffff0008 60070093 ffffffff dbb55fe4 c000d598 00000003 b6f12000
[ 1229.593359] 5fb8  00000002 00000001 b6f12001 00000002 b6f12001 00000006 b6f12000 00000000
[ 1229.601375] 5fd8  00001000 b6fd3f98 00000000 dbb55ff8 b6f91de0 ffff0008 60070093 ffffffff
[ 1229.609392] 5ff8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1229.617408] 6018  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1229.625424] 6038  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1229.633441] 6058  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1229.641467] Process io (pid: 1345, stack limit = 0xdbb54238)
[ 1229.647008] Stack: (0xdbb55ff8 to 0xdbb56000)
[ 1229.651275] 5fe0:                                                       00000000 00000000
[ 1229.659292] Code: bad PC value
[ 1229.662276] ---[ end trace 0a7cc0b8a18886f2 ]---
[ 1229.666792] Kernel panic - not syncing: Fatal exception
[ 1229.671921] CPU0: stopping
[ 1229.674565] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D      3.10.0 #139
[ 1229.681508] [<c0013ec4>] (unwind_backtrace+0x0/0xe0) from [<c001176c>] (show_stack+0x10/0x14)
[ 1229.689854] [<c001176c>] (show_stack+0x10/0x14) from [<c0012f9c>] (handle_IPI+0x154/0x2c8)
[ 1229.697952] [<c0012f9c>] (handle_IPI+0x154/0x2c8) from [<c0008558>] (gic_handle_irq+0x54/0x5c)
[ 1229.706395] [<c0008558>] (gic_handle_irq+0x54/0x5c) from [<c000d600>] (__irq_svc+0x40/0x70)
[ 1229.714559] Exception stack(0xc0c07f08 to 0xc0c07f50)
[ 1229.719519] 7f00:                   c0c07f50 000004e0 e0a576b5 00000122 c1f162e0 00000000
[ 1229.727537] 7f20: e0a5015b 00000122 c0c18fd8 c0c06000 c0c18fe8 00000000 35c09c4f c0c07f50
[ 1229.735544] 7f40: c0079850 c05b4e58 600f0013 ffffffff
[ 1229.740520] [<c000d600>] (__irq_svc+0x40/0x70) from [<c05b4e58>] (cpuidle_enter_state+0x54/0xec)
[ 1229.749131] [<c05b4e58>] (cpuidle_enter_state+0x54/0xec) from [<c05b505c>] (cpuidle_idle_call+0x16c/0x27c)
[ 1229.758592] [<c05b505c>] (cpuidle_idle_call+0x16c/0x27c) from [<c000e750>] (arch_cpu_idle+0x8/0x38)
[ 1229.767461] [<c000e750>] (arch_cpu_idle+0x8/0x38) from [<c0078c14>] (cpu_idle_loop+0x1b8/0x224)
[ 1229.775985] [<c0078c14>] (cpu_idle_loop+0x1b8/0x224) from [<c0078c8c>] (freezing_slow_path+0x0/0x80)
[ 1229.784932] [<c0078c8c>] (freezing_slow_path+0x0/0x80) from [<ffffffff>] (0xffffffff)
[ 1229.792593] CPU2: stopping
[ 1229.795245] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D      3.10.0 #139
[ 1229.802180] [<c0013ec4>] (unwind_backtrace+0x0/0xe0) from [<c001176c>] (show_stack+0x10/0x14)
[ 1229.810524] [<c001176c>] (show_stack+0x10/0x14) from [<c0012f9c>] (handle_IPI+0x154/0x2c8)
[ 1229.818622] [<c0012f9c>] (handle_IPI+0x154/0x2c8) from [<c0008558>] (gic_handle_irq+0x54/0x5c)
[ 1229.827065] [<c0008558>] (gic_handle_irq+0x54/0x5c) from [<c000d600>] (__irq_svc+0x40/0x70)
[ 1229.835231] Exception stack(0xde8bff30 to 0xde8bff78)
[ 1229.840185] ff20:                                     de8bff78 000004e0 e0a576b5 00000122
[ 1229.848208] ff40: c1f282e0 00000000 e0189fb2 00000122 c0c18fd8 de8be000 c0c18fe8 00000000
[ 1229.856219] ff60: 35c09c4f de8bff78 c0079850 c05b4e58 600f0013 ffffffff
[ 1229.862722] [<c000d600>] (__irq_svc+0x40/0x70) from [<c05b4e58>] (cpuidle_enter_state+0x54/0xec)
[ 1229.871335] [<c05b4e58>] (cpuidle_enter_state+0x54/0xec) from [<c05b505c>] (cpuidle_idle_call+0x16c/0x27c)
[ 1229.880798] [<c05b505c>] (cpuidle_idle_call+0x16c/0x27c) from [<c000e750>] (arch_cpu_idle+0x8/0x38)
[ 1229.889664] [<c000e750>] (arch_cpu_idle+0x8/0x38) from [<c0078c14>] (cpu_idle_loop+0x1b8/0x224)
[ 1229.898189] [<c0078c14>] (cpu_idle_loop+0x1b8/0x224) from [<c0078c8c>] (freezing_slow_path+0x0/0x80)
[ 1229.907125] CPU1: stopping
[ 1229.909776] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D      3.10.0 #139
[ 1229.916710] [<c0013ec4>] (unwind_backtrace+0x0/0xe0) from [<c001176c>] (show_stack+0x10/0x14)
[ 1229.925053] [<c001176c>] (show_stack+0x10/0x14) from [<c0012f9c>] (handle_IPI+0x154/0x2c8)
[ 1229.933153] [<c0012f9c>] (handle_IPI+0x154/0x2c8) from [<c0008558>] (gic_handle_irq+0x54/0x5c)
[ 1229.941595] [<c0008558>] (gic_handle_irq+0x54/0x5c) from [<c000d600>] (__irq_svc+0x40/0x70)
[ 1229.949761] Exception stack(0xde8bdf30 to 0xde8bdf78)                                                               
[ 1229.954716] df20:                                     de8bdf78 000004e0 e0a578fc 00000122                           
[ 1229.962739] df40: c1f1f2e0 00000000 dfa4fcab 00000122 c0c18fd8 de8bc000 c0c18fe8 00000000                           
[ 1229.970751] df60: 35c09c4f de8bdf78 c0079850 c05b4e58 600f0013 ffffffff                                             
[ 1229.977252] [<c000d600>] (__irq_svc+0x40/0x70) from [<c05b4e58>] (cpuidle_enter_state+0x54/0xec)
[ 1229.985866] [<c05b4e58>] (cpuidle_enter_state+0x54/0xec) from [<c05b505c>] (cpuidle_idle_call+0x16c/0x27c)
[ 1229.995328] [<c05b505c>] (cpuidle_idle_call+0x16c/0x27c) from [<c000e750>] (arch_cpu_idle+0x8/0x38)
[ 1230.004195] [<c000e750>] (arch_cpu_idle+0x8/0x38) from [<c0078c14>] (cpu_idle_loop+0x1b8/0x224)
[ 1230.012720] [<c0078c14>] (cpu_idle_loop+0x1b8/0x224) from [<c0078c8c>] (freezing_slow_path+0x0/0x80)
[ 1230.021652] CRU:
[ 1230.023469] 00000000: 00000007 9fff0047 0fff0024 00000008 00000001 9fff0025 0fff0012 00000008
[ 1230.031820] 00000020: 00000007 9fff00c5 00000000 00000008 00000007 9fff00c5 0fff0014 00000008
[ 1230.040177] 00000040: 00000b00 9fff0270 0fff0138 00000008 00005111 00000000 00000000 00000000
[ 1230.048534] 00000060: 00004031 0000b108 00000003 00000200 00008100 00008100 00008585 00010014
[ 1230.056891] 00000080: 01885091 01885091 0000a101 00002745 00004345 00008a00 00000200 00000200
[ 1230.065250] 000000a0: 00000200 0bb8ea60 00010014 00010014 00010014 00000910 00000900 001f05dc
[ 1230.073606] 000000c0: 00001703 0000078c 00000040 00000301 00000242 00000342 00004141 00004041
[ 1230.081963] 000000e0: 00004141 00000505 00008042 00008f8f 00000000 00000631 00001ee5 00008307
[ 1230.090319] 00000100: 00001200 00010014 00004141 00000000 00000000 00000000 00000000 00000000
[ 1230.098675] 00000120: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.107031] 00000140: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.115392] 00000160: 00001000 0000ff00 00003d60 0000faf0 00004f80 0000aefd 0000fbe0 0000c12b
[ 1230.123749] 00000180: 00000fa4 00000000 0000080d 000005cc 00000000 0000fe84 00000000 0000c01e
[ 1230.132105] 000001a0: 0000017f 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.140462] 000001c0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.148820] 000001e0: 00000000 00000000 00000000 00640064 00000004 00000000 00000002 00000000
[ 1230.157177] 00000200: 00000002 00000000 00000002 00000000 00000002 00000000 00000004 000004e0
[ 1230.165534] 00000220: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.173891] 00000240: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.182248] 00000260: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.190606] 00000280: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.198963] 000002a0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.207321] 000002c0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.215678] 000002e0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.224036] 00000300: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.232393] 00000320: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.240751] 00000340: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.249108] 00000360: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.257465] 00000380: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.265823] 000003a0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.274181] 000003c0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.282538] 000003e0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1230.290899] 00000400: 00000007 9fff0047 0fff0024 00000008 00000001 9fff0025 0fff0012 00000008
[ 1230.299239] Rebooting in 5 seconds..DDR Version 1.00 20150318
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表