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 <angus@redyak.com.au>
This commit is contained in:
Angus Gratton
2025-08-27 16:51:02 +10:00
committed by Damien George
parent 5b98126c21
commit 9a9cc79422
4 changed files with 4 additions and 0 deletions

View File

@@ -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

View File

@@ -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
)

View File

@@ -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
)

View File

@@ -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
)