使用JTAG管脚作为GPIO
试验过程过程如下:1) TJTAG_EN下拉,可以看到 PROC_TMS, PROC_TDI, PROC_TDO从原来的1.8V 变成低电平
2) 从uboot输出的RCW
Reset Configuration Word (RCW):
00000000: 0800000a 00000000 00000000 00000000
00000010: 35080000 c000000c 40000000 00001800
00000020: 00000000 00000000 00000000 00014552
00000030: 00000000 1080a120 00000096 00000000
可以看到
370-371 UART2_BASE_FLOW,00 GPIO1, GPIO1, GPIO1
378 UART2_BASE_DATA,0 GPIO1, GPIO1
均是GPIO配置
3) 测试PROC_TCK (GPIO1_6),
root@localhost:~# echo 454 > /sys/class/gpio/export
root@localhost:~# echo out > /sys/class/gpio/gpio454/direction
root@localhost:~# echo 1 > /sys/class/gpio/gpio454/value
root@localhost:~# cat /sys/class/gpio/gpio454/value
0
发现无法设置输出的值,一直为低,请问会是什么原因?谢谢
参考知识库中的这篇文章:http://bbs.witech.com.cn/portal.php?mod=view&aid=458
仍然无法设置成功,在openwrt 和 ubuntu都是这个问题,请大家提供一点建议,谢谢
root@OpenWrt:/# echo 486 > /sys/class/gpio/export
root@OpenWrt:/# echo 488 > /sys/class/gpio/export
root@OpenWrt:/# echo out > /sys/class/gpio/gpio486/direction
root@OpenWrt:/#ls /sys/class/gpio
export gpio486 gpiochip448unexport
gpio448 gpio488 gpiochip480
root@OpenWrt:/# echo 1 > /sys/class/gpio/gpio486/value
root@OpenWrt:/# cat /sys/class/gpio/gpio486/value
0
root@OpenWrt:/#
GPIO1_6对应的gpiochip为486,不是454
GPIO1_6确实对应的gpiochip为486,已经验证了, 非常感谢提供的帮助
我原来看到/sys/class/gpio/目录下有
/sys/class/gpio/gpiochip448
/sys/class/gpio/gpiochip480
就以为448是GPIO1的起止编号,480是GPIO2的起止编号,犯了个错误
页:
[1]