Writing to / sys / class / gpio / export failing

I am working on a project that I need to set up gpio pins and add sensors to the atom board. The kernel configured gpio ... CONFIG_GPIO_SYSFS=y is one of the kernel options.

I am using Fedora version 2.6.29-10
But I can not write to export the file to the gpio folder using

 GPIO=22 // to add pin 22 to userspace echo $GPIO > /sys/class/gpio/export 

I get a bash: echo: write error: Invalid argument error message bash: echo: write error: Invalid argument

I also tried the same with sudo and sh -c , but did not use it, if I cannot expose these contacts in user space, I cannot write any code. What am I doing wrong?
Is there a problem with the kernel version or some other kernel parameters to install?

Thanks in advance

+4
source share
1 answer

Well, for the GPIO contacts to be used, as I described. you need to load the module using insmod or modprobe . After a long wait, I received these modules from the manufacturers of our atomic board. The problem described above is now resolved.

+5
source

Source: https://habr.com/ru/post/1395484/


All Articles