请选择 进入手机版 | 继续访问电脑版

TinkerEdgeR android 缺少 /dev/mem and /dev/gpiomem

[复制链接]
Tinker_fLWBSfsb 发表于 2022-8-11 17:57:06 | 显示全部楼层 |阅读模式
按照文档步骤,将文件复制到工程的jni目录下,修改了Application.mk的android版本
然后用ndk编译
E:\AndroidNDK\android-ndk-r23c\build\ndk-build -B
[arm64-v8a] Executable     : tinker_uart_echo
[arm64-v8a] Install        : tinker_uart_echo => libs/arm64-v8a/tinker_uart_echo
[arm64-v8a] Install        : libwiringPi.so => libs/arm64-v8a/libwiringPi.so
[arm64-v8a] Install        : libwiringPiDev.so => libs/arm64-v8a/libwiringPiDev.so
[arm64-v8a] Compile        : wpi_android <= wpi_android.c
[arm64-v8a] SharedLibrary  : libwpi_android.so
[arm64-v8a] Install        : libwpi_android.so => libs/arm64-v8a/libwpi_android.so



然后推到设备目录里
adb push ../libs/arm64-v8a/libwiringPi.so /system/lib/
adb push ../libs/arm64-v8a/libwiringPiDev.so /system/lib/
adb push ../libs/arm64-v8a/gpio /system/bin/


然后进入设备想查看引脚

139|rk3399pro:/ # gpio readall
can't open /dev/mem and /dev/gpiomem
321: wiringPiSetup: Unable to open /dev/mem and /dev/gpiomem: No such file or directory
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
| CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+


查看文档后发现情况很不一样

Also with a rooted TinkerBoard, it is not possible to access the /dev/mem from an app.
So to use the library from an app, it is needed a custom kernel with a gpiomem driver.
Without gpiomem driver, you can access the library only from root shell.


没有安装gpiomem driver,会导致不能在代码里调用gpio命令,只能用shell访问
说明/dev/mem是固件自带的,烧写后就能访问到的
而tinker Edge R的android固件里没有这两个目录的(/dev/mem and /dev/gpiomem


然后找到https://github.com/joerg65/gpiomem_tinkerboard
发现即便有目录,要想在代码里调用gpio指令,需要重新编译源码得到系统镜像才能打上驱动

真的坑人
回复

使用道具 举报

sychimu 发表于 2022-8-12 08:48:45 | 显示全部楼层
Tinker Edge R Android 部分的gpio控制,目前正在请RD紧急处理中,相信很快就有相应的方案和资料给出了,还请再等等
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册用户

本版积分规则

 
QQ在线咨询
点击这里给我发消息
点击这里给我发消息
电话咨询
0755-23012315
快速回复 返回顶部 返回列表