打印
[i.MX]

gpio access

[复制链接]
2449|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
isdqwq|  楼主 | 2015-10-20 14:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
为了防止RITA的习惯性问题.
BSP  Android 5.0  kernel 3.10.53  uboot 2014.04   
硬件是  IMX6Q  主板是自己设计的.我想下面要描述的问题应该与硬件无关了.
各位,你们的gpio access是如何做的.
是直接在android app里在访问 sys/class/gpio/gpioxx/value 文件吗?
如果是这样的话,Android 5.0增加了  SELinux 功能.
这个开启的话, android app只能读gpio不能写呢 .
你们又是如何解决的.
我试过修改 SELinux的策略,
在file.te中增加
type gpio_control, fs_type, sysfs_type;
在 file_contexts文件增加下面行
/sys/devices/soc0/soc.1/2000000.aips-bus/20a0000.gpio/gpio/gpio32/value u:object_r:gpio_control:s0
这样增加的话,如果设备没有接u盘或者sdcard,可以正常启动进系统,在debug console下面检查 /sys/class/gpio/gpioxx/value 确实改为了 u:object_r:gpio_control:s0 ,如何检查的? ls -Z
但设备如果插入了sdcard 或者u盘,就引导不进系统了,
报下面的错误.请问各位是如何解决的.
init: Timed out waiting for /dev/.coldboot_done
init: /dev/hw_random not found
Console: switching to colour dummy device 80x30
init: /dev/hw_random not found
fs_mgr: Error opening device mapper (No such file or directory)fs_mgr: Could not set up verified partition, skipping!
EXT4-fs (mmcblk3p4): Ignoring removed nomblk_io_submit option
EXT4-fs (mmcblk3p4): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,noauto_da_alloc,errors=panic
fs_mgr: __mount(source=/dev/block/mmcblk3p4,target=/data,type=ext4)=0
EXT4-fs (mmcblk3p6): Ignoring removed nomblk_io_submit option
EXT4-fs (mmcblk3p6): mounted filesystem with ordered data mode. Opts: nomblk_io_submit
fs_mgr: __mount(source=/dev/block/mmcblk3p6,target=/cache,type=ext4)=0
EXT4-fs (mmcblk3p7): mounted filesystem with ordered data mode. Opts: (null)
fs_mgr: __mount(source=/dev/block/mmcblk3p7,target=/device,type=ext4)=0
init: cannot find '/system/bin/logd', disabling 'logd'
init: cannot find '/system/bin/sh', disabling 'console'
binder: 124:124 transaction failed 29189, size 0-0
init: cannot find '/system/bin/lmkd', disabling 'lmkd'
init: cannot find '/system/bin/servicemanager', disabling 'servicemanager'
init: cannot find '/system/bin/vold', disabling 'vold'
init: cannot find '/system/bin/surfaceflinger', disabling 'surfaceflinger'
init: using deprecated syntax for specifying property 'ro.serialno', use ${name} instead
init: using deprecated syntax for specifying property 'ro.product.manufacturer', use ${name} instead
init: property 'ro.product.manufacturer' doesn't exist while expanding '$ro.product.manufacturer'
init: cannot expand '$ro.product.manufacturer' while writing to '/sys/class/android_usb/android0/iManufacturer'
init: using deprecated syntax for specifying property 'ro.product.model', use ${name} instead
init: property 'ro.product.model' doesn't exist while expanding '$ro.product.model'
init: cannot expand '$ro.product.model' while writing to '/sys/class/android_usb/android0/iProduct'
init: cannot find '/system/bin/netd', disabling 'netd'
init: cannot find '/system/bin/debuggerd', disabling 'debuggerd'
init: cannot find '/system/bin/debuggerd64', disabling 'debuggerd64'
init: cannot find '/system/bin/drmserver', disabling 'drm'
init: cannot find '/system/bin/mediaserver', disabling 'media'
init: cannot find '/system/bin/installd', disabling 'installd'
init: cannot find '/system/bin/install-recovery.sh', disabling 'flash_recovery'
init: cannot find '/system/bin/keystore', disabling 'keystore'
init: cannot find '/system/bin/rild', disabling 'ril-daemon'
init: cannot find '/system/bin/app_process', disabling 'zygote'
init: cannot find '/system/bin/sh', disabling 'wifi_mac'
init: cannot find '/system/bin/sdcard', disabling 'sdcard'
init: cannot find '/system/bin/magd', disabling 'magd'
android_usb: already disabled
mtp_bind_config
ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 12
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0
binder: 124:124 transaction failed 29189, size 0-0

相关帖子

沙发
mini1986| | 2015-10-23 09:30 | 只看该作者
没搞过,帮你顶一下......不过,个人觉得,你自己写个GPIO驱动,HAL和JNI,让上层Java调用更直接......

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

21

主题

94

帖子

0

粉丝