From 9a9cc794222e6791d3d615aee4e32a06c5aeb1be Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 27 Aug 2025 16:51:02 +1000 Subject: [PATCH] esp32/boards: Build ESP32-C2 and C3 with -Os instead of -O2. Same optimisation that was applied to C6 in the parent commit, now applied to all RISC-V boards. +------------+------------+------------+------------+ | Size | Before | After | Delta | +------------+------------+------------+------------+ | C2 Binary | 1680384 | 1494224 | -186160 | | C2 D/IRAM | 83710 | 79080 | -4630 | | C3 Binary | 1833328 | 1636624 | -196704 | | C3 D/IRAM | 139608 | 131896 | -7712 | +------------+------------+------------+------------+ This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton --- ports/esp32/boards/ESP32_GENERIC_C2/mpconfigboard.cmake | 1 + ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.cmake | 1 + .../boards/GARATRONIC_PYBSTICK26_ESP32C3/mpconfigboard.cmake | 1 + ports/esp32/boards/LOLIN_C3_MINI/mpconfigboard.cmake | 1 + 4 files changed, 4 insertions(+) diff --git a/ports/esp32/boards/ESP32_GENERIC_C2/mpconfigboard.cmake b/ports/esp32/boards/ESP32_GENERIC_C2/mpconfigboard.cmake index 7a8b0e0b3d..6a59e8a25e 100644 --- a/ports/esp32/boards/ESP32_GENERIC_C2/mpconfigboard.cmake +++ b/ports/esp32/boards/ESP32_GENERIC_C2/mpconfigboard.cmake @@ -2,6 +2,7 @@ set(IDF_TARGET esp32c2) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base + boards/sdkconfig.riscv boards/sdkconfig.ble boards/sdkconfig.c2 # C2 has unusably low free RAM without these optimisations diff --git a/ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.cmake b/ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.cmake index 429366afac..41b32b84c8 100644 --- a/ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.cmake +++ b/ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.cmake @@ -2,6 +2,7 @@ set(IDF_TARGET esp32c3) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base + boards/sdkconfig.riscv boards/sdkconfig.ble boards/ESP32_GENERIC_C3/sdkconfig.c3usb ) diff --git a/ports/esp32/boards/GARATRONIC_PYBSTICK26_ESP32C3/mpconfigboard.cmake b/ports/esp32/boards/GARATRONIC_PYBSTICK26_ESP32C3/mpconfigboard.cmake index 81cfff1d77..81d7f6b7ca 100644 --- a/ports/esp32/boards/GARATRONIC_PYBSTICK26_ESP32C3/mpconfigboard.cmake +++ b/ports/esp32/boards/GARATRONIC_PYBSTICK26_ESP32C3/mpconfigboard.cmake @@ -2,6 +2,7 @@ set(IDF_TARGET esp32c3) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base + boards/sdkconfig.riscv boards/sdkconfig.ble boards/GARATRONIC_PYBSTICK26_ESP32C3/sdkconfig.board ) diff --git a/ports/esp32/boards/LOLIN_C3_MINI/mpconfigboard.cmake b/ports/esp32/boards/LOLIN_C3_MINI/mpconfigboard.cmake index 0ce7f85e5d..4ecc719566 100644 --- a/ports/esp32/boards/LOLIN_C3_MINI/mpconfigboard.cmake +++ b/ports/esp32/boards/LOLIN_C3_MINI/mpconfigboard.cmake @@ -2,6 +2,7 @@ set(IDF_TARGET esp32c3) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base + boards/sdkconfig.riscv boards/sdkconfig.ble boards/LOLIN_C3_MINI/sdkconfig.board )