pio: generic build env for ESP32-S2, and some cleanup

This commit is contained in:
Frank
2023-03-30 23:59:38 +02:00
parent e8d3712d4f
commit 4e8974a69b
2 changed files with 120 additions and 26 deletions

View File

@@ -60,7 +60,8 @@ default_envs =
esp32_pico_4MB_M
esp32_4MB_PSRAM_S
esp32S3_8MB_M
esp32s2_tinyUF2_PSRAM_M ;; 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
esp32c3dev_4MB_M ;; experimental
esp32_4MB_V4_S ;; experimental
esp32_16MB_V4_M ;; experimental
@@ -1352,9 +1353,9 @@ board_build.flash_mode = qio
; RAM: [== ] 24.7% (used 80856 bytes from 327680 bytes)
; Flash: [======= ] 66.9% (used 1403489 bytes from 2097152 bytes)
;; MM max 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 ;-)
[env:esp32s2_tinyUF2_PSRAM_M]
[env:esp32s2_tinyUF2_PSRAM_S]
extends = esp32_4MB_V4_S_base
platform = ${esp32.platformV4}
platform_packages = ${esp32.platformV4_packages}
@@ -1365,27 +1366,25 @@ board_build.f_flash = 80000000L
board_build.flash_mode = qio
upload_speed = 256000 ;; 921600
build_unflags = ${common.build_unflags}
-D USERMOD_DALLASTEMPERATURE ;; disabled because it hangs during usermod setup on -S2 (autodetect broken?)
-D USE_ALT_DISPLAY ;; four line display seems to have problems with I2C - it hangs during usermod setup
-D USERMOD_FOUR_LINE_DISPLAY ;; see above
-D USERMOD_ROTARY_ENCODER_UI ;; see above
-D USERMOD_DALLASTEMPERATURE ;; disabled because it hangs during usermod setup on -S3 (autodetect broken?)
-D WLED_ENABLE_DMX ;; disabled because it does not work with ESP-IDF 4.4.x (buggy driver in SparkFunDMX)
build_flags = ${common.build_flags} ${esp32s2.build_flags}
; ${Debug_Flags.build_flags} ;ewowi: enabling debug causes Error: The program size (1463330 bytes) is greater than maximum allowed (1441792 bytes)
-D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0
${common_mm.build_flags_S} ${common_mm.build_flags_M}
${common_mm.build_flags_S}
-Wno-misleading-indentation -Wno-format-truncation
-D WLED_RELEASE_NAME=esp32S2_4MB_UF2_M
-D WLED_RELEASE_NAME=esp32S2_4MB_UF2_S
-DARDUINO_USB_CDC_ON_BOOT=1 ;; mandatory, otherwise USB does not work!!
-D WLED_DISABLE_ADALIGHT ;; disables serial protocols when using CDC USB (Serial RX will receive junk commands, unless its pulled down by resistor)
-DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0
-D SERVERNAME='"WLED-S2"'
-D WLED_USE_PSRAM
-D WLED_DISABLE_INFRARED ;; save flash space
-D WLED_DISABLE_ALEXA ;; save flash space
-D WLED_DISABLE_HUESYNC ;; save flash space
-D WLED_DISABLE_LOXONE ;; save flash space
-D WLED_DISABLE_LOXONE ;; FLASH 1272 bytes
-D WLED_DISABLE_HUESYNC ;; RAM 122 bytes; FLASH 6308 bytes
-D WLED_DISABLE_ALEXA ;; RAM 116 bytes; FLASH 13524 bytes
; -D WLED_DISABLE_MQTT ;; RAM 216 bytes; FLASH 16496 bytes
-D WLED_DISABLE_INFRARED ;; RAM 136 bytes; FLASH 24492 bytes
-D LEDPIN=39 ;; onboard neopixel LED. Attach your own LEDs to GPIO 7 or GPIO 6
-D BTNPIN=0
;-D RLYPIN=6
@@ -1395,21 +1394,63 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags}
-D HW_PIN_CLOCKSPI=36
-D HW_PIN_MISOSPI=37
-D AUDIOPIN=-1
-D SR_DMTYPE=1
-D I2S_SDPIN=9
-D I2S_WSPIN=8
-D I2S_CKPIN=17
-D MCLK_PIN=18
-D SR_DMTYPE=1 -D I2S_SDPIN=9 -D I2S_WSPIN=8 -D I2S_CKPIN=17 -D MCLK_PIN=18
;-D STATUSLED=-1
-D WLED_USE_MY_CONFIG
lib_deps = ${env.lib_deps} ${esp32s2.lib_deps} ${common_mm.lib_deps_S} ${common_mm.lib_deps_V4_M}
lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
lib_deps = ${env.lib_deps} ${esp32s2.lib_deps} ${common_mm.lib_deps_S}
lib_ignore =
IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE
monitor_filters = esp32_exception_decoder
; RAM: [=== ] 25.4% (used 83324 bytes from 327680 bytes)
; Flash: [==========] 98.6% (used 1421778 bytes from 1441792 bytes)
; RAM: [=== ] 25.1% (used 82348 bytes from 327680 bytes)
; Flash: [==========] 95.8% (used 1381742 bytes from 1441792 bytes)
;; MM max environment for ESP32-C3 -> 4MB flash, no PSRAM
;; to ewowi - i'll optimize this entry later ;-) really, I mean
;; MM environment for generic ESP32-S2, with PSRAM, 4MB flash (300kB filesystem to have more program space)
[env:esp32s2_PSRAM_M]
extends = esp32_4MB_V4_M_base
platform = espressif32@~5.2.0 ;; more stable on -S2 than 5.1.1
platform_packages =
board = lolin_s2_mini
board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions)
board_build.flash_mode = dio
upload_speed = 256000 ;; 921600
build_unflags = ${common.build_unflags}
-DARDUINO_USB_CDC_ON_BOOT=1
-D USERMOD_DALLASTEMPERATURE ;; disabled because it hangs during usermod setup on -S3 (autodetect broken?)
-D WLED_ENABLE_DMX ;; disabled because it does not work with ESP-IDF 4.4.x (buggy driver in SparkFunDMX)
build_flags = ${common.build_flags} ${esp32s2.build_flags}
${Debug_Flags.build_flags}
-D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0
${common_mm.build_flags_S} ${common_mm.build_flags_M}
-Wno-misleading-indentation -Wno-format-truncation
-D WLED_RELEASE_NAME=esp32S2_4MB_M
-DARDUINO_USB_CDC_ON_BOOT=0
-DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0
-D WLED_DISABLE_ADALIGHT ;; disables serial protocols, as the board onl has CDC USB
-D WLED_USE_PSRAM -DBOARD_HAS_PSRAM
-D WLED_DISABLE_INFRARED ;; save flash space
-D WLED_DISABLE_ALEXA ;; save flash space
-D WLED_DISABLE_HUESYNC ;; save flash space
-D WLED_DISABLE_LOXONE ;; save flash space
-D LEDPIN=16
-D BTNPIN=-1 -D RLYPIN=-1 -D IRPIN=-1
-D HW_PIN_SCL=40 -D HW_PIN_SDA=41
-D HW_PIN_MOSISPI=35 ;WLEDMM renamed from HW_PIN_DATASPI
-D HW_PIN_CLOCKSPI=36
-D HW_PIN_MISOSPI=37
-D AUDIOPIN=-1
-D SR_DMTYPE=1 -D I2S_SDPIN=9 -D I2S_WSPIN=8 -D I2S_CKPIN=17 -D MCLK_PIN=18
-D WLED_USE_MY_CONFIG
lib_deps = ${env.lib_deps} ${esp32s2.lib_deps} ${common_mm.lib_deps_S} ${common_mm.lib_deps_V4_M}
lib_ignore =
IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE
monitor_filters = esp32_exception_decoder
; RAM: [== ] 22.9% (used 75068 bytes from 327680 bytes)
; Flash: [======== ] 78.3% (used 1487802 bytes from 1900544 bytes)
;; MM environment for ESP32-C3 -> 4MB flash, no PSRAM
[env:esp32c3dev_4MB_M]
extends = esp32_4MB_V4_S_base
;platform = ${esp32.platformV4}
@@ -1417,7 +1458,8 @@ extends = esp32_4MB_V4_S_base
platform = espressif32@~5.2.0 ;; alternative platform, might help in case you experience bootloops due to corrupted flash filesystem
platform_packages =
board = esp32-c3-devkitm-1
;board_build.partitions = tools/WLED_ESP32_2MB_noOTA.csv ;; for boards with 2MB flash only (like some Ai-Thinker ESP32-C3-12F models)
;board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions)
;board_build.partitions = tools/WLED_ESP32_2MB_noOTA.csv ;; use this for boards with 2MB flash (like some Ai-Thinker ESP32-C3-12F models)
upload_speed = 256000 ;; 921600
build_unflags = ${common.build_unflags}
@@ -1428,11 +1470,11 @@ build_unflags = ${common.build_unflags}
-D WLED_ENABLE_DMX ;; disabled because it does not work with ESP-IDF 4.4.x (buggy driver in SparkFunDMX)
build_flags = ${common.build_flags} ${esp32c3.build_flags}
; -D WLED_DISABLE_OTA ;; OTA is not possible for boards with 2MB flash only (like some Ai-Thinker ESP32-C3-12F models)
-D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0
${common_mm.build_flags_S} ${common_mm.build_flags_M}
-Wno-misleading-indentation -Wno-format-truncation
-D WLED_RELEASE_NAME=esp32c3dev_4MB_M
; -D WLED_DISABLE_OTA ;; OTA is not possible for boards with 2MB flash only (like some Ai-Thinker ESP32-C3-12F models)
; -DARDUINO_USB_CDC_ON_BOOT=1 ;; enable CDC USB -> needed for debugging over serial USB
; -D WLED_DISABLE_ADALIGHT ;; to disable serial protocols when using CDC USB (Serial RX will receive junk commands, unless its pulled down by resistor)
-DARDUINO_USB_CDC_ON_BOOT=0 ;; disable CDC USB
@@ -1452,6 +1494,8 @@ build_flags = ${common.build_flags} ${esp32c3.build_flags}
lib_deps = ${env.lib_deps} ${esp32c3.lib_deps} ${common_mm.lib_deps_S} ${common_mm.lib_deps_V4_M}
;lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
;monitor_filters = esp32_exception_decoder
; RAM: [== ] 23.1% (used 75620 bytes from 327680 bytes)
; Flash: [==========] 95.8% (used 1506216 bytes from 1572864 bytes)
# ------------------------------------------------------------------------------
# custom board environments

View File

@@ -12,6 +12,56 @@
#include "../tools/ESP32-Chip_info.hpp"
#endif
// WLEDMM some buildenv sanity checks
#ifdef ARDUINO_ARCH_ESP32 // ESP32
#if !defined(ESP32)
#error please fix your build environment. ESP32 is not defined.
#endif
#if defined(ESP8266) || defined(ARDUINO_ARCH_ESP8266)
#error please fix your build environment. ESP32 and ESP8266 are both defined.
#endif
// only one of ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32C3 allowed
#if defined(ARDUINO_ARCH_ESP32S3) && ( defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3) )
#error please fix your build environment. only one of ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32C3 may be defined
#endif
#if defined(ARDUINO_ARCH_ESP32S2) && ( defined(ARDUINO_ARCH_ESP32S3) || defined(ARDUINO_ARCH_ESP32C3) )
#error please fix your build environment. only one of ARDUINO_ARCH_ESP32S3, ARDUINO_ARCH_ESP32S2, ARDUINO_ARCH_ESP32C3 may be defined
#endif
#if defined(CONFIG_IDF_TARGET_ESP32) && ( defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3))
#error please fix your build environment. only one CONFIG_IDF_TARGET may be defined
#endif
// make sure we have a supported CONFIG_IDF_TARGET_
#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#error please fix your build environment. No supported CONFIG_IDF_TARGET was defined
#endif
#if CONFIG_IDF_TARGET_ESP32_SOLO || CONFIG_IDF_TARGET_ESP32SOLO
#warning ESP32 SOLO (single core) is not supported.
#endif
// only one of CONFIG_IDF_TARGET_ESP32, CONFIG_IDF_TARGET_ESP32S2, CONFIG_IDF_TARGET_ESP32S3, CONFIG_IDF_TARGET_ESP32C3 is allowed
#if defined(CONFIG_IDF_TARGET_ESP32) && ( defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3))
#error please fix your build environment. only one CONFIG_IDF_TARGET may be defined
#endif
#if defined(CONFIG_IDF_TARGET_ESP32S3) && ( defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3))
#error please fix your build environment. only one CONFIG_IDF_TARGET may be defined
#endif
#if defined(CONFIG_IDF_TARGET_ESP32C3) && ( defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2))
#error please fix your build environment. only one CONFIG_IDF_TARGET may be defined
#endif
#else // 8266
#if !defined(ARDUINO_ARCH_ESP8266) && !defined(ARDUINO_ARCH_ESP8265)
#error please fix your build environment. Neither ARDUINO_ARCH_ESP8266 nor ARDUINO_ARCH_ESP32 are defined
#else
#if !defined(ESP8266) && !defined(ESP8265)
#error please fix your build environment. ESP8266 is not defined.
#endif
#endif
#endif
// WLEDMM end
/*
* Main WLED class implementation. Mostly initialization and connection logic
*/