[SOLVED] How to export and use GPIO pins, Cubieboard2 A20

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

[SOLVED] How to export and use GPIO pins, Cubieboard2 A20

Postby sv13 » Sun Dec 20, 2015 1:32 pm

Hi, i would like to mess around with pins on cubieboard2, but given my limited knowledge i cant make progress.
i have installed Arch on sd card following this instructions http://archlinuxarm.org/platforms/armv7/allwinner/cubieboard-2#qt-platform_tabs-ui-tabs2

$this->bbcode_second_pass_code('', 'uname -a
Linux cubie 4.3.3-1-ARCH #1 SMP Fri Dec 18 18:48:10 MST 2015 armv7l GNU/Linux
')
as you can see below i have exported pin 17, i can change its direction to out, and set value to 1 or 0, how do i know which pin on the board i have actually exported?
$this->bbcode_second_pass_code('', '[root@cubie gpio] $ pwd
/sys/class/gpio
[root@cubie gpio] $ ls
export gpiochip0 unexport
[root@cubie gpio] $ echo 17 > export
[root@cubie gpio] $ ls
export gpio17 gpiochip0 unexport')

i have checked voltage on 17-th pin on both sides of board, but they have constant 0.13V, despite value 1 or 0,
do i need some setup to enable gpio ?
i have also tried /boot/script.bin with one pin defined, but exporting pin 1 and changing direction like many people do in examples usually freezes my board

EDIT:
file /sys/kernel/debug/pinctrl/1c20800.pinctrl/pingroups contains pin names and their respective numbers, e.g.
$this->bbcode_second_pass_code('', '...
group: PG9
pin 201 (PG9)

group: PG10
pin 202 (PG10)

group: PG11
pin 203 (PG11)
...
')
so to use pin PG10 i need to echo 202 > export
then using this page http://docs.cubieboard.org/cubieboard1_and_cubieboard2_gpio_pin identify where exactly PG10 is located on the board
sv13
 
Posts: 1
Joined: Sun Dec 20, 2015 1:03 pm

Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 9 guests