A20-SOM204-EVB

Started by khaldrogo, April 13, 2021, 06:23:16 AM

Previous topic - Next topic

khaldrogo

Hi,

I have:
- A20-SOM204-EVB
- Linux Olinuxino 5.2.5-sunxi #5.92.1 SMP
I tried the next lines:
echo 71 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio71/direction
echo 1 > /sys/class/gpio/gpio71/value

If I'm not wrong the port 71 is gpio0, pin 21 at GPIO connector GBH254SMT-34. The return of the two end lines are 1 and 0, all correct. But at the connector i see always ~0V.

I also tried with gpio8 & 9 to see something diferent at the leds but nothing changes.

LubOlimex

#1
Pin #21 from the GPIO connector of A20-SOM204-EVB is named GPIO0 but when you look at A20-SOM204's connector GPIO0 is PH0. Some backtracking is needed. To calculate how PH0 is represented in the kernel we use the amazing formula:

(position of port letter in alphabet – 1) * 32 + pin number of port

In our case with PH0, this is:

(8-1)*32+0= 7*32 = 224

So the pin to export and toggle is 224 in Linux (not 71).
Technical support and documentation manager at Olimex