gpio control on latest archlinux

Started by crisman, March 22, 2013, 11:24:12 AM

Previous topic - Next topic

crisman

Hello, I have an olinuxino maxi with latest archlinux installed, kernel 3.7.2.
I'm trying to control 2 gpios, 24 and 3 (which, based on olinuxino manual, should correspond on pin 9 and 10 of uext, correct me if this is wrong), but they do not change state!

[root@olinuxino-dev /]# cd /sys/class/gpio/
[root@olinuxino-dev gpio]# ls -al
total 0
drwxr-xr-x  2 root root    0 Jan  1  1970 .
drwxr-xr-x 40 root root    0 Jan  1  1970 ..
--w-------  1 root root 4096 Mar 22 10:12 export
lrwxrwxrwx  1 root root    0 Mar 22 10:05 gpio24 -> ../../devices/80000000.apb/80000000.apbh/80018000.pinctrl/gpio.0/gpio/gpio24
lrwxrwxrwx  1 root root    0 Mar 22 10:05 gpio3 -> ../../devices/80000000.apb/80000000.apbh/80018000.pinctrl/gpio.0/gpio/gpio3
lrwxrwxrwx  1 root root    0 Jan  1  1970 gpiochip0 -> ../../devices/80000000.apb/80000000.apbh/80018000.pinctrl/gpio.0/gpio/gpiochip0
lrwxrwxrwx  1 root root    0 Jan  1  1970 gpiochip32 -> ../../devices/80000000.apb/80000000.apbh/80018000.pinctrl/gpio.1/gpio/gpiochip32
lrwxrwxrwx  1 root root    0 Jan  1  1970 gpiochip64 -> ../../devices/80000000.apb/80000000.apbh/80018000.pinctrl/gpio.2/gpio/gpiochip64
--w-------  1 root root 4096 Jan  1  1970 unexport
[root@olinuxino-dev gpio]# cat gpio24/value
0
[root@olinuxino-dev gpio]# cat gpio3/value
1
[root@olinuxino-dev gpio]# echo "0" > gpio3/value
[root@olinuxino-dev gpio]# echo "1" > gpio24/value
[root@olinuxino-dev gpio]# cat gpio24/value
0
[root@olinuxino-dev gpio]# cat gpio3/value
1
[root@olinuxino-dev gpio]# uname -a
Linux olinuxino-dev 3.7.2-2-ARCH #1 PREEMPT Thu Jan 17 07:51:19 UTC 2013 armv5tejl GNU/Linux
[root@olinuxino-dev gpio]# cat gpio3/direction
out
[root@olinuxino-dev gpio]# cat gpio24/direction
out


As you can see the state is always the same. Any suggestion?

Regards

zeehond

Crisman,

The documentation is not quite clear. GPIO is on pin 10 of the UEXT connector, pin 19 of the GPIO connector, and may have another function as well??? I needed 6 IO lines for my solarproject and used GPIO 1,2,4,5,6 and 7. GPIO number 3 on my boards had the same problem as you mentioned...

Kernel 2.6.35-8-ARCH+

PS,
I did not try GPIO 24

Succes, Ed

crisman

Hi, when using kernel 2.6.35 I have no problems to control those gpios. But with kernel 3.x the value of the gpio is always the same and I don't know why...

Regards