From 94533f84c9acac8bf3f7dda555935a4acc4e9b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=27=C3=A9lectron=20rare?= <108685187+electron-rare@users.noreply.github.com> Date: Sun, 21 Jun 2026 10:34:32 +0200 Subject: [PATCH] build: shrink bootloader to fit iram Log level INFO pulls libc printf into IRAM (~15 KB), overflowing the fixed 12 KB iram_seg by 9787 bytes. Pin SIZE optimization and drop to WARN level to avoid the vfprintf/stdio chain. --- sdkconfig.defaults | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 4e020d8..5f6ba8e 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -10,6 +10,14 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_LOG_DEFAULT_LEVEL_INFO=y CONFIG_COMPILER_OPTIMIZATION_PERF=y +# --- Bootloader size: keep the 2nd-stage bootloader inside iram_seg ---------- +# Without these the bootloader links at -O2 (PERF) and pulls in the full +# libc printf machinery (svfiprintf ~9 KB) which overflows the 12 KB iram_seg. +# SIZE (-Os) reduces code but alone is not sufficient; dropping the log level +# from INFO to WARN removes the format-string I/O paths that pull libc stdio. +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y + # --- FreeRTOS ---------------------------------------------------------------- # 1 kHz tick gives smoother LVGL animations (bubble breathing, transitions). CONFIG_FREERTOS_HZ=1000