R5A 40-PIN Pinout
The R5A provides a 40-pin header compatible with most Raspberry-Pi-style sensors and HATs. All logic levels are 3.3 V — do not feed 5 V logic into GPIO pins. Every GPIO pin can be used as plain GPIO; the functions listed under each signal name are optional muxed options. One pin carries one function at a time.
Out of the box only the default functions and plain GPIO are available. Enabling any other function means editing the dts configuration by hand, then rebuilding and flashing the kernel image.
Enabling steps and DTS examples for each peripheral are on the interface pages: I2C (R5A), UART & Serial (R5A), SPI (R5A) and PWM (R5A).
Pinout
GPIO no. is the Linux global (sysfs) number: 32 × bank + 8 × port + pin,
for example GPIO4_A3 = 32×4 + 8×0 + 3 = 131. The _M0/_M1/_M2 … suffix in
alternate functions is the pin-mux index used when editing the device tree.
Odd pins on the left, even pins on the right; the second line under each signal name lists the pin's alternate functions. Colours encode the peripheral type:
GPIO4_A0 GPIO UART2_TX_M0 UART I2C1_SDA_M2 I2C SPI0_MOSI_M2 SPI PWM2_M1 PWM CAN1_RX_M1 CAN I2S1_SDO0_M0 I2S SPDIF1_TX_M1 SPDIF PDM1_SDI0_M1 PDM JTAG_TCK_M2 JTAG 3V3 / 5V0 Power GND Ground| Signal (odd) | GPIO no. | Pin | Pin | GPIO no. | Signal (even) |
|---|---|---|---|---|---|
| 3V3 | — | 1 | 2 | — | 5V0 |
| GPIO0_D5 I2C1_SDA_M2 · SPI3_CS1_M2 · I2S1_SDO3_M1 · CAN2_TX_M1 | 29 | 3 | 4 | — | 5V0 |
| GPIO0_D4 I2C1_SCL_M2 · SPI3_CS0_M2 · I2S1_SDO2_M1 · CAN2_RX_M1 · PWM3_IR_M0 · PDM0_SDI2_M1 | 28 | 5 | 6 | — | GND |
| GPIO1_B7 SPDIF1_TX_M0 · PWM13_M2 · UART1_RX_M1 · I2C5_SDA_M3 | 47 | 7 | 8 | 13 | GPIO0_B5 UART2_TX_M0 · I2S1_MCLK_M1 · I2C1_SCL_M0 · JTAG_TCK_M2 |
| GND | — | 9 | 10 | 14 | GPIO0_B6 UART2_RX_M0 · I2S1_SCLK_M1 · I2C1_SDA_M0 · JTAG_TMS_M2 |
| GPIO4_A0 I2S1_MCLK_M0 · SPI0_MISO_M1 · UART9_RTSN_M1 | 128 | 11 | 12 | 39 | GPIO1_A7 PWM13_IR_M3 · SPI2_CS0_M0 · PDM0_SDI0_M1 |
| GPIO4_A1 I2S1_SCLK_M0 · SPI0_MOSI_M1 · UART9_CTSN_M1 | 129 | 13 | 14 | — | GND |
| GPIO4_A2 I2S1_LRCK_M0 · SPI0_CLK_M1 | 130 | 15 | 16 | 33 | GPIO1_A1 UART6_TX_M1 · SPI4_MOSI_M2 · I2C2_SCL_M4 |
| 3V3 | — | 17 | 18 | 32 | GPIO1_A0 UART6_RX_M1 · SPI4_MISO_M2 · I2C2_SDA_M4 |
| GPIO1_B2 SPI0_MOSI_M2 · UART4_RX_M2 · PDM1_SDI3_M1 | 42 | 19 | 20 | — | GND |
| GPIO1_B1 SPI0_MISO_M2 · PDM1_SDI2_M1 | 41 | 21 | 22 | 40 | GPIO1_B0 SPI2_CS1_M0 · PDM1_SDI1_M1 |
| GPIO1_B3 SPI0_CLK_M2 · UART4_TX_M2 · PDM1_CLK1_M1 | 43 | 23 | 24 | 44 | GPIO1_B4 SPI0_CS0_M2 · UART7_RX_M2 · PDM1_CLK0_M1 |
| GND | — | 25 | 26 | 45 | GPIO1_B5 SPI0_CS1_M2 · UART7_TX_M2 |
| GPIO4_B0 I2C6_SDA_M3 · I2S1_SDI3_M0 · UART8_TX_M0 · SPI2_CS1_M1 | 136 | 27 | 28 | 137 | GPIO4_B1 I2C6_SCL_M3 · I2S1_SDO0_M0 · UART8_RX_M0 · SPI0_CS1_M1 · SPDIF1_TX_M1 |
| GPIO4_A3 UART0_TX_M2 | 131 | 29 | 30 | — | GND |
| GPIO4_A4 UART0_RX_M2 · SPI2_MISO_M1 · I2C3_SCL_M2 | 132 | 31 | 32 | 105 | GPIO3_B1 PWM2_M1 · UART2_TX_M2 |
| GPIO4_A5 UART3_TX_M2 · I2S1_SDI0_M0 · SPI2_MOSI_M1 · I2C3_SDA_M2 | 133 | 33 | 34 | — | GND |
| GPIO4_A6 UART3_RX_M2 · I2S1_SDI1_M0 · SPI2_CLK_M1 · I2C5_SCL_M2 | 134 | 35 | 36 | 138 | GPIO4_B2 CAN1_RX_M1 · PWM14_M1 · I2S1_SDO1_M0 · UART8_RTSN_M0 · SPI0_CS0_M1 · I2C7_SCL_M3 |
| GPIO4_A7 I2S1_SDI2_M0 · SPI2_CS0_M1 · I2C5_SDA_M2 | 135 | 37 | 38 | 139 | GPIO4_B3 CAN1_TX_M1 · PWM15_IR_M1 · I2S1_SDO2_M0 · UART8_CTSN_M0 · I2C7_SDA_M3 |
| GND | — | 39 | 40 | 115 | GPIO3_C3 PWM15_IR_M0 · UART7_CTSN_M1 · SPI1_CS1_M1 · I2C8_SDA_M4 |
Related
- GPIO Usage (R5A) — numbering tables and command examples.
- Overview — board connectors and specifications.
- Linux — device tree basics.