Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b98126

Browse files
projectgusdpgeorge
authored andcommitted
esp32/boards: Reduce flash usage of ESP32-C6 boards.
Reduces ESP32_GENERIC_C6 application flash size from 2024432 to 1813216 (206KB smaller). Also has benefit of reducing D/IRAM size, increasing free memory at runtime (167187 to 148584, -18603 bytes). Most of this savings comes from building with -Os instead of -O2, but about 10KB comes from using the SPI flash functions from the ROM. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
1 parent f0d445a commit 5b98126

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

ports/esp32/boards/ESP32_GENERIC_C6/mpconfigboard.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ set(IDF_TARGET esp32c6)
22

33
set(SDKCONFIG_DEFAULTS
44
boards/sdkconfig.base
5+
boards/sdkconfig.riscv
56
boards/sdkconfig.c6
67
boards/sdkconfig.ble
78
)

ports/esp32/boards/M5STACK_NANOC6/mpconfigboard.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ set(IDF_TARGET esp32c6)
22

33
set(SDKCONFIG_DEFAULTS
44
boards/sdkconfig.base
5+
boards/sdkconfig.riscv
56
boards/sdkconfig.c6
67
boards/sdkconfig.ble
78
)

ports/esp32/boards/UM_TINYC6/mpconfigboard.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ set(IDF_TARGET esp32c6)
22

33
set(SDKCONFIG_DEFAULTS
44
boards/sdkconfig.base
5+
boards/sdkconfig.riscv
56
boards/sdkconfig.c6
67
boards/sdkconfig.ble
78
boards/UM_TINYC6/sdkconfig.board

ports/esp32/boards/sdkconfig.c6

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
# Workaround for https://github.com/espressif/esp-idf/issues/14456
22
CONFIG_ESP_SYSTEM_HW_STACK_GUARD=n
3+
4+
# 802.15.4 not currently supported in MicroPython, disabling saves
5+
# a little compile time (no difference in binary)
6+
CONFIG_IEEE802154_ENABLED=n
7+
8+
# Using the SPI flash implementation in ROM saves about 10KB of binary size
9+
# (and some static RAM)
10+
CONFIG_SPI_FLASH_ROM_IMPL=y

ports/esp32/boards/sdkconfig.riscv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ESP RISC-V binary sizes are generally larger than Xtensa ones,
2+
# so switch to size optimization by default
3+
CONFIG_COMPILER_OPTIMIZATION_SIZE=y

0 commit comments

Comments
 (0)