5

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

Rob
  • 435
  • 1
  • 5
  • 25
Deepthought
  • 2,815
  • 2
  • 28
  • 39

1 Answers1

6

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.

Deepthought
  • 2,815
  • 2
  • 28
  • 39
  • I have the same problem but with Zybo board of xilinx. Do you have some idea ion how to solve the problem? How to use insmod or modprobe? where to find and install them? – Leos313 Oct 19 '16 at 09:25
  • insmod, modprobe are standard unix commands both of which loads a kernel module. The kernel module for GPIO pins are open source and should be available with the manufacturer. I would suggest reaching out to the community for Zybo boards. – Deepthought Nov 02 '16 at 04:08