esp32/boards: Enable size optimisation for builds.

This enables -Os for compilation, but still keeps full assertion messages.
With IDF v4.2, -Os changes the GENERIC firmware size from 1512176 down to
1384640, and the GENERIC_SPIRAM firmware is now 1452320 which fits in the
allocated partition.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2021-02-18 11:51:01 +11:00
parent d4b45898f5
commit 466ad35a72

View File

@ -4,6 +4,12 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000
# Compiler options: use -Os to reduce size, but keep full assertions
# (CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is for IDF 4.0.2)
CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
# Application manager
CONFIG_APP_EXCLUDE_PROJECT_VER_VAR=y
CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR=y