Skip to content

Reduce firmware size on ESP8266#874

Open
brentru wants to merge 7 commits intomainfrom
v1-esp8266-build-sz
Open

Reduce firmware size on ESP8266#874
brentru wants to merge 7 commits intomainfrom
v1-esp8266-build-sz

Conversation

@brentru
Copy link
Member

@brentru brentru commented Mar 6, 2026

This pull request reduces the ESP8266 build's size by -34.1%.

Changes:

  • On ESP8266, we now use the F() macro to store string literals in Flash (PROGMEM) instead of RAM. This saves precious RAM on memory-constrained ESP8266 devices.
    • NOTE: WS_DEBUG_PRINT/PRINTLN only accepts string literals on ESP8266, so use WS_DEBUG_PRINTVAR/PRINTLNVAR for variables on this platform.
    • NOTE: For other platforms, use the standard variadic macros
  • PROGMEM macro introduced in display/ for storing icons and splash screen assets

Build Size Comparison

main branch:

RAM:   [==========]  96.9% (used 79396 bytes from 81920 bytes)
Flash: [======    ]  64.7% (used 675507 bytes from 1044464 bytes)

This branch:

RAM:   [======    ]  62.8% (used 51456 bytes from 81920 bytes)
Flash: [=======   ]  65.0% (used 678923 bytes from 1044464 bytes)

Addresses:
#841 (needs fwd port to v2 after this PR is in)
#862

@brentru brentru requested a review from tyeth March 6, 2026 16:15
@brentru
Copy link
Member Author

brentru commented Mar 6, 2026

@tyeth in addition to reviewing, could you test on an ESP32 or ESP32-x platform to ensure the F() macro changes didn't introduce any unusual behavior on the Serial?

@brentru
Copy link
Member Author

brentru commented Mar 6, 2026

image works on 8266

@DoctorWho8
Copy link

So this now works?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants