This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GPIOs CONFUSED!
#1
Very confused about GPIO devices:

On this website it shows the GPIO, which I can't link too as n00b


In /sys/class/gpio I have:
gpio220

gpiochip0
gpiochip120
gpiochip152
gpiochip184
gpiochip216
gpiochip24
gpiochip248
gpiochip280
gpiochip56
gpiochip88

If I cat /sys/kernel/debug/gpio I get:
GPIOs 0-23, platform/ff770000.pinctrl, gpio0:

 gpio-3   (pwr-led             ) out hi
 gpio-5   (power               ) in  hi
 gpio-7   (?                   ) in  hi
 gpio-8   (?                   ) in  hi
 gpio-9   (?                   ) in  lo
 gpio-12  (otg_drv_gpio        ) out lo
 gpio-15  (?                   ) in  hi
 gpio-16  (?                   ) in  hi

GPIOs 24-55, platform/ff770000.pinctrl, gpio1:
 gpio-48  (act-led             ) out lo
 gpio-49  (led1-led            ) out lo

GPIOs 56-87, platform/ff770000.pinctrl, gpio2:
 gpio-57  (project_id_0        ) in  hi
 gpio-58  (project_id_1        ) in  hi
 gpio-59  (project_id_2        ) in  hi
 gpio-64  (pcb_id_0            ) in  lo
 gpio-65  (pcb_id_1            ) in  hi
 gpio-66  (pcb_id_2            ) in  lo
 gpio-68  (ram_id_0            ) in  lo
 gpio-69  (ram_id_1            ) in  hi
 gpio-72  (?                   ) in  hi
 gpio-73  (?                   ) in  hi

GPIOs 88-119, platform/ff770000.pinctrl, gpio3:

GPIOs 120-151, platform/ff770000.pinctrl, gpio4:
 gpio-139 (ap6335_rts          ) out lo
 gpio-146 (ap6335_wake         ) out hi
 gpio-147 (wlan_default_wlan_ch) out hi
 gpio-148 (wlan_default_wlan_po) out hi
 gpio-149 (ap6335_reset        ) out hi
 gpio-151 (ap6335_wake_host    ) in  hi

GPIOs 152-183, platform/ff770000.pinctrl, gpio5:

GPIOs 184-215, platform/ff770000.pinctrl, gpio6:
 gpio-193 (?                   ) in  hi
 gpio-194 (?                   ) in  hi

GPIOs 216-247, platform/ff770000.pinctrl, gpio7:
 gpio-218 (enable              ) out hi
 gpio-220 (Headphone detection ) in  hi
 gpio-228 (otg_5v_gpio         ) out hi
 gpio-229 (camsys_gpio         ) out hi
 gpio-233 (?                   ) in  hi
 gpio-234 (?                   ) in  hi

GPIOs 248-279, platform/ff770000.pinctrl, gpio8:
 gpio-252 (?                   ) in  hi
 gpio-253 (?                   ) in  hi

GPIOs 280-311, platform/ff770000.pinctrl, gpio15:



I'm now looking at the Rockchip RK3328 Technical Reference Manual Part1.

I've tried the GPIO 'examples'

For a 'tinker' board, Asus aren't making life easy! Any help welcome on how to drive the basic of basic ports most welcome!
Reply
#2
(08-24-2019, 09:40 PM)kibodemon Wrote: For a 'tinker' board, Asus aren't making life easy!

+1!
It was supposed to copy the RPi, but we got not the same effect. Mostly is a less regard to provide information about their hardware.
So you might have a look to the propose libraries, for python, or for c and the program gpio.
But you may have a look to the kernel informations too.


From my knowledge I may tell you that to access and manage the GPIOs, the best is the program gpio even is not maintained for more than a year (whilst the wiringPi has gone ahead). The other approaches needs to use elevated admin permissions.

So the normal usage, as common user, is not simplified as one would expect, because the tinkerboard version doesn't allow to access /dev/gpiomem, because is not there as it is on the RPi (unless recompiling the kernel, if it can succeed).

As a workaround I found the option to access through a daemon. I haven't test it yet, but it should work as is, anyway.

Beside the rants, if you want to access to the GPIOs, you first need to export the GPIO you need to use, then you can prepare it for input/output.

There's an attempt to allow the normal use to access the GPIO, by a udev rule, but I found no success. Mine is like this:

Code:
# Allow group gpio to access gpiomem device
SUBSYSTEM=="rk3288-gpiomem", GROUP="gpio", MODE="0660"

# To allow additional features like edge detection
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
  chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
  chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
  chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"


This discussion and this discussion were the first to be seen Wink but other are available on the search on the right hand top on the page.
Light blue words might be a link. Have you try to click on them? Big Grin
[-] The following 1 user Likes Im4Tinker's post:
  • kibodemon
Reply
#3
Hmmmm


Attached Files Thumbnail(s)
   
Reply
#4
Do you need a GPIO table?
You can find it at our quick start guide, should be in your box. And their have following simple table:
[Image: Gpio-pinout.png]

Or you can find more at our product page and bottom.
https://www.asus.com/Single-Board-Comput...er-Board-S
[Image: Gpio-pinout-expanded.png]

Also can use "gpio readall" at Tinker's terminal to print table.
[Image: Gpio-table.png]
And then, you can find each pin's SoC pin number.

More here: https://tinkerboarding.co.uk/wiki/index.php/GPIO
Thanks.
Reply
#5
As depicted in green there are 28 pins available.
Light blue words might be a link. Have you try to click on them? Big Grin
Reply
#6
Firstly I am using Android on the TB not the Debian TOS. So the GPIO C example is of little use (I might install Debian on another SD card and try to get it running there, but may be a waste of time as I said target OS is Android).

If I look at the schematics linked to the asus website it shows, for example GP6A1 as port 161 (AE11 on the expander), however the GPIO.Asus table below shows the port as 185.


I am working my way through the advice kindly given, but still no closer to getting a pin to go high.
Reply
#7
To use gpio on android, you could address you discussion on that section, at the first. Anyway on Android you will need a way to access the console commands or python, whichever you prefer.

Then you will face the problem to use the hardware if using no administrator permissions.
So basically, you will need that android gives the access as root.
Light blue words might be a link. Have you try to click on them? Big Grin
Reply
#8
(08-27-2019, 05:24 PM)kibodemon Wrote: Firstly I am using Android on the TB not the Debian TOS. So the GPIO C example is of little use (I might install Debian on another SD card and try to get it running there, but may be a waste of time as I said target OS is Android).

If I look at the schematics linked to the asus website it shows, for example GP6A1 as port 161 (AE11 on the expander), however the GPIO.Asus table below shows the port as 185.


I am working my way through the advice kindly given, but still no closer to getting a pin to go high.

GP6A1 should be AG11, not AE11. So 185 is correct.
[Image: KrVdCUi.png]
[Image: DgKOQAH.png]

And if you want control GPIO at Android? you can take a try with this: https://tinkerboarding.co.uk/forum/thread-632.html
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)