ESP32/The board itself/11. What the chip says about itself
Your chip
Your language
The board itself · 11 of 81

What the chip says about itself

Cores, clock, flash size, PSRAM, MAC address and free heap — eight lines that answer the questions you would otherwise argue about with your own board three hours later.

/esp32/whats-inside-the-chip · arduino · S3

Ask the board, not the listing

Boards are sold with a chip name and a set of numbers, and the numbers are frequently the family's rather than the board's. Eight lines in setup() settle it, and they are the same eight lines forever.

Ask the board what it is
0 of 8
Serial monitor, waiting…
Cores
Flash
PSRAM
Eight lines, once, in setup(). Paste them into every new project. They cost nothing and they settle the arguments you would otherwise have with your own board three hours later.

The three that change what you can build

Cores. The classic ESP32 and the S3 have two, the C3 and C6 have one. Everything you will read about pinning a task to core 1 assumes two, and on a single-core chip the call succeeds and pins it to the only one there is.

PSRAM. External RAM, off by default, absent on most boards. A camera frame buffer or a full-colour display buffer needs it, and "ESP32-S3" on the silkscreen does not promise it.

Flash. Decides how much room there is for your sketch, for OTA's second copy of it, and for a filesystem — and the split between those three is fixed before you upload.

The MAC is a free device id

ESP.getEfuseMac() is burned in at the factory and unique to the chip. It is the right answer whenever you were about to invent a device id: a hostname, an MQTT client id, the last four hex digits in an access point's name. It costs no storage, survives an erase, and cannot collide with the board next to it.

While you are there, drop the clock

setCpuFrequencyMhz(80) roughly halves idle current and most projects never notice. It is the cheapest power saving there is, and unlike sleep it changes nothing about how your code is structured.

On your S3
ChipXtensa LX7 · 2 × 240 MHz
Board settingESP32S3 Dev Module
Default I2CSDA 8 · SCL 9
Watch out forThe port vanishes after upload

The code

Paste this into the top of every new project. It costs nothing, prints once, and settles what you are actually holding.

whoami.ino
void setup() {
  Serial.begin(115200);
  delay(200);
  Serial.printf("chip     %s rev %d\n", ESP.getChipModel(), ESP.getChipRevision());
  Serial.printf("cores    %d @ %d MHz\n", ESP.getChipCores(), getCpuFrequencyMhz());
  Serial.printf("flash    %u bytes\n", ESP.getFlashChipSize());
  Serial.printf("psram    %u bytes\n", ESP.getPsramSize());
  Serial.printf("heap     %u free\n", ESP.getFreeHeap());
  Serial.printf("mac      %012llx\n", ESP.getEfuseMac());
}

void loop() {}

getFlashChipSize reports what the board was configured for, not what is soldered on. If it says 4 MB on a 16 MB board, the Tools → Flash Size setting is wrong.

When it does not work

Flash size is half what I paid for

The board setting, not the board. Tools → Flash Size in the IDE, or board_upload.flash_size in platformio.ini. Uploading with the wrong value also means the partition table is wrong, so half the chip is simply unused.

getPsramSize returns zero on a board that has PSRAM

PSRAM is off unless enabled. Tools → PSRAM in the IDE. Until it is on, every large allocation quietly comes out of the 300-odd kB of internal heap and fails at the worst moment.

The MAC address is not the one my router shows

The eFuse value is a base address. Wi-Fi station, soft-AP, BLE and Ethernet each derive their own from it by adding a small offset, so four different addresses are normal and only one of them is on your router.

Free heap is much lower than 320 kB

Wi-Fi takes about 50 kB the moment it starts, and a TLS handshake takes another 40 while it runs. Print the heap before and after WiFi.begin and the number stops being alarming.

Where this goes next

Enough about the board. The next chapter is the first pin actually doing something — high, low, and what happens in between.

Digital I/O

Edit this page — content/esp32/whats-inside-the-chip.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse ESP32 on the forum