ElectronicZoologyfield notes from the garage
Diagnostics • ESP32

How to check
a new ESP32

Board: Any ESP32
Topic: Diagnostics, chip info, board verification
✓ Confirmed

I bought a batch of five ESP32 boards, a good deal off AliExpress. They arrived and sat for three months before I got around to using them. The first one I powered on ran hot immediately. If it is too hot to touch comfortably, bin it. So I tested the batch. Two out of the five were dead. By that point the AliExpress dispute window had long closed and my cheap deal was a loss. Now I open and check every board within 24 hours of it arriving, whether I need it or not.

This guide assumes it is not your first day on the farm. Your IDE is already set up for ESP32 work. A dedicated guide for setting up the Arduino IDE for ESP32 is coming, so keep an eye out for it.

Here are the sketches I run on every new board. They tell you more than just that she is alive and has a pulse.

Physical Inspection

Before plugging anything in, look at the board.

  • Check the pins. Bent pins on a header strip are easy to miss and easy to fix with tweezers before they cause intermittent connections that waste your time later.
  • Check the USB port. Give it a gentle wiggle. A port that moves is a port that will eventually fail.
  • Check the module label. The variant is printed on the module itself - N8, N8R2, N8R8 and so on. Write it down. The diagnostic sketches will confirm it, but knowing what to expect before you run them means you can spot a mislabelled module.
  • Check for obvious damage. Burn marks, missing components, cracked substrate. Rare with new boards but worth ten seconds.

Arduino IDE Setup

Select the right board under Tools. For an ESP32-S3 use ESP32S3 Dev Module. For a C3 use ESP32C3 Dev Module. The generic ESP32 option is for the original WROOM and WROVER modules and will not work correctly with S3 or C3 hardware.

Set the PSRAM option to match your module variant. If your module has R8 in the name, set PSRAM to OPI PSRAM. If it has R2, set it to QSPI PSRAM. No R in the name means no PSRAM - leave it disabled. The PSRAM guide will confirm whether this is correct.

Set the baud rate to 115200. All sketches in this guide and the linked memory guides use this.

Chip Info

Upload this sketch first. It confirms the chip model, silicon revision, clock speed, and core count.

/*
 * We stand on the shoulders of giants when we build
 * with knowledge gained from others' efforts.
 * That doesn't make us giants. Be humble.
 * Create with care. Open source is the way.
 *
 * ESP32 Chip Info
 * ---------------
 * Report chip model, revision, CPU frequency, and core count.
 *
 * Board:   Any ESP32
 *
 * Open source - MIT Licence
 * Electronic Zoology - field notes from the garage
 * https://electroniczoology.com/guides/how-to-check-a-new-esp32
 */

void setup() {
    Serial.begin(115200);
    delay(1000);                                                    // give the serial monitor time to connect

    Serial.printf("Chip model:    %s\n", ESP.getChipModel());      // ESP32, ESP32-S3, ESP32-C3, ESP32-S2, etc.
    Serial.printf("Chip revision: %d\n", ESP.getChipRevision());   // silicon revision - affects some errata
    Serial.printf("CPU freq:      %d MHz\n", ESP.getCpuFreqMHz()); // typically 240MHz, 160MHz, or 80MHz depending on variant
    Serial.printf("Cores:         %d\n", ESP.getChipCores());      // original and S3 have 2, C3 and S2 have 1
}
void loop() {}

What each line tells you

  • Chip model - confirms you have the variant you think you have. Useful when boards arrive unlabelled or with vague silk screen.
  • Chip revision - the silicon revision. Early revisions of some ESP32 variants have known bugs baked into the hardware. If a peripheral behaves strangely, check the Espressif documentation for your revision number before you blame your code.
  • CPU freq - what clock speed the board manager defaulted to. Affects timing-sensitive code and power consumption.
  • Cores - matters when you start looking at FreeRTOS task pinning. Code written assuming two cores will behave differently on a single-core variant like the C3.
Arduino IDE serial monitor showing chip info output - ESP32-S3, revision 2, 240MHz, 2 cores
Chip info output on an ESP32-S3 - revision 2, 240MHz, 2 cores

Flash, RAM, and PSRAM

These three sketches are covered in full in the memory series, including what each line reports and what the numbers mean for your project.

Run them in order. By the end you will know exactly what the board has and how much of it is available before your sketch does anything.

Full Report Sketch

If you just want everything in one upload, this sketch combines chip info, MAC address, flash, RAM, PSRAM, and the full partition table into a single pass. If you want to understand what each number means, the sections above link to the dedicated guides.

/*
 * We stand on the shoulders of giants when we build
 * with knowledge gained from others' efforts.
 * That doesn't make us giants. Be humble.
 * Create with care. Open source is the way.
 *
 * ESP32 System Report
 * -------------------
 * Report chip info, flash, RAM, and PSRAM in one pass.
 *
 * Board:   Any ESP32
 * Library: WiFi (built-in), esp_partition (built-in ESP-IDF)
 *
 * Open source - MIT Licence
 * Electronic Zoology - field notes from the garage
 * https://electroniczoology.com/guides/how-to-check-a-new-esp32
 */

#include <WiFi.h>
#include <esp_partition.h>

void setup() {
    Serial.begin(115200);
    delay(1000);

    uint64_t mac = ESP.getEfuseMac();
    Serial.printf("MAC (efuse):   %02X:%02X:%02X:%02X:%02X:%02X\n",
        (uint8_t)(mac), (uint8_t)(mac >> 8),  (uint8_t)(mac >> 16),
        (uint8_t)(mac >> 24), (uint8_t)(mac >> 32), (uint8_t)(mac >> 40));

    WiFi.mode(WIFI_STA);
    delay(500);
    Serial.printf("MAC (wifi):    %s\n", WiFi.macAddress().c_str());

    Serial.printf("Chip model:    %s\n", ESP.getChipModel());
    Serial.printf("Chip revision: %d\n", ESP.getChipRevision());
    Serial.printf("CPU freq:      %d MHz\n", ESP.getCpuFreqMHz());
    Serial.printf("Cores:         %d\n", ESP.getChipCores());
    Serial.printf("Chip ID:       %llX\n", mac);

    Serial.println("--- Flash Report ---");
    Serial.printf("Flash chip size:      %u bytes\n", ESP.getFlashChipSize());
    Serial.printf("Flash chip speed:     %u Hz\n", ESP.getFlashChipSpeed());
    Serial.printf("Sketch size:          %u bytes\n", ESP.getSketchSize());
    Serial.printf("Free sketch space:    %u bytes\n", ESP.getFreeSketchSpace());

    Serial.println("--- RAM Report ---");
    Serial.printf("Free heap:          %u bytes\n", ESP.getFreeHeap());
    Serial.printf("Min free heap:      %u bytes\n", ESP.getMinFreeHeap());
    Serial.printf("Largest free block: %u bytes\n", ESP.getMaxAllocHeap());

    Serial.println("--- PSRAM Report ---");
    if (psramFound()) {
        Serial.println("PSRAM found.");
        Serial.printf("PSRAM size:      %u bytes\n", ESP.getPsramSize());
        Serial.printf("Free PSRAM:      %u bytes\n", ESP.getFreePsram());
    } else {
        Serial.println("No PSRAM found on this module.");
    }

    Serial.println("--- Partition Table ---");
    Serial.printf("%-16s %-8s %-12s %-10s %s\n", "Label", "Type", "Subtype", "Offset", "Size");
    esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
    while (it != NULL) {
        const esp_partition_t* p = esp_partition_get(it);
        Serial.printf("%-16s %-8d %-12d 0x%08x  %u bytes\n",
            p->label, p->type, p->subtype, p->address, p->size);
        it = esp_partition_next(it);
    }
    esp_partition_iterator_release(it);
}

void loop() {}
Dig deeper into flash How ESP32 flash memory works → - partition schemes, sketch space, and what the numbers mean.
Understand your RAM budget How ESP32 RAM works → - free heap, fragmentation, and what a real project costs.
Got PSRAM? Use it How ESP32 PSRAM works → - which modules have it and how to allocate into it.