M5Stack-Core-ESP32
by M5 Stack
Modular ESP32 development kit with display and case - perfect for rapid IoT and UI-based prototyping.

On this page
Pinout
20 pins| Pin | GPIO | Labels | Status | Capabilities | Notes |
|---|---|---|---|---|---|
| 1 | 0 | G0 | strapping | - | |
| 2 | 1 | TXG1PWM | uart | uart | |
| 3 | 2 | G2PWM | strapping | - | |
| 4 | 3 | RXG3PWM | uart | uart | |
| 5 | 5 | SSG5PWM | strapping | spi | |
| 6 | 12 | G12PWM | strapping | - | |
| 7 | 13 | G13PWM | strapping | - | |
| 8 | 15 | G15PWM | strapping | - | |
| 9 | 16 | RXD2G16PWM | strapping | - | |
| 10 | 17 | TXD2G17PWM | strapping | - | |
| 11 | 18 | SCKG18PWM | safe | spi | |
| 12 | 19 | MISOG19PWM | safe | spi | |
| 13 | 21 | SDAG21PWM | safe | i2c | |
| 14 | 22 | SCLG22PWM | safe | i2c | |
| 15 | 23 | MOSIG23PWM | safe | spi | |
| 16 | 25 | G25DAC1PWM | safe | dac | |
| 17 | 26 | G26DAC2PWM | safe | dac | |
| 18 | 34 | G34 | strapping | - | |
| 19 | 35 | G35ADC1 | strapping | - | |
| 20 | 36 | G36ADC2 | strapping | - |
Start with these
7 pins with no boot or system involvementFreely assignable - no strapping, flash, USB or JTAG duties. Ideal first picks for buttons, sensors and LEDs.
Fine - with a little care
sampled at boot or shared with debug/serial| Pin | Label | What to know | Role |
|---|---|---|---|
| G0 | GPIO0 | Must be HIGH during boot for normal startup; if held LOW on reset, forces flash programming mode. | Strapping |
| G2 | GPIO2 | If driven HIGH on reset (while IO0 is LOW), selects an unsupported SDIO boot mode, causing boot failure. | Strapping |
| SS | GPIO5 | Must be HIGH during boot; if pulled LOW at reset, alters SDIO slave timing and may prevent normal boot. | Strapping |
| G12 | MTDI (GPIO12) | Keep LOW during boot (internal PD); pulling HIGH at reset selects 1.8V flash mode, causing flash brownout if 3.3V flash is used. | Strapping |
| G13 | MTCK (GPIO13) | Used for JTAG debugging (TCK); avoid using as GPIO if JTAG is needed. | Other |
| G15 | MTDO (GPIO15) | Keep HIGH during boot (internal PU); if LOW on reset, bootloader log is silenced and boot mode may change. | Strapping |
| G34 | GPIO34 | Cannot be used as output (no drive capability); only suitable for analog/digital input. | Other |
| G35 | GPIO35 | Cannot be used as output; only suitable for input. | Other |
| G36 | GPIO36 (SENSOR_VP) | Cannot be used as output; only suitable for input (e.g., analog read). | Other |
Only if you know the tricks
wired to flash or USB - expect a fight| Pin | Label | What to know | Role |
|---|---|---|---|
| TX | U0TXD (GPIO1) | Connected to on-board USB-UART for uploading and logs; drives serial output at boot, so using as GPIO can disrupt programming or console. | USB |
| RX | U0RXD (GPIO3) | Used for receiving data from USB-UART (programming); also pulled HIGH at boot for console communication, so using as GPIO can disrupt uploads. | USB |
| RXD2 | GPIO16 | Connected to internal PSRAM on PSRAM-enabled modules; not usable as GPIO on those modules. | Flash |
| TXD2 | GPIO17 | Connected to internal PSRAM on PSRAM-enabled modules; not usable as GPIO on those modules. | Flash |
Pinout notes The M5Stack-Core-ESP32 pinout brings out 20 GPIO pins - every one of them usable in your project. For peripherals, I²C is mapped to SDA on GPIO21 and SCL on…
The M5Stack-Core-ESP32 pinout brings out 20 GPIO pins - every one of them usable in your project.
For peripherals, I²C is mapped to SDA on GPIO21 and SCL on GPIO22; the SPI bus (MOSI, MISO, SCK, SS) is broken out in full; TX/RX on GPIO1 and GPIO3 cover serial logging and flashing.
On the analog side there are 2 true DAC outputs.
If you want zero surprises, SCK, MISO, SDA, SCL and 3 more are free of any such role - the safest first picks. 9 of the exposed pins carry boot-time or system duties on the ESP32 (G0, G2, SS and 6 more).
Getting started
flash your first firmware in ~2 minutesBoard: ESP32 Dev Module Flash Size: 16MB (128Mb) Flash Mode: DIO Partition Scheme: 16M Flash (3MB APP / 9.9MB FATFS) Upload Speed: 921600
// blink the onboard LED
void setup() {
pinMode(18, OUTPUT);
}
void loop() {
digitalWrite(18, HIGH); delay(500);
digitalWrite(18, LOW); delay(500);
}[env:m5stack-core-esp32]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921600esp32dev — or type it after board =.esp32:
board: esp32dev
variant: m5stack_core_esp32
framework:
type: esp-idf
# blink - GPIO18
output:
- platform: gpio
pin: 18
id: led_out
light:
- platform: binary
name: "LED"
output: led_outesp32dev (same ids as PlatformIO).esptool.py --chip esp32 --port /dev/ttyACM0 \
--baud 921600 write_flash 0x0 firmware.bin--port = your /dev/tty* (macOS/Linux) or COMx (Windows).Specifications
ESP32 · 54 × 54 mmAbout this board
At its core is the ESP32 - a dual-core Xtensa with both Bluetooth Classic and BLE.
Expect to pay about $39.90 - above the ~$20 typical for ESP32 boards.
Onboard you'll find an LCD 2.0" 320x240 display, a microSD slot, a speaker (1W), battery charging (IP5306) and Button A/Button B/Button C buttons.
- Built-in 110mAh LiPo battery
- Grove HY2.0-4P (I2C / UART / IO) port
- M-Bus stackable bottom connector
Where to buy
prices are typical street prices
Resources
Similar boards




