M5Stack Tab5 pinout: GPIO, I/O expanders and I2C addresses¶
Every pin this firmware configures on the M5Stack Tab5, with the ESP32-P4 GPIO or the I/O expander pin behind it, the I2C bus and the address of each chip on it. The pins on this page come from the firmware's YAML, not from a datasheet: the project's CI compares every row with the YAML, in English and in French (tests/test_doc_broches.py), and fails if a pin the YAML configures is missing here or differs. The diagram is checked the same way. The pins are the same on the three display revisions (hardware revisions). For what each part is, see the hardware reference; for the charger lines, the battery page.
Pin map¶
Every pin the firmware configures, as written in its YAML. "PI4IOE 0x43, P1" means pin 1 of the PI4IOE5V6408 I/O expander at address 0x43 on the internal I2C bus; there are two of them (0x43 and 0x44). The MIPI-DSI link itself has no pin in the YAML: the display model of Tab5/paquets/ecran-<revision>.yaml takes care of it. The last column names the component (its id, or the block that has none) and the key: tests/test_doc_broches.py checks every row, in both languages, against the YAML, and fails if a pin of the YAML is missing here.
| Function | Pin | In the YAML |
|---|---|---|
| Internal I2C bus, SDA (400 kHz) | GPIO 31 | bsp_bus · sda |
| Internal I2C bus, SCL | GPIO 32 | bsp_bus · scl |
| Display reset | PI4IOE 0x43, P4 | tab5_display · reset_pin |
| Touch interrupt | GPIO 23 | touch · interrupt_pin |
| Touch reset | PI4IOE 0x43, P5 | touch · reset_pin |
| Backlight PWM (LEDC, 1 kHz) | GPIO 22 | backlight_pwm · pin |
| I2S bit clock (microphone and speaker) | GPIO 27 | mic_bus · i2s_bclk_pin |
| I2S word select (microphone and speaker) | GPIO 29 | mic_bus · i2s_lrclk_pin |
| I2S master clock (microphone and speaker) | GPIO 30 | mic_bus · i2s_mclk_pin |
| I2S data in, from the ES7210 (microphone) | GPIO 28 | tab5_microphone · i2s_din_pin |
| I2S data out, to the ES8388 (speaker) | GPIO 26 | tab5_speaker · i2s_dout_pin |
| Speaker amplifier enable | PI4IOE 0x43, P1 | speaker_enable · pin |
| Headphone jack detect | PI4IOE 0x43, P7 | headphone_detect · pin |
| Wi-Fi antenna, internal or external | PI4IOE 0x43, P0 | wifi_antenna_int_ext · pin |
| External 5 V power | PI4IOE 0x43, P2 | external_5v_power · pin |
| Wi-Fi power | PI4IOE 0x44, P0 | wifi_power · pin |
| USB power | PI4IOE 0x44, P3 | usb_5v_power · pin |
| Battery quick charge (active low, kept off) | PI4IOE 0x44, P5 | quick_charge · pin |
| Battery charging status | PI4IOE 0x44, P6 | batterie_en_charge · pin |
| Battery charge enable | PI4IOE 0x44, P7 | charge_enable · pin |
| ESP32-C6 link (SDIO), clock | GPIO 12 | esp32_hosted · clk_pin |
| ESP32-C6 link (SDIO), command | GPIO 13 | esp32_hosted · cmd_pin |
| ESP32-C6 link (SDIO), data 0 | GPIO 11 | esp32_hosted · d0_pin |
| ESP32-C6 link (SDIO), data 1 | GPIO 10 | esp32_hosted · d1_pin |
| ESP32-C6 link (SDIO), data 2 | GPIO 9 | esp32_hosted · d2_pin |
| ESP32-C6 link (SDIO), data 3 | GPIO 8 | esp32_hosted · d3_pin |
| ESP32-C6 reset | GPIO 15 | esp32_hosted · reset_pin |
I2C bus and chip addresses¶
The firmware declares a single I2C bus (bsp_bus, GPIO 31 and 32, 400 kHz), so every I2C chip it drives is on it. The camera of the Tab5 shares these two lines too (M5Stack's PinMap); this firmware does not use it. Four addresses are written in the YAML and checked by the same test; the others are the chips' own, as M5Stack's PinMap gives them (read on 2026-11-06).
| Chip | Address | Source |
|---|---|---|
| PI4IOE5V6408 I/O expander 1 | 0x43 | pi4ioe1 · address |
| PI4IOE5V6408 I/O expander 2 | 0x44 | pi4ioe2 · address |
| BMI270 motion sensor | 0x68 | tab5_imu · address |
| INA226 battery monitor | 0x41 | ina226_batterie · address (ESPHome's default for it, 0x40, is the ES7210's) |
| ES8388 audio codec (speaker) | 0x10 | M5Stack's PinMap, not written in the YAML |
| ES7210 audio ADC (microphone) | 0x40 | M5Stack's PinMap, not written in the YAML |
| RX8130CE real-time clock | 0x32 | M5Stack's PinMap, not written in the YAML |
| Touch controller, ST7123 or ST7121 (GT911 on the ILI9881C revision) | 0x55 (GT911: 0x14) | M5Stack's PinMap, not written in the YAML |
Compared with M5Stack and ESPHome¶
On 2026-11-06 the pins of this table were compared with two other sources, read that day:
- M5Stack's PinMap (docs.m5stack.com/en/core/Tab5): the same I2C pins (GPIO 31 and 32), touch interrupt (GPIO 23), backlight (GPIO 22), I2S pins of the two codecs (GPIO 27, 29, 30, 28 and 26) and ESP32-C6 link: SDIO data 0 to 3 on GPIO 11, 10, 9 and 8, command GPIO 13, clock GPIO 12, reset GPIO 15. The expanders agree too (0x43: antenna select P0, speaker amplifier P1, external 5 V P2, display reset P4, touch reset P5, headphone detect P7; 0x44: Wi-Fi power P0, USB power P3, quick charge P5, charging status P6, charge enable P7). M5Stack also lists a GPIO 14 wired to the C6's IO2, the camera reset on 0x43 P6 and a power-off pulse on 0x44 P4: this firmware configures none of them.
- ESPHome's device page (the page, its
config.yamlread in the devices.esphome.io repository): the same SDIO, I2C, I2S, touch, backlight and expander pins.
This table was not compared with pinouts published elsewhere. If one disagrees with it, this table is what the firmware's YAML configures, and the CI compares it with the YAML at every change.
Pins this firmware does not use¶
From M5Stack's PinMap (read on 2026-11-06), for readers who want the whole board. Not in this firmware's YAML, so not checked by the CI.
| Part | Pins (M5Stack's PinMap) |
|---|---|
| Camera SC2356 (MIPI-CSI) | I2C on GPIO 31 and 32 (shared), master clock GPIO 36, data on the dedicated CSI lanes; reset on the expander (0x43 P6) |
| microSD, SPI mode | MISO GPIO 39, CS GPIO 42, SCK GPIO 43, MOSI GPIO 44 |
| microSD, SDIO mode | DAT0 GPIO 39, DAT1 GPIO 40, DAT2 GPIO 41, DAT3 GPIO 42, CLK GPIO 43, CMD GPIO 44 |
| RS485 (SIT3088) | RX GPIO 21, TX GPIO 20, direction GPIO 34 |
| HY2.0-4P connector (PORT.A) | GND, 5 V, GPIO 53, GPIO 54 |
| ESP32-C6 | GPIO 14 wired to its IO2, besides the SDIO lines and the reset above |
| Display (MIPI-DSI) | dedicated lanes (clock, data 0 and 1), no GPIO; backlight on GPIO 22 |
The M-Bus connector on the back (30 pins, M5Stack's PinMap):
| Pins | Left | Right |
|---|---|---|
| 1 and 2 | GND | GPIO 16 |
| 3 and 4 | GND | GPIO 17 (PB_IN) |
| 5 and 6 | GND | RST (EN) |
| 7 and 8 | GPIO 18 (MOSI) | GPIO 45 |
| 9 and 10 | GPIO 19 (MISO) | GPIO 52 (PB_OUT) |
| 11 and 12 | GPIO 5 (SCK) | 3V3 |
| 13 and 14 | GPIO 38 (RXD0) | GPIO 37 (TXD0) |
| 15 and 16 | GPIO 7 (PC_RX) | GPIO 6 (PC_TX) |
| 17 and 18 | GPIO 31 (internal SDA) | GPIO 32 (internal SCL) |
| 19 and 20 | GPIO 3 | GPIO 4 |
| 21 and 22 | GPIO 2 | GPIO 48 |
| 23 and 24 | GPIO 47 | GPIO 35 |
| 25 and 26 | HVIN | GPIO 51 |
| 27 and 28 | HVIN | 5 V |
| 29 and 30 | HVIN | BAT |