A20 lime GPIO export

Started by carri, January 04, 2021, 10:22:26 AM

Previous topic - Next topic

carri

Hi,
I Have T2-oLinuXino-LIME-e8Gs16M-IND board. For a backwards compatibility I downloaded a20_Lime_debian_3.4.103_Jessie_2G_eMMC_release_9 image and installed it on emmc.
For a backwards compatibility I need to export  gpio pi16 and pi17 but i can't.
This is what I exported:

ls /sys/class/gpio/
export      gpio1_pg0    gpio2_pg1    gpio3_pg2    gpio4_pg3    gpio5_pg4
gpio10_pg9  gpio20_ph11  gpio30_ph23  gpio40_pb10  gpio50_pi2  gpio60_pi14
gpio11_pc7  gpio21_ph14  gpio31_ph24  gpio41_pb11  gpio51_pi3  gpio61_pi15
gpio12_pc17  gpio22_ph15  gpio32_ph25  gpio42_pb12  gpio52_pi4  gpio6_pg5
gpio13_pc18  gpio23_ph16  gpio33_ph26  gpio43_pb13  gpio53_pi5  gpio7_pg6
gpio14_pc23  gpio24_ph17  gpio34_ph27  gpio44_pb14  gpio54_pi6  gpio8_pg7
gpio15_pc24  gpio25_ph18  gpio35_pb3  gpio45_pb15  gpio55_pi7  gpio9_pg8
gpio16_ph0  gpio26_ph19  gpio36_pb4  gpio46_pb16  gpio56_pi8  gpiochip1
gpio17_ph2  gpio27_ph20  gpio37_pb5  gpio47_pb17  gpio57_pi9  unexport
gpio18_ph9  gpio28_ph21  gpio38_pb6  gpio48_pi0  gpio58_pi10
gpio19_ph10  gpio29_ph22  gpio39_pb7  gpio49_pi1  gpio59_pi11

If i try to export  pi16 and pi17, this is the error:

echo 62 > /sys/class/gpio/export
bash: echo: write error: Invalid argument

How can I export these gpio?

olimex

How did you come with the number 62?
 

carri

since the pi15 is the number 61 I assumed that the pi16 was the next and therefore the number 62. Am I doing something wrong?

olimex

gpioNumber = (Port Letter - 'A') * 32 + pinNumber

in this case ('I'-'A') = 8

8*32 + 15 = 271 is the corresponding number

61 is PB29 which do not exist:

https://raw.githubusercontent.com/allwinner-zh/documents/master/A20/A20_Datasheet_v1.5_20150510.pdf

carri

With the number 271 gives the same error. I would like to point out that I am using kernel 3.14.
However I solved it by editing the script.fex file.
Thanks