Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: hc625ma on February 06, 2015, 12:04:45 PM

Title: Problem with GPIO on olimex a20 lime
Post by: hc625ma on February 06, 2015, 12:04:45 PM
Hello guys! I am trying to use GPIOs on A20-lime, but it says i can't write to

/sys/class/gpio/export:

root@roadie:/sys/class# echo 64 > /sys/class/gpio/export
-bash: echo: write error: Invalid argument
root@roadie:/sys/class#

I'm using latest official debian sd card image, except for i've upgraded it to jessie (cause i wanted to use CPAN with system perl). Can it be a problem? Maybe i need to load some kernel module or gpio driver or there is something else i dont know about?

Thx.
Title: Re: Problem with GPIO on olimex a20 lime
Post by: MBR on February 06, 2015, 09:02:26 PM
Did you try lower number GPIOs? Maybe there are defined fewer than 64 GPIOs in the FEX file, you can check it with something like

for i in `seq 64` ; do echo $i > /sys/class/gpio/export ; done

and look at the newly created directories to see what GPIOs are exportable.
Title: Re: Problem with GPIO on olimex a20 lime
Post by: hc625ma on February 09, 2015, 02:25:30 PM
Thank you very much! Seems like it was the reason =) Exporting values like 1 or 2 works fine.
Title: Re: Problem with GPIO on olimex a20 lime
Post by: bpir1 on May 18, 2017, 03:44:08 PM
Hi,

I have A20-Olinuxino-Micro Board. I am trying to use a GPIO port pin for LED.
I have converted the /boot/script.bin to /boot/script.fex. Then I found that there are 61 Gpio pins are used. But when I use the command

for i in `seq 61` ; do echo $i > /sys/class/gpio/export ; done

I am getting following error. -bash: echo: write error: Invalid argument error.

Also for individual port pins also, I am getting the same error.

How to enable all the pins declared in the script.fex file.

Please help with this?

Thanks