写入/sys/class/gpio/export失败 [英] writing to /sys/class/gpio/export failing
问题描述
我正在做一个项目,需要我配置gpio引脚并将传感器添加到原子板.内核已配置了gpio ... CONFIG_GPIO_SYSFS=y
是内核选项之一.
I am working on a project which needs me to configure the gpio pins and add sensors to atom board. The kernel has configured the gpio ... CONFIG_GPIO_SYSFS=y
is one of the kernel options.
我正在使用 fedora 2.6.29-10
但是我无法使用以下方式写出gpio文件夹中的导出文件
I am using fedora version 2.6.29-10
But i am not able to write to export file in gpio folder using
GPIO=22 // to add pin 22 to userspace
echo $GPIO > /sys/class/gpio/export
我得到了错误
bash: echo: write error: Invalid argument
I get the error
bash: echo: write error: Invalid argument
我也尝试过使用sudo
和sh -c
进行相同操作,但是没有用,除非我可以将这些引脚暴露给用户空间,否则我无法编写任何代码.我在做什么错?
内核版本或其他一些内核选项是否需要设置?
I also tried the same with sudo
and sh -c
but no use ,unless i can expose these pins to userspace i cant write any code.What am i doing wrong?
Is the problem with the kernel version or some other kernel options needs to set??
预先感谢
推荐答案
好,如我所描述的,使用GPIO引脚.您需要使用 insmod 或 modprobe 加载模块. 经过漫长的等待,我从原子板制造商那里获得了这些模块. 现在已经解决了上述问题.
Well , for the GPIO pins to be used as I have described. you need to load a module using insmod or modprobe. After a long wait i got those modules from the manufacturers of our atom board. The problem described above is now solved.
这篇关于写入/sys/class/gpio/export失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!