Repository navigation
docs(esp32): ship tools/sdkconfig_for_smallest_fastled.defaults overlay (#2886 Stage 3) - #2896
Conversation
…rlay (#2886 Stage 3) Closes #2895. Adds a documented, opt-in ESP-IDF sdkconfig overlay that users plug into `board_build.sdkconfig_defaults`. Drops ~10-15 KB of release-build flash on a typical ESP32 LED installation by disabling IDF components that a deployed strip never uses: | Knob | Eliminates | Savings | |---|---|---:| | `CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=n` | libespcoredump (top-25 rows #18 + #25, ~3 KB symbols + ~5 KB tail) | ~8 KB | | `CONFIG_LOG_DEFAULT_LEVEL=ESP_LOG_NONE` | libesp_diagnostics + IDF log strings (top-25 row #19) | ~3 KB | | `CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y` | bootloader-stage UART chatter | ~1 KB | | `CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y` | panic-time backtrace formatter | ~1-2 KB | `CONFIG_BT_ENABLED=n` is shipped commented-out (~15 KB extra when the project currently has BT on) — users uncomment when they know their sketch doesn't touch BLE/BT. ## Files - `tools/sdkconfig_for_smallest_fastled.defaults` — the overlay itself, with inline per-knob comments grounding each line in the #2886 top-25 attribution. - `agents/docs/binary-size-analysis.md` — adds a "Release-build flash savers (in order of impact)" table that lists this overlay alongside the FASTLED_LOG_VERBOSITY default (#2890), the boot-banner shim (#2894), and FASTLED_RMT_STATIC_ALLOCATION (#2846). Single reference point for what knobs exist and how to enable them. ## Why a user-side overlay, not a library-side default `sdkconfig` is consumed by the ESP-IDF build before any FastLED TU is compiled. FastLED cannot mutate IDF defaults from a library; the deliverable here is therefore a *shippable overlay file* the user points `board_build.sdkconfig_defaults` at, plus documentation that tells them which lines map to which savings. ## User integration ``` [env:esp32s3] board_build.sdkconfig_defaults = sdkconfig.defaults ${platformio.packages_dir}/framework-arduinoespressif32/tools/sdkconfig.defaults.esp32s3 ${PROJECT_LIBDEPS_DIR}/${PIOENV}/FastLED/tools/sdkconfig_for_smallest_fastled.defaults ``` (See the file's header for the full snippet; `PROJECT_LIBDEPS_DIR` resolution varies by PIO project layout.) ## Verification - `bash lint --cpp` → C++ linting passes (this PR is docs-only; pre-existing PlatformIO-internal-usage warnings unchanged). - Per-project flash deltas are user-side measurements; the projection table in `binary-size-analysis.md` cites the #2886 top-25 baseline attribution for each line. Refs #2886, #2895.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughPR adds a new ESP-IDF sdkconfig overlay file ( ChangesRelease-build Flash Savers for ESP32-S3
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related Issues
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…tage 0) (#2898) Closes #2897. Adds a user-facing reference page that consolidates every release-build flash-saver FastLED currently ships into a single discoverable location. End users no longer have to grep across PRs and meta-issues to find the knobs. Sections: 1. **TL;DR** — a drop-in `platformio.ini` snippet that stacks Stages 1+2+3 and `FASTLED_RMT_STATIC_ALLOCATION` in one place. 2. **Baseline & how to measure** — pre-#2886 NEOPIXEL Blink baseline (388,380 B), Stage 6 target (≤ 280,000 B), `bash bloat esp32s3` pointer. 3. **Release-build flash savers (in priority order)** — five-row table with how-to-enable, savings, status (✅ measured vs. 📊 projected), and PR cross-link for each knob. 4. **Per-stage detail** — one section per shipped stage with the mechanism, file path, and integration snippet: - Stage 1 (`FASTLED_LOG_VERBOSITY=0`, now NDEBUG default) — #2890 - Stage 2 (`FASTLED_SUPPRESS_ARDUINO_CHIP_DEBUG_REPORT=1` build flag → strong override of vendor weak `shouldPrintChipDebugReport()`) — #2894 - Stage 3 (`tools/sdkconfig_for_smallest_fastled.defaults` overlay applied via `board_build.sdkconfig_defaults`) — #2896 - `FASTLED_RMT_STATIC_ALLOCATION=1` — #2846 (pre-existing) 5. **Situational notes** — Stage stacking, sdkconfig integration gotchas, `PROJECT_LIBDEPS_DIR` fallback. 6. **Measuring your build** — `bash bloat esp32s3` quickstart + diff pointer. 7. **Roadmap** — Stages 4 (cold-helper audit), 5 (basic_string::write simplification), 6 (CI regression gate). The ✅/📊 status flags on the priority table flip to ✅ when Stage 6 records measured deltas. Also adds a cross-reference from `agents/docs/binary-size-analysis.md` (the agent-facing reference shipped in #2896) to the new user-facing doc, with a maintenance note that future knobs must update both surfaces. ## Honesty about projections Every savings figure in this PR is marked 📊 (projected from the #2886 top-25 attribution). The ✅ status gets unlocked when Stage 6 of #2886 wires the regression-gate run that records measured baselines. The Roadmap section calls this out explicitly so readers know which numbers carry empirical weight. ## Verification - `bash lint --cpp` → all C++ linting checks pass; this PR adds no C++ code. - Doc references (`tools/sdkconfig_for_smallest_fastled.defaults`, `src/extras/suppress_arduino_chip_debug_report.cpp.hpp`, `src/fl/log/log.h:66-92`) verified against the post-#2896 tree. Refs #2886, #2897.
…rlay (#2916) Closes #2915. Adds the biggest missing single lever to the Stage 3 overlay file shipped in #2896. The standard newlib printf cluster — `_vfprintf_r` (11.3 KB), `_svfprintf_r` (11.1 KB), `_svfiprintf_r` (7.3 KB), `_vfiprintf_r` (7.3 KB), `_dtoa_r` (3.2 KB), `get_arg$isra$0` copies (4.9 KB cumulative) — collectively eats **~45 KB** on the post-#2911 ESP32-S3 NEOPIXEL Blink baseline (the largest non-FastLED cluster in the audit). Nano newlib drops it by 50-70%. ## Why this was missed The Stage 3 overlay #2896 targeted four sub-1.5 KB symbol clusters (coredump, IDF diag log, bootloader chatter, panic formatter) but left the dominant ~45 KB libc printf cluster unattended. Adding `CONFIG_NEWLIB_NANO_FORMAT=y` is a one-line config flip that's a larger lever than every other Stage 3 knob combined. ## The constraint Nano newlib printf has no `%f` / `%lf` / `%lld` / positional-arg support. Sketches that print floating-point values via printf will see literal format specifiers in the output instead of the formatted number. For LED installations this is rarely an issue — strip control code doesn't typically log floats. For sketches that DO need extended formats, the user either drops the overlay entirely or layers their own sdkconfig with `CONFIG_NEWLIB_NANO_FORMAT=n` after FastLED's. ## Files - `tools/sdkconfig_for_smallest_fastled.defaults` — new entry with inline constraint documentation, placed in the "Conservative knobs" section (it qualifies because most LED installations don't print floats). - `docs/SLIM_ESP32S3.md` — row 2 of the priority table updated from `~10-15 KB` → `~30-45 KB`. Stage 3 detail section's knob table expanded from 4 → 5 rows with the nano-newlib entry at the top, plus a new constraint sidebar. - `agents/docs/binary-size-analysis.md` — agent-facing copy of the priority table mirrors the SLIM doc update. ## Verification - `bash lint --cpp` → all C++ linting checks pass (this PR doesn't touch C++). - The overlay file remains opt-in (users must wire it into `board_build.sdkconfig_defaults` themselves). Default behavior is unchanged for users who haven't already chosen the overlay. - Measured savings will be validated on a follow-up build with the overlay applied. Expected: ~20-30 KB drop in `total_flash` vs current baseline (`347,004 B`). ## Expected savings - Pre-overlay (Stage 1 only): 347,004 B (current measured baseline). - Post-overlay (Stages 1+3 with nano printf): ≈ 347,004 - 25,000 = ~322,000 B (projected). - Gap to #2886 end-goal (280,000 B): ~42 KB remaining, most of which lives in #2856 (structural meta). The Stage 6 regression gate baseline does NOT change in this PR (the default-flag build is unchanged). A follow-up PR records the measured number after a build with the overlay applied. Refs #2886, #2915, #2896, #2906.
docs(esp32): ship
tools/sdkconfig_for_smallest_fastled.defaultsoverlay (#2886 Stage 3)Closes #2895.
Adds a documented, opt-in ESP-IDF sdkconfig overlay that users plug into
board_build.sdkconfig_defaults. Drops ~10-15 KB of release-build flashon a typical ESP32 LED installation by disabling IDF components that a
deployed strip never uses:
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=nCONFIG_LOG_DEFAULT_LEVEL=ESP_LOG_NONECONFIG_BOOTLOADER_LOG_LEVEL_NONE=yCONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=yCONFIG_BT_ENABLED=nis shipped commented-out (~15 KB extra when theproject currently has BT on) — users uncomment when they know their
sketch doesn't touch BLE/BT.
Files
tools/sdkconfig_for_smallest_fastled.defaults— the overlayitself, with inline per-knob comments grounding each line in the
Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886 top-25 attribution.
agents/docs/binary-size-analysis.md— adds a "Release-build flashsavers (in order of impact)" table that lists this overlay
alongside the FASTLED_LOG_VERBOSITY default (perf(log): default FASTLED_LOG_VERBOSITY=0 in release builds (#2886 Stage 1) #2890), the boot-banner
shim (perf(esp32): suppress Arduino-ESP32 boot banner via build-flag shim (#2886 Stage 2) #2894), and FASTLED_RMT_STATIC_ALLOCATION (feat(rmt5): FASTLED_RMT_STATIC_ALLOCATION opt-in macro (#2773 item 2.5 Level A) #2846). Single
reference point for what knobs exist and how to enable them.
Why a user-side overlay, not a library-side default
sdkconfigis consumed by the ESP-IDF build before any FastLED TU iscompiled. FastLED cannot mutate IDF defaults from a library; the
deliverable here is therefore a shippable overlay file the user
points
board_build.sdkconfig_defaultsat, plus documentation thattells them which lines map to which savings.
User integration
(See the file's header for the full snippet;
PROJECT_LIBDEPS_DIRresolution varies by PIO project layout.)
Verification
bash lint --cpp→ C++ linting passes (this PR is docs-only;pre-existing PlatformIO-internal-usage warnings unchanged).
table in
binary-size-analysis.mdcites the Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886 top-25 baselineattribution for each line.
Refs #2886, #2895.
Summary by CodeRabbit
Documentation
New Features