Skip to main content

ROCK 4 Family GPIO Definition

GPIO Voltage

RK3399 and OP1 have three IO voltages, 1.8V/3.0V/3.3V. Below is the default voltage:

GPIOVoltage LevelTolerance
GPIO3_C03.3V3.465V
ADC_IN01.8V1.98V
Other GPIO3.0V3.14V

GPIO Interface

ROCK 4 series has a 40-pin expansion header. Each pin is distinguished by color.
The following pin-out is applicable for all products of ROCK 4 series.

caution

Not all functions can be turned on at the same time. Only one function can be assigned to a pin at a time.

GPIO numberFunction2Function1GPIOPin#Pin#GPIOFunction1Function2GPIO number
+3.3V
1
2
+5.0V
71I2C7_SDAGPIO2_A7
3
4
+5.0V
72I2C7_SCLGPIO2_B0
5
6
GND
75SPI2_CLKGPIO2_B3
7
8
GPIO4_C4
UART2_TXD
148
GND
9
10
GPIO4_C3
UART2_RXD
147
146PWM0GPIO4_C2
11
12
GPIO4_A3I2S1_SCLK131
150PWM1GPIO4_C6
13
14
GND
149SPDIF_TXGPIO4_C5
15
16
GPIO4_D2154
+3.3V
17
18
GPIO4_D4156
40UART4_TXD
SPI1_TXD
GPIO1_B0
19
20
GND
39UART4_RXD
SPI1_RXD
GPIO1_A7
21
22
GPIO4_D5157
41
SPI1_CLK
GPIO1_B1
23
24
GPIO1_B2
SPI1_CSn
42
GND
25
26
ADC_IN0
64I2C2_SDAGPIO2_A0
27
28
GPIO2_A1I2C2_CLK65
74I2C6_SCLSPI2_TXDGPIO2_B2
29
30
GND
73I2C6_SDASPI2_RXDGPIO2_B1
31
32
GPIO3_C0SPDIF_TXUART3_CTSn112
76SPI2_CSnGPIO2_B4
33
34
GND
133I2S1_LRCK_TXGPIO4_A5
35
36
GPIO4_A4I2S1_LRCK_RX132
158GPIO4_D6
37
38
GPIO4_A6I2S1_SDI134
GND
39
40
GPIO4_A7I2S1_SDO135

Notes about 40-pin Header

  • Function marked with color orange is the default function of this pin.
  • Except Pins for power supply, all pins are routed directly to SoC.
  • For pin 3, 5, 27, 28, 29 and 31, each pin is connected to the 3.0V supply through a 4.7K pull-up resistor.
  • Pin 7 is routed directly to the pin of MIPI CSI on board.
  • SPI
    • Pin 19, 21, 23, 24 also route to the pins of SPI flash on board. If the ROCK 4 model has SPI flash soldered on board, the SPI function is not available on GPIO header.
  • UART
    • UART2 is enabled as U-boot and Linux serial console by default. Check Rockpi4/dev/serial-console to use. Check Rockpi4/hardware/devtree_overlays to disable serial console on UART2.
    • UART2 & UART4 support a wide range of baud rate. It includes but not is not limited to the following baud rates. For instance, 115200bps. 500000bps, 1500000bps and so on.
    • For v1.4 and later hardware, on board SPI flash is soldered, UART4 PINs are used as SPI function.
  • For I2C-2 and I2C-7
    • We have do the test using the i2c device e2prom. We need to open the i2c device file, and then do the read or write operation.