Skip to content

ESP32-S3/C3: size report counts .dram0.dummy as RAM and again as flash (2.5.51) #2013

Open

Description

@stevenmunn312-tech

Summary

On an ESP32-S3 and an ESP32-C3, fbuild's size report counts the .dram0.dummy placeholder section as RAM, and then again as flash. An empty S3 sketch reads 63,164 bytes of RAM where its static RAM is 21,436, and 319,872 bytes of flash where firmware.bin is 278,144. A classic ESP32 has no such section and its figures are right.

Reproduce

fbuild 2.5.51+git.9b26affea5ad, Windows 11, 2026-11-14. Each project is this platformio.ini with the board changed, and an empty sketch:

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
#include <Arduino.h>
void setup() {}
void loop() {}
Board Reported flash Reported RAM firmware.bin .dram0.data + .dram0.bss .dram0.dummy
esp32-s3-devkitc-1 319,872 63,164 278,144 21,436 41,728
esp32-c3-devkitm-1 304,734 60,770 268,112 13,154 47,616
esp32dev 273,065 22,065 273,216 22,065 none

Cause

parse_esp32_size_sysv in crates/fbuild-build-esp/src/esp32/size_report.rs puts every section whose name starts with .dram0. into RAM, as bss when the name contains .bss and as data otherwise. .dram0.dummy is the linker script's placeholder for the part of the shared region the IRAM sections occupy: it is NOBITS and holds no data. It lands in the data term, so:

  • RAM = data + bss includes it. On the S3: 14,468 + 6,968 + 41,728 = 63,164.
  • total_flash = flash + data includes it too. On the S3: 263,676 + 14,468 + 41,728 = 319,872.

Both reported figures match that arithmetic to the byte on the S3 and the C3. The S3's allocated sections:

Section Size Type
.rtc.force_slow 32 PROGBITS
.iram0.vectors 1,028 PROGBITS
.iram0.text 56,939 PROGBITS
.dram0.dummy 41,728 NOBITS
.dram0.data 14,468 PROGBITS
.dram0.bss 6,968 NOBITS
.flash.text 133,624 PROGBITS
.flash.appdesc 256 PROGBITS
.flash.rodata 71,684 PROGBITS
.iram0.text_end 145 NOBITS

Two smaller things in the same function, for whoever touches it:

  • .iram0.text_end (NOBITS) is counted as flash.
  • .eh_frame and .rtc.force_slow are in the image and are not counted. On the C3 .eh_frame is 11,044 bytes.

Impact

On a 320 KB part the S3 line reads 19.3% of RAM for an empty sketch that uses 6.5%. Design Studio for FastLED shows these numbers in its capacity meter; it now subtracts the placeholder itself.

Expected

Leave .dram0.dummy out of both totals, or count only sections that have contents toward flash and only data and bss toward RAM.

History

This replaces an earlier note of mine about 255 KB of extra .eh_frame in fbuild's ESP32 images (FastLED 3.10.5, fbuild 2.5.44). That gap is gone on FastLED 3.10.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions