Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

writing to /sys/class/gpio/export failing

Tags:

gpio

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.

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

I get the error
bash: echo: write error: Invalid argument

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??

Thanks in advance

like image 809
Deepthought Avatar asked Feb 08 '12 20:02

Deepthought


1 Answers

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.

like image 85
Deepthought Avatar answered Oct 03 '22 04:10

Deepthought