320k sram + 8mb psram = 6.5mb ram?

Hi all! Sorry if this is common knowledge in ESP32 circles, but I’m relatively new to the platform and I could use some clarification on the settings being used to deploy to ESP32 boards with PSRAM.

In particular, I’m currently working with an M5Stack FIRE, which has been fun but soon I’ll be moving to a Seeed WT32-SC01, and I’ll be generating a board config for it. Looking at the existing m5stack-fire.json file, though, I see it listed as having "maximum_ram_size": 6553600. This is of particular interest to me as the WT32-SC01 has a very similar RAM layout, and if I’m going to be spinning up a board JSON for it, I’d like to understand why the RAM is set to 6.5MB for the Fire before I get moving.

Thanks in advance!
Conrad

Okay so first all there has been some sort of mixup with flash and RAM sizes on the PlatformIO side.

The original sizes come from the Arduino core. There they declare

Whee maximum_size is the maximum flash usage of the application, and maximum_data_size is the maximum RAM usage. The current PlatformIO board def seems to have that one flipped around…

it daclares 16MB maximum_size, aka flash, and it took the 6553600 flash value as RAM. I’ll open a bug for this. Note that maximum_size is updated on the fly anyways according to the partition table, so maximum_size declarations aren’t really important.

In any case, per M5Core FIRE - Makerfactory Documentation the board has 4MB of PSRAM, not 8MB. (and 16MByte of flash).

A standard ESP32Dev board with “just” an ESP32 is declared to have

I can tell you how that maximum_data_size=4521984 (aka 4.31MB) number makes sense. So per above the ESP32 without PSRAM has 327680 (320kByte) RAM free, and with 4 MB of PSRAM…

>>> 327680 + (4*1024*1024)
4521984

We get to that exact

m5stack-fire.upload.maximum_data_size=4521984

number.

Issue Flash / RAM size mixup in board definition · Issue #596 · platformio/platform-espressif32 · GitHub is open for that.

Thank you for the clarification, and for opening that issue! Glad I asked. :blush: