i.MX6ULL-S使用GPIO的问题
本帖最后由 hermes 于 2021-2-17 23:43 编辑我现在正在做的一个板子用的是6ULL-S作为核心板,用到了4个GPIO,分别是
GPIO5.IO 对应的编号是128
GPIO5.IO 对应的编号是134
GPIO3.IO 对应的编号是91GPIO3.IO 对应的编号是92
首先,/sys/class/gpio目录下的情况如下
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0oAAABICAYAAADI+gV7AAAgAElEQVR4Ae1dy5HrKhBVDpPBRHCrtHPdBG4Ab6f1xKEQnINycAaKYtaOg1d8GrpRIyF/sX0WU3gkBE2fA+ojEOq6rjP4gw/AAXAAHAAHwAFwABwAB8ABcAAcEBwQ/0A0QTiCA+AAOAAOgAPgADgADoAD4AA4ANUIoQgOgAPgADgADoAD4AA4AA6AA+DAggOLA1CPeILwdA4Y859p6Q8DB8aJazjQEpetLde0BdeiL4AD4AA4AA58EAcA9geB/TIBEgJL9Mt36pfgM/j8TnxGW8BncAAc+CAOAOwPAhtC6cKZKnAE48Q1HIBQAn+u4Q+uBX/AAXAAHHgaB55W8d2C9mGazfl89n/zaHq7lG6Y0jF7bhpuUP9gpvPZTMOdfdgPZppDe86zmcZ+n+01ba/Jc9clib0ZbRsDLvcJLP+an64zP6f9y/rEAGV9xXlFv2v805ifRbtq7L95Hol7lT1P92FNf5ftaprPEVNpcxUW8doanyAPfAoOgAPgADjwchxowWB/g55XBUBvrACaSQCVBIMLomYz9uV2DVMKyK8j7COEkq9jHgcv+LreDOO02r61NtW0vSbPWh0XnetHM58Tbi0Hlv04R0HHf+9tdwt+3mvzzfNnuO8t/yk+rBEHWbta5nP0eWZzPF7TXuTZ9/AK/oK/wAFwABx4FQ6UBcXjbpRbQimIhYnEQmf6wQbWZ7MQV04oTWZYIWCzwZVis7N1z4yFUgbHsabtNXl4mbf4ndd5n8By/0wS2ZHa6LnqZxH57/39KG9zqmN/WbXXPqPONduutefa69dsu+ZcbhfxqJVUa1tus5YHx+7XN+Fb+BYcAAfAgSY5UD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zREjG/8QRtwDFPY9iQgtpXfmeqOPvjZpmkUFospRN5aoRSQUCxcqi91n/EB/6bzu9J17BIOzdasemX3cXZJQT+CPzBAXAAHAAHwAFwABx4BAdS0CqCvFXBUQjExTU1eahuKSa4HUIUiPKTiOL5/Xs/ueCgeny6FqCKsjYJWGjjXqEUhVkuTPXynU+iqNLyaMfq2347/0i/L3wbZwiX+VoTSpP2/ls8luO2bM+i7VWCtDeDFZ40QydmG+vq0OrFMfgOHAAHwAFwABwAB8CBKg4UMmWiRDpTFzZC1GDpXVi2KH3lRIiYUfKixs5SSAHkcbH5aQaDMJB+VkTRigCpEUE1eciWa1LZDsnDJpfeOb8GEW77R1xmKm2v9ckeP2vcqK0H+S7DB36D38ABcAAcAAfAgc/mwP8VvDPbIIcWEAAAAABJRU5ErkJggg==
其实我这个板子用不到lcd,目前烧录的系统用的dts是imx6ull-S-emmc-1024x600c7.dts这个
然后我按照教程去修改了一些dts,但是按照那个gpio测试shell去测试,一直提示失败
sh脚本如下
#!/bin/bash
echo Exporting pin $1.
echo $1> /sys/class/gpio/export
echo Setting pin out
cat /sys/class/gpio/gpio$1/value
echo out > /sys/class/gpio/gpio$1/value
echo Setting pin high.
echo 1 > /sys/class/gpio/gpio$1/value
echo $1> /sys/class/gpio/unexport
然后我执行./open.sh 91
执行./open.sh 128
原因不明,到底是我配置没生效还是什么别的原因
dts修改的部分如下
imx6ull-S-emmc-1024x600c7.dts
imx6ull-14x14-evk.dts
目前看修改逻辑应该没问题啊
启用了对应的gpio的define
然后禁用了会复用到的组件
我有make dtbs然后copy到板子上然后执行sync
想知道应该如何修改才能成功
您的引脚复用有问题,您需要修改imx6ull-14x14-evk.dts,将引脚的其他复用去掉,并将这些引脚在iomux处复用成gpio,有几个需要在IOMUXC_SNVS里复用成gpio,可以查看CPU手册确认是哪些引脚,另外您控制GPIO时需要设置方向 zhichao 发表于 2021-2-21 10:45
您的引脚复用有问题,您需要修改imx6ull-14x14-evk.dts,将引脚的其他复用去掉,并将这些引脚在iomux处复用 ...
你好,看了下你的回复,逻辑是ok的,但是我的贴子里有详细截图
我是把那些影响的都disabled了,我这个操作本身也是根据你这边给的应用笔记的逻辑来的
您改的有问题,我提供的方法是举的例子,您改的时候要根据实际的引脚改,保证一个引脚只在一个地方复用,GPIO5.IO和GPIO5.IO 是IOMUXC_SNVS寄存器里的,需要在设备树里添加&iomuxc_snvs,在这里边复用gpio,我提供的应用笔记里有测试方法,您写的shell有问题,用我提供的文档里的方法吧 zhichao 发表于 2021-2-23 08:50
您改的有问题,我提供的方法是举的例子,您改的时候要根据实际的引脚改,保证一个引脚只在一个地方复用,GP ...
好的,谢谢,我试下 zhichao 发表于 2021-2-23 08:50
您改的有问题,我提供的方法是举的例子,您改的时候要根据实际的引脚改,保证一个引脚只在一个地方复用,GP ...
我试了下,添加到了IOMUXC_SNVS
但是开机后看还是老样子,看开机信息有个bad crc use default envirment
不知道有么有关系
hermes 发表于 2021-2-27 22:21
我试了下,添加到了IOMUXC_SNVS
但是开机后看还是老样子,看开机信息有个bad crc use default envirment ...
你的设备树修改的有点儿问题,附件里是一个添加了&iomuxc_snvs节点的设备树,你在这个设备树里边修改试试
肉肉珩 发表于 2021-3-1 09:18
你的设备树修改的有点儿问题,附件里是一个添加了&iomuxc_snvs节点的设备树,你在这个设备树里边修改试试 ...
你好,朋友,我拿你这边提供的进去编译了下dtb,开机后还是一样的,没有什么区别
本帖最后由 hermes 于 2021-3-2 10:34 编辑
肉肉珩 发表于 2021-3-1 09:18
你的设备树修改的有点儿问题,附件里是一个添加了&iomuxc_snvs节点的设备树,你在这个设备树里边修改试试 ...
你好,朋友,如果方便,可以加下我的vx吗,id是shawburn
这样可能解答快一点,不会经常烦扰的,就问几个问题,而且我也是通情达理的人,知道技术专家都很忙的,你们的工作是有价值的 本帖最后由 肉肉珩 于 2021-3-3 16:37 编辑
hermes 发表于 2021-3-2 10:31
你好,朋友,如果方便,可以加下我的vx吗,id是shawburn
这样可能解答快一点,不会经常烦扰的,就问几个 ...
1、我给你发的设备树里在iomuxc_snvs节点下的pinctrl里已经定义成gpio了,SNVS_TAMPER0复用的gpio5.0
2、出厂的设备树里SNVS_TAMPER0复用gpio5.0,用做了触摸,可以看一下硬件原理图,修改设备树的时候需要把原来的功能屏蔽掉,echo $1 >/sys/class/gpio/export 后如果没有生成相应目录,一般都是复用配置不正确,或者功能冲突
3、建议先用命令行测试几个引脚,保证方法没问题后再写脚本
以SNVS_TAMPER0复用的gpio5.0为例,可参考一下图片(给你发的最新的设备树里截得图)
肉肉珩 发表于 2021-3-3 16:30
1、我给你发的设备树里在iomuxc_snvs节点下的pinctrl里已经定义成gpio了,SNVS_TAMPER0复用的gpio5.0
2 ...
嗯,之前确实没注意到GPIO5_0的这个复用,我按照您这边的禁用了这个相关的,继续测试
不显示说目录不存在,但是还是会报operation not permitted,而且我只echo $1> /sys/class/gpio/export这一步也还是没有目录生成的。
整个问题最初开始我GPIO3.IO 对应的编号是91
GPIO3.IO 对应的编号是92
这两个不是snvs的复用我也注意了禁用相关的组件,比如I2C2,ov相机和csi和lcd都禁用了
但是最开始也一样这样报错,所以比较懵,和想象中完全不一样,感觉不只是snvs的问题。
都是引脚复用了,即使正确也都没法生成目录然后操作 本帖最后由 肉肉珩 于 2021-3-4 12:57 编辑
hermes 发表于 2021-3-3 22:06
嗯,之前确实没注意到GPIO5_0的这个复用,我按照您这边的禁用了这个相关的,继续测试
不显示说目录不存 ...
operation not permitted这个应该是你的脚本里测试指令写的不对,你的脚本里 把 out重定向到value里了,所以才会报错,我看前边给你发了回复和应用笔记,以为你看到并改了呢,你按照应用笔记里的方法改一下指令再试试。
肉肉珩 发表于 2021-3-4 12:50
operation not permitted这个应该是你的脚本里测试指令写的不对,你的脚本里 把 out重定向到value里了, ...
按照您这边所说的修改了
#!/bin/bash
echo Exporting pin $1.
echo $1> /sys/class/gpio/export
echo Setting pin out
echo "out" > /sys/class/gpio/gpio$1/direction
cat /sys/class/gpio/gpio$1/value
echo Setting pin high.
echo "1" > /sys/class/gpio/gpio$1/value
cat /sys/class/gpio/gpio$1/value
修改后再读取值,发现值永远都是0
试了128 134 91 92 hermes 发表于 2021-3-14 22:47
按照您这边所说的修改了
#!/bin/bash
echo Exporting pin $1.
用万用表量电压,要是看value值,有些引脚需要做SION位回环
页:
[1]