Rock64 pin guide

The Rock64 has two sets of pins, one set is called Pi-2 bus and the other set is called Pi P5+ Bus.

Pin1 is toward left on the above image on both sets of pin headers.

Notice the GPIO numbers are not as one might often expect. 

The notation of the GPIO pins is Bank number, Group number and Pin number. And this notation if often on chips from Rockchip. (The Rock64 uses Rockchip RK3328)

For example then for GPIO3_D5 then 3 is the chip number, D is the group number and 5 is the Pin number.

To calculate into pin address that we can use then the formula is:


Pin formula

G = Group {(A=0), (B=1), (C=2), (D=3)}
X = Number

pin = (G * 8) + X 

So if we take GPIO3_D5 and fill that into the formula then we get:

pin = (3 * 8) + 5 = 29

Pin number 29 is the number we use in the Gpiod plugin then to address this pin. 

Since the chip number was 3, then the Gpiod Plugin we would connect to /dev/gpiochip3 instead of /dev/gpiochip0.


Other useful information

If running on Armbian (and same for many other systems) then for GPIO access you need to run with elevated permissions. (such as sudo)

Many of the GPIO pins on this board are used internally by the board so, not all of them will be usable for your projects.
In my tests then using built in pull down resistor on this board was hit and miss, as in built in pull down resistor worked fine on GPIO0_A0 but did not work at all on GPIO3_A4. (I still got GPIO3_A4 working for my uses by putting my own physical pull down resistor on it).