Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: crisman on March 22, 2013, 11:24:12 AM

Title: gpio control on latest archlinux
Post by: crisman on March 22, 2013, 11:24:12 AM
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
Title: Re: gpio control on latest archlinux
Post by: zeehond on March 27, 2013, 11:02:52 PM
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
Title: Re: gpio control on latest archlinux
Post by: crisman on March 28, 2013, 10:18:40 AM
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
Title: Re: gpio control on latest archlinux
Post by: Dataedge on March 29, 2013, 07:48:58 PM
Take a look here :
https://www.olimex.com/forum/index.php?topic=901.msg4169#msg4169 (https://www.olimex.com/forum/index.php?topic=901.msg4169#msg4169)