Problem with the GPIO pins enabling in a20-Olinuxino_micro

Started by bpir1, May 18, 2017, 03:45:45 PM

Previous topic - Next topic

bpir1

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

LubOlimex

The problem is in the script file. It seems that there is no gpio_pin_19 in [gpio_para] and [gpio_init] and this stops exporting gpios after number 18. It seems that in gpio_pin_x the number x should be integer that gets incremented by 1.

Note that the pin that was previously associated with gpio_pin_19 was PH10 and the pin is now used for the eMMC memory - so make sure not to define the same pin again.

I've done the easiest fix for the gpio parts here: https://jpst.it/_1Bf

As you notice, there are only 60 gpios in total, so if you need other pins you would need to define them. Refer to the boards schematic on which gpios are free (or connected to peripherals that you don't need).

How to edit the script fex, may be found here: https://www.olimex.com/wiki/index.php?title=How_to_edit_board_configurations_and_definitions_in_the_official_Debian_Linux

Also make sure to check this guide shared by another customer, it gives another look on the subject:

https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/A20-PDFs/A20-GPIO.pdf

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex