Repository navigation
Description
Goal
Ship a documented sdkconfig overlay (tools/sdkconfig_for_smallest_fastled.defaults) that users plug into their PlatformIO project via board_build.sdkconfig_defaults to disable ESP-IDF components FastLED never uses on a release LED strip.
Projected savings: ~10-15 KB on the ESP32-S3 NEOPIXEL Blink baseline (mid-bound; up to ~30 KB if CONFIG_BT_ENABLED=n is also flipped on a project that currently has BT on).
Parent: #2886 — Stage 3 of the multi-stage bloat-reduction plan.
Why this is a user-side overlay, not a FastLED-side default
The four ESP-IDF knobs targeted below ship from Espressif at values appropriate for a general-purpose Arduino-ESP32 sketch (where users may rely on coredump-to-flash, the IDF log infrastructure, or BT). FastLED cannot change those defaults from a library — sdkconfig is consumed by the IDF build before any FastLED TU is compiled. The Stage 3 deliverable is therefore a shippable overlay file that users add to board_build.sdkconfig_defaults plus documentation telling them which lines map to which savings.
Per the meta in #2886, this is the largest Stage in absolute byte terms because each knob disables a multi-KB IDF component.
The overlay file
Path: tools/sdkconfig_for_smallest_fastled.defaults
Initial contents (each entry grounded against the top-25 symbol table in #2886):
# Disable coredump-to-flash. Eliminates symbols #18 (esp_core_dump_do_write_elf_pass,
# 1,835 B) and #25 (esp_core_dump_get_task_regs_dump, 1,103 B) plus ~5 KB of tail
# symbols in libespcoredump.a. See #2886 top-25 rows 18 & 25.
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=n
# Drop the ESP-IDF runtime log infrastructure (separate from FastLED's FL_WARN/
# FL_LOG — that path is governed by FASTLED_LOG_VERBOSITY, see #2886 Stage 1).
# Eliminates symbol #19 (diag_log_add, 1,604 B) and ~1-2 KB of IDF log strings
# scattered through libesp_diagnostics, libespressif__esp_diagnostics, libheap.
CONFIG_LOG_DEFAULT_LEVEL=ESP_LOG_NONE
# Silence the bootloader's per-stage progress messages. The strings live in
# flash regardless of whether the bootloader actually runs them at boot.
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
# Switch the panic handler from "reboot with backtrace" to "halt with minimal
# state dump". On a release LED installation a panic-time reboot loop is more
# disruptive than a halt; the smaller code path also drops the panic-time
# formatter strings.
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=yEach line is documented in-place so a user reading the file knows what they're trading off.
Documentation deliverable: add a "Stage 3 — IDF overlay" section to docs/SLIM_ESP32S3.md (Stage 0 of #2886 once that doc lands) and to agents/docs/binary-size-analysis.md under "release-build flash savers", citing the overlay path plus the per-knob savings table.
User integration
In platformio.ini:
[env:esp32s3]
platform = espressif32
board = esp32-s3-devkitm-1
framework = arduino
board_build.sdkconfig_defaults =
sdkconfig.defaults
${env.LIBRARY_PATH}/FastLED/tools/sdkconfig_for_smallest_fastled.defaultsThe user's own sdkconfig.defaults (if any) wins on conflict; the FastLED overlay only adds knobs the user hasn't already set.
Why each knob is safe for a typical LED strip
| Knob | What it disables | Why it's safe |
|---|---|---|
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=n |
Crash-time coredump to flash partition | LED installations are headless; no one will retrieve a coredump from the flash partition anyway. Add it back if the user actually post-mortems crashes. |
CONFIG_LOG_DEFAULT_LEVEL=ESP_LOG_NONE |
IDF runtime log messages | FastLED's FL_WARN/FL_LOG path is independent (Stage 1 governs that). The IDF log strings are noise that the LED installation never reads. |
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y |
Bootloader-stage UART chatter | The bootloader output is only visible on a connected serial console at power-on. A deployed installation has no console. |
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y |
Panic-time backtrace formatter | The _REBOOT default just rolls into a reset loop on persistent faults. _HALT is the right behavior for a fixed installation that should be visibly stuck rather than thrashing power. |
Out of scope
CONFIG_BT_ENABLED=n— situational (only saves bytes on projects that currently have BT on). Document the knob in the overlay file as a commented-out section with a usage note, but don't enable by default; users must opt in by uncommenting.docs/SLIM_ESP32S3.mditself — that's Stage 0 of Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886.- A CMake
CONFIG_FREERTOS_*audit — out of scope for Stage 3; the freertos knobs interact with thread / queue counts that user code may depend on. Track separately ifbash bloat esp32s3ever shows libfreertos.a as a top contributor.
Acceptance
tools/sdkconfig_for_smallest_fastled.defaultsexists with the four knobs above, each commented inline with its Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886 top-25 attribution.- A short README or in-file usage block at the top explains the
board_build.sdkconfig_defaultsintegration. - The user-facing docs (
agents/docs/binary-size-analysis.md) link to the overlay and quote per-knob savings. bash bloat esp32s3 --buildwith the overlay applied vs. without shows ≥ 8 KB delta on a Blink build (mid-bound conservative; the projection in Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886 is 10-15 KB but builds vary).
Related
- Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886 — parent meta tracking the multi-stage bloat reduction (Stage 3 of 6).
- perf(log): default FASTLED_LOG_VERBOSITY=0 in release builds (#2886 Stage 1) #2890 — Stage 1 (FASTLED_LOG_VERBOSITY default flip), merged at
0674ccdd8e. - perf(esp32): suppress Arduino-ESP32 boot banner via build-flag shim (#2886 Stage 2) #2894 — Stage 2 (Arduino-ESP32 boot-banner suppression shim).
agents/docs/binary-size-analysis.md— thebash bloatwrapper this issue's acceptance gate uses.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
docs(esp32): ship `tools/sdkconfig_for_smallest_fastled.defaults` ove…