platformio: speed version for ESP32-S3, minor updates

* added [env:esp32S3_8MB_S] with optimization for speed
* minor cleanups for MM environments
This commit is contained in:
Frank
2023-07-23 23:45:57 +02:00
parent e64aff28e7
commit 5837df8ef4

View File

@@ -64,8 +64,10 @@ default_envs =
; wemos_shield_esp32_16MB_LineIn_M ; wemos_shield_esp32_16MB_LineIn_M
esp32_pico_4MB_M esp32_pico_4MB_M
esp32_4MB_PSRAM_S esp32_4MB_PSRAM_S
; esp32_4MB_PSRAM_REV3_S ;; experimental, optimized for WROVER-E with "revision3" chip
esp32S3_8MB_M esp32S3_8MB_M
;; esp32S3_8MB_PSRAM_M ;; experiemental ;; esp32S3_8MB_PSRAM_M ;; experiemental
;; esp32S3_8MB_S ;; experimental, optimized for speed
;; esp32s2_tinyUF2_PSRAM_S ;; experimental - only for adafruit -S2 boards with tinyUF2 bootloader !!! ;; esp32s2_tinyUF2_PSRAM_S ;; experimental - only for adafruit -S2 boards with tinyUF2 bootloader !!!
esp32s2_PSRAM_M ;; experimental esp32s2_PSRAM_M ;; experimental
esp32c3dev_4MB_M ;; experimental esp32c3dev_4MB_M ;; experimental
@@ -1071,8 +1073,8 @@ build_flags =
[Speed_Flags] [Speed_Flags]
build_flags = build_flags =
-O2 ;; optimize for performance instead of size -O2 ;; optimize for performance instead 9of size
;-O3 ;; try this to optimize even more ;-ffast-math ;; gives a few (2-5) percent sppedup on ESP32-S3, but causes slight slowdown on classic ESP32
-mtarget-align -free -fipa-pta ;; these are very useful, too -mtarget-align -free -fipa-pta ;; these are very useful, too
-fno-jump-tables -fno-tree-switch-conversion ;; needed -fno-jump-tables -fno-tree-switch-conversion ;; needed
-freorder-blocks -Wwrite-strings -fstrict-volatile-bitfields ;; needed -freorder-blocks -Wwrite-strings -fstrict-volatile-bitfields ;; needed
@@ -1463,17 +1465,16 @@ extends = esp32_4MB_V4_S_base
board = lolin_d32_pro board = lolin_d32_pro
;board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; Alternative for 4MB flash: 1.8MB firmware, 256KB filesystem (esptool erase_flash needed before changing) ;board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; Alternative for 4MB flash: 1.8MB firmware, 256KB filesystem (esptool erase_flash needed before changing)
build_unflags = ${esp32_4MB_V4_S_base.build_unflags} build_unflags = ${esp32_4MB_V4_S_base.build_unflags}
;;${Speed_Flags.build_unflags} ;; to override -Os
-DARDUINO_EVENT_RUNNING_CORE=1 ;; we want to run wifi on core0, so remove the standard flag -DARDUINO_EVENT_RUNNING_CORE=1 ;; we want to run wifi on core0, so remove the standard flag
-mfix-esp32-psram-cache-issue ;; this fix is not needed any more for revision 3 -mfix-esp32-psram-cache-issue ;; this fix is not needed any more for revision 3
-mfix-esp32-psram-cache-strategy=memw ;; same as above -mfix-esp32-psram-cache-strategy=memw ;; same as above
;;-Os ;; if you want to be even faster - use together with "-O2" in build_flags. Enable alternative default_partitions (above) to have more program space.
build_flags = ${esp32_4MB_V4_S_base.build_flags} build_flags = ${esp32_4MB_V4_S_base.build_flags}
-DARDUINO_EVENT_RUNNING_CORE=0 ;; assign Wifi to core0, to have more CPU on core#1 (arduino loop) -DARDUINO_EVENT_RUNNING_CORE=0 ;; assign Wifi to core0, to have more CPU on core#1 (arduino loop)
-DARDUINO_RUNNING_CORE=1 ;; should be default, but does not hurt -DARDUINO_RUNNING_CORE=1 ;; should be default, but does not hurt
;-DCONFIG_MBEDTLS_DYNAMIC_BUFFER=1 ;; optional - seems to move more buffers into PSRAM -DCONFIG_MBEDTLS_DYNAMIC_BUFFER=1 ;; optional - seems to move more buffers into PSRAM
;; enable the next line together with "-Os" in build_unflags (unfortunately --> 104.0%% Flash) ;;${Speed_Flags.build_flags} ;; optimize for speed instead of size --> over 100% flash, but works with 256KB filesystem (alternative partitions file)
;;-O2 -fno-jump-tables -fno-tree-switch-conversion -Wwrite-strings -fstrict-volatile-bitfields
-D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions. -D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions.
-DBOARD_HAS_PSRAM -D WLED_USE_PSRAM_JSON ;; -D WLED_USE_PSRAM ;; WLED_USE_PSRAM causes major slow-down (slow LEDs) on some ESP32 boards -DBOARD_HAS_PSRAM -D WLED_USE_PSRAM_JSON ;; -D WLED_USE_PSRAM ;; WLED_USE_PSRAM causes major slow-down (slow LEDs) on some ESP32 boards
;;-D CONFIG_ESP32_REV_MIN=3 ;; disables PSRAM bug workarounds in the core, reducing the code size and improving overall performance. ;;-D CONFIG_ESP32_REV_MIN=3 ;; disables PSRAM bug workarounds in the core, reducing the code size and improving overall performance.
@@ -1491,8 +1492,8 @@ build_flags = ${esp32_4MB_V4_S_base.build_flags}
; -D SR_DEBUG ; -D SR_DEBUG
; -D MIC_LOGGER ; -D MIC_LOGGER
lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
;; RAM: [== ] 16.8% (used 55124 bytes from 327680 bytes) ;; RAM: [==== ] 35.9% (used 117688 bytes from 327680 bytes)
;; Flash: [========= ] 92.7% (used 1458729 bytes from 1572864 bytes) ;; Flash: [========= ] 94.5% (used 1487097 bytes from 1572864 bytes)
;; PSRAM build env that only leaves 300Kb for filesystem (instead of 1MB), but adds 300kB for program space ;; PSRAM build env that only leaves 300Kb for filesystem (instead of 1MB), but adds 300kB for program space
[env:esp32_4MB_PSRAM_M] [env:esp32_4MB_PSRAM_M]
@@ -1518,6 +1519,7 @@ build_flags = ${esp32_4MB_V4_M_base.build_flags}
;; RAM: [== ] 24.9% (used 81484 bytes from 327680 bytes) ;; RAM: [== ] 24.9% (used 81484 bytes from 327680 bytes)
;; Flash: [======== ] 84.6% (used 1607857 bytes from 1900544 bytes) ;; Flash: [======== ] 84.6% (used 1607857 bytes from 1900544 bytes)
[env:esp32S3_8MB_M] [env:esp32S3_8MB_M]
extends = esp32_4MB_V4_M_base extends = esp32_4MB_V4_M_base
board = esp32-s3-devkitc-1 board = esp32-s3-devkitc-1
@@ -1604,6 +1606,51 @@ board_build.partitions = tools/WLED_ESP32_8MB.csv
; RAM: [==== ] 36.3% (used 118828 bytes from 327680 bytes) ; RAM: [==== ] 36.3% (used 118828 bytes from 327680 bytes)
; Flash: [======= ] 70.7% (used 1483465 bytes from 2097152 bytes) ; Flash: [======= ] 70.7% (used 1483465 bytes from 2097152 bytes)
;; MM for ESP32-S3 PSRAM board - FASTPATH + optimize for speed
[env:esp32S3_8MB_S]
extends = esp32_4MB_V4_M_base
board = esp32-s3-devkitc-1 ;; generic S3 dev board
board_build.flash_mode = qio ;; use "dio" if your board gets unstable with "qio"
build_unflags = ${env:esp32S3_8MB_M.build_unflags} ;; use the same as "normal" S3 buildenv
${Speed_Flags.build_unflags} ;; to override -Os
build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-indentation -Wno-format-truncation
${common_mm.build_flags_S}
-D WLED_RELEASE_NAME=esp32S3_8MB_PSRAM_S
-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 ;; for Serial-to-USB chip
;;-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=1 ;; for Hardware-CDC USB mode
;;-D WLED_DISABLE_ADALIGHT ;; disables serial protocols - recommended for Hardware-CDC USB (Serial RX will receive junk commands when RX pin is unconnected, unless its pulled down by resistor)
${Speed_Flags.build_flags} ;; optimize for speed instead of size
-D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions.
-D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0
-D WLED_DISABLE_LOXONE ; FLASH 1272 bytes
-D WLED_DISABLE_ALEXA ; RAM 116 bytes; FLASH 13524 bytes
-D WLED_DISABLE_MQTT ; RAM 216 bytes; FLASH 16496 bytes
-D WLED_DISABLE_HUESYNC ;RAM 122 bytes; FLASH 6308 bytes
-D WLED_DISABLE_INFRARED ;RAM 136 bytes; FLASH 24492 bytes
-D LEDPIN=4
;-D STATUSLED=39
-D BTNPIN=48
-D RLYPIN=21
-D IRPIN=15
-D HW_PIN_SDA=42 ;; ESP32-S3 default: SDA = 8
-D HW_PIN_SCL=41 ;; ESP32-S3 default: SCL = 9
-D AUDIOPIN=-1
-D SR_DMTYPE=1 -D I2S_SDPIN=16 -D I2S_CKPIN=17 -D I2S_WSPIN=47 -D MCLK_PIN=40
-D ES7243_SDAPIN=8 -D ES7243_SCLPIN=18
; -D WLED_DEBUG
; -D SR_DEBUG
; -D MIC_LOGGER
lib_deps = ${esp32s3.lib_deps} ${common_mm.lib_deps_S}
lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
board_build.partitions = tools/WLED_ESP32_8MB.csv
;; normal build
; RAM: [== ] 24.9% (used 81656 bytes from 327680 bytes)
; Flash: [======= ] 66.1% (used 1386229 bytes from 2097152 bytes)
;; optimized-for-speed build
; RAM: [== ] 24.9% (used 81712 bytes from 327680 bytes)
; Flash: [======== ] 75.2% (used 1576113 bytes from 2097152 bytes)
;; MM for Adafruit QT Py ESP32-S2 -> 4MB flash, PSRAM, and tinyUF2 bootloader ;; MM for Adafruit QT Py ESP32-S2 -> 4MB flash, PSRAM, and tinyUF2 bootloader
;; to ewowi - i'll optimize this entry later, as a few things can be inherited for sure. To softhack: sure ;-) ;; to ewowi - i'll optimize this entry later, as a few things can be inherited for sure. To softhack: sure ;-)
[env:esp32s2_tinyUF2_PSRAM_S] [env:esp32s2_tinyUF2_PSRAM_S]
@@ -1704,6 +1751,7 @@ monitor_filters = esp32_exception_decoder
; RAM: [=== ] 30.9% (used 101228 bytes from 327680 bytes) ; RAM: [=== ] 30.9% (used 101228 bytes from 327680 bytes)
; Flash: [======== ] 80.4% (used 1527278 bytes from 1900544 bytes) ; Flash: [======== ] 80.4% (used 1527278 bytes from 1900544 bytes)
;; MM environment for generic ESP32-C3 -> 4MB flash, no PSRAM ;; MM environment for generic ESP32-C3 -> 4MB flash, no PSRAM
[env:esp32c3dev_4MB_M] [env:esp32c3dev_4MB_M]
extends = esp32_4MB_V4_S_base extends = esp32_4MB_V4_S_base