From 4cffa848f60b4d403a8edb4c87a6cd12e6d89993 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 1 Nov 2023 10:38:52 +1100 Subject: [PATCH] esp32/boards: Reduce size of D2WD and OTA firmware. Commit c4e63ace661df9748cfae451bde7781e61e0b3d9 enabled the SPI Ethernet driver and that cost about 13k of firwmare size, pushing the firmware over the limit of the D2WD and OTA board variants available size. To fix, disable SPI Ethernet on the D2WD variant, and build the OTA variant with size optimisation rather than performance optimisation. Signed-off-by: Damien George --- ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd | 3 +++ ports/esp32/boards/ESP32_GENERIC/sdkconfig.ota | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd index 7b4313b7de..f6e07893e9 100644 --- a/ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd +++ b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.d2wd @@ -3,6 +3,9 @@ CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_PERF=n CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y +# Disable SPI Ethernet driver to reduce firmware size. +CONFIG_ETH_USE_SPI_ETHERNET=n + CONFIG_ESPTOOLPY_FLASHMODE_DIO=y CONFIG_ESPTOOLPY_FLASHFREQ_40M=y CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y diff --git a/ports/esp32/boards/ESP32_GENERIC/sdkconfig.ota b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.ota index e3a1f81fd3..352dd96f23 100644 --- a/ports/esp32/boards/ESP32_GENERIC/sdkconfig.ota +++ b/ports/esp32/boards/ESP32_GENERIC/sdkconfig.ota @@ -2,4 +2,6 @@ CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MiB-ota.csv" # Reduce firmware size to fit in the OTA partition. +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_PERF=n CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y