diff --git a/platforms/platformio.esp32c2.ini b/platforms/platformio.esp32c2.ini index cda2a13..3a6e628 100644 --- a/platforms/platformio.esp32c2.ini +++ b/platforms/platformio.esp32c2.ini @@ -13,5 +13,32 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/ board = esp32-c2-devkitm-1 framework = arduino +; ============================================================ +; SIZE OPTIMIZATION (recommended for production builds) +; ------------------------------------------------------------ +; Drops a Blink-class build ~35-40% by killing the default +; debug-log strings, libstdc++ exception machinery, and +; per-function-section bloat. Comment out (or set +; build_type = debug) when you need verbose logs / exception +; decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +; ============================================================ +build_type = release +build_flags = + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g + lib_deps = FastLED \ No newline at end of file diff --git a/platforms/platformio.esp32c3.ini b/platforms/platformio.esp32c3.ini index 393b17f..61385f6 100644 --- a/platforms/platformio.esp32c3.ini +++ b/platforms/platformio.esp32c3.ini @@ -18,5 +18,32 @@ framework = arduino ; connected — boards powered from a wall adapter then hang in setup() the ; moment user code touches Serial. Leave Serial on the UART (default). +; ============================================================ +; SIZE OPTIMIZATION (recommended for production builds) +; ------------------------------------------------------------ +; Drops a Blink-class build ~35-40% by killing the default +; debug-log strings, libstdc++ exception machinery, and +; per-function-section bloat. Comment out (or set +; build_type = debug) when you need verbose logs / exception +; decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +; ============================================================ +build_type = release +build_flags = + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g + lib_deps = FastLED \ No newline at end of file diff --git a/platforms/platformio.esp32c5.ini b/platforms/platformio.esp32c5.ini index 80dbb88..60e623a 100644 --- a/platforms/platformio.esp32c5.ini +++ b/platforms/platformio.esp32c5.ini @@ -17,9 +17,30 @@ framework = arduino ; Without these the FastLED PARLIO TX ISR sits in flash and takes cache-miss ; stalls during execution, silently corrupting LED protocol timing. ; See FastLED src/platforms/esp/32/drivers/parlio/ for the canonical chipset list. +; +; SIZE OPTIMIZATION (lines below the PARLIO flags) drops a Blink-class build +; ~35-40% by killing default debug-log strings, libstdc++ exception machinery, +; and per-function-section bloat. Comment them out (or set build_type = debug) +; when you need verbose logs / exception decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +build_type = release build_flags = -DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 -DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1 + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g lib_deps = FastLED diff --git a/platforms/platformio.esp32c6.ini b/platforms/platformio.esp32c6.ini index 78d7177..201a013 100644 --- a/platforms/platformio.esp32c6.ini +++ b/platforms/platformio.esp32c6.ini @@ -35,9 +35,30 @@ monitor_filters = ; interface, which only enumerates when a USB host is connected — sketches ; that touch Serial in setup() then hang when the board is powered from a ; wall adapter instead of a PC. +; +; SIZE OPTIMIZATION (lines below the PARLIO flags) drops a Blink-class build +; ~35-40% by killing default debug-log strings, libstdc++ exception machinery, +; and per-function-section bloat. Comment them out (or set build_type = debug) +; when you need verbose logs / exception decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +build_type = release build_flags = -DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 -DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1 + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g board_build.flash_mode = dio board_upload.flash_size = 4MB diff --git a/platforms/platformio.esp32dev.ini b/platforms/platformio.esp32dev.ini index 7554e1d..678755b 100644 --- a/platforms/platformio.esp32dev.ini +++ b/platforms/platformio.esp32dev.ini @@ -13,5 +13,37 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/ board = esp32dev framework = arduino +; ============================================================ +; SIZE OPTIMIZATION (recommended for production builds) +; ------------------------------------------------------------ +; Without these flags, a FastLED + Arduino-ESP32 build typically +; links a ~600 KB binary because the default Arduino-ESP32 build +; carries CORE_DEBUG_LEVEL=5 (every log string compiled in), +; full libstdc++ exception machinery, and unstripped per-function +; sections. With them you drop ~35-40% (Blink: 631 KB -> 408 KB +; in FastLED's own CI). +; +; Want verbose ESP-IDF logs / exception decoder while developing? +; Comment out the block below OR set build_type = debug. +; +; Reference: https://github.com/FastLED/FastLED/pull/3268 +; ============================================================ +build_type = release +build_flags = + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g + lib_deps = FastLED \ No newline at end of file diff --git a/platforms/platformio.esp32h2.ini b/platforms/platformio.esp32h2.ini index fe4708f..d803c35 100644 --- a/platforms/platformio.esp32h2.ini +++ b/platforms/platformio.esp32h2.ini @@ -17,9 +17,30 @@ framework = arduino ; Without these the FastLED PARLIO TX ISR sits in flash and takes cache-miss ; stalls during execution, silently corrupting LED protocol timing. ; See FastLED src/platforms/esp/32/drivers/parlio/ for the canonical chipset list. +; +; SIZE OPTIMIZATION (lines below the PARLIO flags) drops a Blink-class build +; ~35-40% by killing default debug-log strings, libstdc++ exception machinery, +; and per-function-section bloat. Comment them out (or set build_type = debug) +; when you need verbose logs / exception decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +build_type = release build_flags = -DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 -DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1 + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g lib_deps = FastLED diff --git a/platforms/platformio.esp32p4.ini b/platforms/platformio.esp32p4.ini index 0ca70b3..f39a2c0 100644 --- a/platforms/platformio.esp32p4.ini +++ b/platforms/platformio.esp32p4.ini @@ -28,9 +28,30 @@ board_build.partitions = huge_app.csv ; it has no effect on Serial routing while CDC_ON_BOOT=0, so we leave it ; unset here. P4's upstream default is 0 (TinyUSB); C3/C5/C6/H2 force it to ; 1 (HWCDC) via platform.txt. +; +; SIZE OPTIMIZATION (lines below the PARLIO flags) drops a Blink-class build +; ~35-40% by killing default debug-log strings, libstdc++ exception machinery, +; and per-function-section bloat. Comment them out (or set build_type = debug) +; when you need verbose logs / exception decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +build_type = release build_flags = -DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 -DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1 + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g lib_deps = FastLED diff --git a/platforms/platformio.esp32s2.ini b/platforms/platformio.esp32s2.ini index 605e1b8..85a2124 100644 --- a/platforms/platformio.esp32s2.ini +++ b/platforms/platformio.esp32s2.ini @@ -13,5 +13,32 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/ board = lolin_s2_mini framework = arduino +; ============================================================ +; SIZE OPTIMIZATION (recommended for production builds) +; ------------------------------------------------------------ +; Drops a Blink-class build ~35-40% by killing the default +; debug-log strings, libstdc++ exception machinery, and +; per-function-section bloat. Comment out (or set +; build_type = debug) when you need verbose logs / exception +; decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +; ============================================================ +build_type = release +build_flags = + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g + lib_deps = FastLED \ No newline at end of file diff --git a/platforms/platformio.esp32s3.ini b/platforms/platformio.esp32s3.ini index c0877d3..41c095b 100644 --- a/platforms/platformio.esp32s3.ini +++ b/platforms/platformio.esp32s3.ini @@ -23,10 +23,36 @@ upload_protocol = esptool ; The exception decoder is a useful tool for debugging that is difficult ; to enable in the Arduino IDE. But in platformio it will decode the ; 0x0f4852c0 addreesses into the actual function names. -monitor_filters = +monitor_filters = default esp32_exception_decoder +; ============================================================ +; SIZE OPTIMIZATION (recommended for production builds) +; ------------------------------------------------------------ +; Drops a Blink-class build ~35-40% by killing the default +; debug-log strings, libstdc++ exception machinery, and +; per-function-section bloat. Comment out (or set +; build_type = debug) when you need verbose logs / exception +; decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +; ============================================================ +build_type = release +build_flags = + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g lib_deps = FastLED diff --git a/platforms/platformio.esp8266.ini b/platforms/platformio.esp8266.ini index 8bbf0ef..9c4cb7c 100644 --- a/platforms/platformio.esp8266.ini +++ b/platforms/platformio.esp8266.ini @@ -13,5 +13,30 @@ platform = espressif8266 board = esp01 framework = arduino +; ============================================================ +; SIZE OPTIMIZATION (recommended for production builds) +; ------------------------------------------------------------ +; ESP8266 is tighter on flash than ESP32 and benefits even more +; from the strip flags. Comment out (or set build_type = debug) +; if you need verbose logs / exception decoding while developing. +; Note: ESP8266 uses NONOS SDK so the ESP-IDF-only +; CORE_DEBUG_LEVEL / ESP_LOG_NONE defines aren't applicable here. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +; ============================================================ +build_type = release +build_flags = + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g + lib_deps = FastLED \ No newline at end of file diff --git a/platforms/platformio.lpc804.ini b/platforms/platformio.lpc804.ini index 71b8931..1558958 100644 --- a/platforms/platformio.lpc804.ini +++ b/platforms/platformio.lpc804.ini @@ -9,13 +9,12 @@ ; (clockless_arm_lpc_plu.h) by uncommenting -DFASTLED_LPC_PLU below. The ; PLU synthesizes the bitstream in the chip's 26-LUT hardware fabric. ; -; The platform package is NOT in the upstream PlatformIO registry. We use -; the zackees/platform-nxplpc-arduino fork (adds the Arduino framework -; binding via ArduinoCore-LPC8xx). The SHA below is pinned to match -; FastLED master's own platformio.ini. +; The platform package isn't in the upstream PlatformIO registry; we use +; the zackees/platform-nxplpc-arduino package, which adds the Arduino +; framework binding for the LPC8xx parts via ArduinoCore-LPC8xx. [env:lpc804] -platform = https://github.com/zackees/platform-nxplpc-arduino.git#2ee527ae80de98e9105329a7260edb003289dfda +platform = https://github.com/zackees/platform-nxplpc-arduino.git#main board = lpc804 framework = arduino diff --git a/platforms/platformio.lpc845.ini b/platforms/platformio.lpc845.ini index 3c07091..68eabef 100644 --- a/platforms/platformio.lpc845.ini +++ b/platforms/platformio.lpc845.ini @@ -7,13 +7,12 @@ ; m0clockless_c.h) by default. For the SCT+DMA fast path see the ; lpc845brk env (-DFASTLED_LPC_PWM_DMA=1). ; -; The platform package is NOT in the upstream PlatformIO registry. We use -; the zackees/platform-nxplpc-arduino fork (adds the Arduino framework -; binding via ArduinoCore-LPC8xx). The SHA below is pinned to match -; FastLED master's own platformio.ini. +; The platform package isn't in the upstream PlatformIO registry; we use +; the zackees/platform-nxplpc-arduino package, which adds the Arduino +; framework binding for the LPC8xx parts via ArduinoCore-LPC8xx. [env:lpc845] -platform = https://github.com/zackees/platform-nxplpc-arduino.git#2ee527ae80de98e9105329a7260edb003289dfda +platform = https://github.com/zackees/platform-nxplpc-arduino.git#main board = lpc845 framework = arduino diff --git a/platforms/platformio.lpc845brk.ini b/platforms/platformio.lpc845brk.ini index 23d0c15..0d351b8 100644 --- a/platforms/platformio.lpc845brk.ini +++ b/platforms/platformio.lpc845brk.ini @@ -7,13 +7,12 @@ ; (clockless_arm_lpc_pwm_dma.h — SCT + 3-channel DMA-to-GPIO). Drop the ; FASTLED_LPC_PWM_DMA flag if you'd rather use the plain bit-bang driver. ; -; The platform package is NOT in the upstream PlatformIO registry. We use -; the zackees/platform-nxplpc-arduino fork (adds the Arduino framework -; binding via ArduinoCore-LPC8xx). The SHA below is pinned to match -; FastLED master's own platformio.ini. +; The platform package isn't in the upstream PlatformIO registry; we use +; the zackees/platform-nxplpc-arduino package, which adds the Arduino +; framework binding for the LPC8xx parts via ArduinoCore-LPC8xx. [env:lpc845brk] -platform = https://github.com/zackees/platform-nxplpc-arduino.git#2ee527ae80de98e9105329a7260edb003289dfda +platform = https://github.com/zackees/platform-nxplpc-arduino.git#main board = lpc845brk framework = arduino diff --git a/platforms/platformio.lpcxpresso804.ini b/platforms/platformio.lpcxpresso804.ini index f48d670..3bd99a2 100644 --- a/platforms/platformio.lpcxpresso804.ini +++ b/platforms/platformio.lpcxpresso804.ini @@ -8,13 +8,12 @@ ; uncommenting -DFASTLED_LPC_PLU below — the plain bit-bang driver cannot ; meet WS2812 timing at this clock speed. ; -; The platform package is NOT in the upstream PlatformIO registry. We use -; the zackees/platform-nxplpc-arduino fork (adds the Arduino framework -; binding via ArduinoCore-LPC8xx). The SHA below is pinned to match -; FastLED master's own platformio.ini. +; The platform package isn't in the upstream PlatformIO registry; we use +; the zackees/platform-nxplpc-arduino package, which adds the Arduino +; framework binding for the LPC8xx parts via ArduinoCore-LPC8xx. [env:lpcxpresso804] -platform = https://github.com/zackees/platform-nxplpc-arduino.git#2ee527ae80de98e9105329a7260edb003289dfda +platform = https://github.com/zackees/platform-nxplpc-arduino.git#main board = lpcxpresso804 framework = arduino diff --git a/platforms/platformio.lpcxpresso845max.ini b/platforms/platformio.lpcxpresso845max.ini index 4b78f85..93822d5 100644 --- a/platforms/platformio.lpcxpresso845max.ini +++ b/platforms/platformio.lpcxpresso845max.ini @@ -6,13 +6,12 @@ ; FastLED uses the bit-bang clockless driver by default on this env. ; To opt into the SCT+DMA fast path add: -DFASTLED_LPC_PWM_DMA=1 ; -; The platform package is NOT in the upstream PlatformIO registry. We use -; the zackees/platform-nxplpc-arduino fork (adds the Arduino framework -; binding via ArduinoCore-LPC8xx). The SHA below is pinned to match -; FastLED master's own platformio.ini. +; The platform package isn't in the upstream PlatformIO registry; we use +; the zackees/platform-nxplpc-arduino package, which adds the Arduino +; framework binding for the LPC8xx parts via ArduinoCore-LPC8xx. [env:lpcxpresso845max] -platform = https://github.com/zackees/platform-nxplpc-arduino.git#2ee527ae80de98e9105329a7260edb003289dfda +platform = https://github.com/zackees/platform-nxplpc-arduino.git#main board = lpcxpresso845max framework = arduino diff --git a/platforms/platformio.seeed_xiao_esp32s3.ini b/platforms/platformio.seeed_xiao_esp32s3.ini index 7edff01..4382589 100644 --- a/platforms/platformio.seeed_xiao_esp32s3.ini +++ b/platforms/platformio.seeed_xiao_esp32s3.ini @@ -13,5 +13,32 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/ board = seeed_xiao_esp32s3 framework = arduino +; ============================================================ +; SIZE OPTIMIZATION (recommended for production builds) +; ------------------------------------------------------------ +; Drops a Blink-class build ~35-40% by killing the default +; debug-log strings, libstdc++ exception machinery, and +; per-function-section bloat. Comment out (or set +; build_type = debug) when you need verbose logs / exception +; decoding while developing. +; Reference: https://github.com/FastLED/FastLED/pull/3268 +; ============================================================ +build_type = release +build_flags = + -DCORE_DEBUG_LEVEL=0 + -DLOG_LOCAL_LEVEL=ESP_LOG_NONE + -Os + -fno-exceptions + -fno-rtti + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -ffunction-sections + -fdata-sections + -flto=auto + -Wl,--gc-sections +build_unflags = + -Og + -g + lib_deps = FastLED \ No newline at end of file