diff --git a/platformio.ini b/platformio.ini old mode 100755 new mode 100644 index 65f11515d..9a886aafc --- a/platformio.ini +++ b/platformio.ini @@ -12,190 +12,38 @@ src_dir = sonoff build_dir = .pioenvs build_cache_dir = .cache -; *** Uncomment one of the lines below to build/upload only one environment -;default_envs = sonoff -;default_envs = sonoff-ircustom ; alternative to 'sonoff' with full IR protocols activated, you will need to disable some features to keep code not too big -;default_envs = sonoff-minimal -;default_envs = sonoff-basic -;default_envs = sonoff-knx -;default_envs = sonoff-sensors -;default_envs = sonoff-display -;default_envs = sonoff-ir -;default_envs = sonoff-BG -;default_envs = sonoff-BR -;default_envs = sonoff-CN -;default_envs = sonoff-CZ -;default_envs = sonoff-DE -;default_envs = sonoff-ES -;default_envs = sonoff-FR -;default_envs = sonoff-GR -;default_envs = sonoff-HE -;default_envs = sonoff-HU -;default_envs = sonoff-IT -;default_envs = sonoff-KO -;default_envs = sonoff-NL -;default_envs = sonoff-PL -;default_envs = sonoff-PT -;default_envs = sonoff-RU -;default_envs = sonoff-SE -;default_envs = sonoff-SK -;default_envs = sonoff-TR -;default_envs = sonoff-TW -;default_envs = sonoff-UK - -[esp82xx_defaults] -build_flags = -D NDEBUG - -mtarget-align - -Wl,-Map,firmware.map - -[core_2_3_0] -; *** Esp8266 core for Arduino version 2.3.0 -; *** W A R N I N G ! *** old outdated Arduino Esp8266 core with many security issues! NOT recommended to use. NO SUPPORT! -platform = espressif8266@1.5.0 -build_flags = ${esp82xx_defaults.build_flags} - -Wl,-Tesp8266.flash.1m0.ld - -[core_2_4_2] -; *** Esp8266 core for Arduino version 2.4.2 -; *** W A R N I N G ! *** old outdated Arduino Esp8266 core with security issues. NOT recommended to use. NO SUPPORT! -platform = espressif8266@1.8.0 -build_flags = ${esp82xx_defaults.build_flags} - -Wl,-Teagle.flash.1m0.ld - -lstdc++ -lsupc++ -; lwIP 1.4 -; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH -; lwIP 2 - Low Memory -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -; lwIP 2 - Higher Bandwidth (Tasmota default) - -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH - -DVTABLES_IN_FLASH - -[core_pre] -; *** Arduino Esp8266 core pre 2.6.x for Tasmota (recommended version, no known issues) -platform = https://github.com/Jason2866/platform-espressif8266.git#Tasmota -build_flags = ${esp82xx_defaults.build_flags} - -Wl,-Tesp8266.flash.1m.ld - -O2 - -DBEARSSL_SSL_BASIC -; nonos-sdk 22y - -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y -; nonos-sdk 22x -; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x -; nonos-sdk-pre-v3 -; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 -; lwIP 1.4 -; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH -; lwIP 2 - Low Memory -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -; lwIP 2 - Higher Bandwidth -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -; lwIP 2 - Higher Bandwidth Low Memory no Features -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH -; lwIP 2 - Higher Bandwidth no Features (Tasmota default) - -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH -; VTABLES in Flash (default) - -DVTABLES_IN_FLASH -; VTABLES in Heap -; -DVTABLES_IN_DRAM -; VTABLES in IRAM -; -DVTABLES_IN_IRAM -; enable one option set -> No exception recommended -; No exception code in firmware - -fno-exceptions - -lstdc++ -; Exception code in firmware /needs much space! -; -fexceptions -; -lstdc++-exc - -[core_pre_ipv6] -; *** Arduino Esp8266 core pre 2.6.x IPv6 for Tasmota (use ONLY if you need IPv6, experimental!) -platform = https://github.com/Jason2866/platform-espressif8266.git#Tasmota -build_flags = ${esp82xx_defaults.build_flags} - -Wl,-Tesp8266.flash.1m.ld - -O2 - -DBEARSSL_SSL_BASIC -; nonos-sdk 22y - -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y -; nonos-sdk 22x -; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x -; nonos-sdk-pre-v3 -; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 -; lwIP 1.4 -; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH -; lwIP 2 - Low Memory -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -; lwIP 2 - Higher Bandwidth -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -; lwIP 2 - Higher Bandwidth Low Memory no Features -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH -; lwIP 2 - Higher Bandwidth no Features -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH -; lwIP 2 - Higher Bandwidth IPv6 - -DPIO_FRAMEWORK_ARDUINO_LWIP2_IPV6_HIGHER_BANDWIDTH -; VTABLES in Flash (default) - -DVTABLES_IN_FLASH -; VTABLES in Heap -; -DVTABLES_IN_DRAM -; VTABLES in IRAM -; -DVTABLES_IN_IRAM -; enable one option set -> No exception recommended -; No exception code in firmware - -fno-exceptions - -lstdc++ -; Exception code in firmware /needs much space! -; -fexceptions -; -lstdc++-exc - -[core_stage] -; *** Esp8266 core for Arduino version latest beta -platform = https://github.com/platformio/platform-espressif8266.git#feature/stage -build_flags = ${esp82xx_defaults.build_flags} - -Wl,-Teagle.flash.1m.ld -; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473 - -O2 - -DBEARSSL_SSL_BASIC -; nonos-sdk 22y - -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y -; nonos-sdk 22x -; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x -; nonos-sdk-pre-v3 -; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 -; lwIP 1.4 -; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH -; lwIP 2 - Low Memory -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -; lwIP 2 - Higher Bandwidth -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -; lwIP 2 - Higher Bandwidth Low Memory no Features -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH -; lwIP 2 - Higher Bandwidth no Features (Tasmota default) - -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH -; VTABLES in Flash (default) - -DVTABLES_IN_FLASH -; VTABLES in Heap -; -DVTABLES_IN_DRAM -; VTABLES in IRAM -; -DVTABLES_IN_IRAM -; enable one option set -> No exception recommended -; No exception code in firmware - -fno-exceptions - -lstdc++ -; Exception code in firmware /needs much space! 90k -; -fexceptions -; -lstdc++-exc - -[core_active] -; Select one core set for platform and build_flags -;platform = ${core_2_3_0.platform} -;build_flags = ${core_2_3_0.build_flags} -;platform = ${core_2_4_2.platform} -;build_flags = ${core_2_4_2.build_flags} -platform = ${core_pre.platform} -build_flags = ${core_pre.build_flags} -;platform = ${core_pre_ipv6.platform} -;build_flags = ${core_pre_ipv6.build_flags} -;platform = ${core_stage.platform} -;build_flags = ${core_stage.build_flags} +; *** Build/upload environment +default_envs = +; *** Uncomment by deleting ";" in the line(s) below to select version(s) +; sonoff +; sonoff-ircustom ; alternative to 'sonoff' with full IR protocols activated, you will need to disable some features to keep code not too big +; sonoff-minimal +; sonoff-basic +; sonoff-knx +; sonoff-sensors +; sonoff-display +; sonoff-ir +; sonoff-BG +; sonoff-BR +; sonoff-CN +; sonoff-CZ +; sonoff-DE +; sonoff-ES +; sonoff-FR +; sonoff-GR +; sonoff-HE +; sonoff-HU +; sonoff-IT +; sonoff-KO +; sonoff-NL +; sonoff-PL +; sonoff-PT +; sonoff-RU +; sonoff-SE +; sonoff-SK +; sonoff-TR +; sonoff-TW +; sonoff-UK [common] framework = arduino @@ -205,6 +53,11 @@ board_build.flash_mode = dout platform = ${core_active.platform} build_flags = ${core_active.build_flags} +; ********************************************************************* +; *** Uncomment, by deleting ";" in line below, to use custom settings from file user_config_override.h +; -DUSE_CONFIG_OVERRIDE +; ********************************************************************* + ; *** Optional Debug messages ; -DDEBUG_TASMOTA_CORE ; -DDEBUG_TASMOTA_DRIVER @@ -218,7 +71,6 @@ build_flags = ${core_active.build_flags} ; -DFIRMWARE_DISPLAYS ; -DFIRMWARE_IR ; -DFIRMWARE_IR_CUSTOM -; -DUSE_CONFIG_OVERRIDE ; *** Fix espressif8266@1.7.0 induced undesired all warnings build_unflags = -Wall @@ -234,7 +86,7 @@ upload_resetmethod = nodemcu ; *** Upload Serial reset method for Wemos and NodeMCU upload_port = COM5 extra_scripts = pio/strip-floats.py - pio/obj-dump.py +; pio/obj-dump.py ; *** Upload file to OTA server using SCP ;upload_port = user@host:/path @@ -244,8 +96,106 @@ extra_scripts = pio/strip-floats.py ;upload_port = domus1:80/api/upload-arduino.php ;extra_scripts = pio/strip-floats.py, pio/http-uploader.py +[core_active] +; Select one core set for platform and build_flags +platform = ${core_2_6_1.platform} +build_flags = ${core_2_6_1.build_flags} +;platform = ${core_stage.platform} +;build_flags = ${core_stage.build_flags} + ; ********************************************************************* +[esp82xx_defaults] +build_flags = -D NDEBUG + -mtarget-align + -Wl,-Map,firmware.map + +[core_2_6_1] +; *** Esp8266 core for Arduino version 2.6.1 +platform = espressif8266@~2.3.0 +build_flags = ${esp82xx_defaults.build_flags} + -Wl,-Teagle.flash.1m.ld + -DBEARSSL_SSL_BASIC +; NONOSDK221 +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK221 +; NONOSDK22x_190313 +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190313 +; NONOSDK22x_190703 = 2.2.2-dev(38a443e) (sonoff default) + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703 +; NONOSDK22x_191024 = 2.2.2-dev(5ab15d1) +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191024 +; NONOSDK22x_191105 = 2.2.2-dev(bb83b9b) +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 +; NONOSDK3V0 (known issues) +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 +; lwIP 1.4 +; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH +; lwIP 2 - Low Memory +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY +; lwIP 2 - Higher Bandwidth +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH +; lwIP 2 - Higher Bandwidth Low Memory no Features +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH +; lwIP 2 - Higher Bandwidth no Features (Tasmota default) + -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH +; lwIP 2 - Higher Bandwidth IPv6 (use ONLY if you need IPv6, experimental!) +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_IPV6_HIGHER_BANDWIDTH +; VTABLES in Flash (Tasmota default) + -DVTABLES_IN_FLASH +; VTABLES in Heap +; -DVTABLES_IN_DRAM +; VTABLES in IRAM +; -DVTABLES_IN_IRAM +; enable one option set -> No exception recommended +; No exception code in firmware + -fno-exceptions + -lstdc++ +; Exception code in firmware /needs much space! 90k +; -fexceptions +; -lstdc++-exc + +[core_stage] +; *** Esp8266 core for Arduino version latest beta +platform = https://github.com/platformio/platform-espressif8266.git#feature/stage +build_flags = ${esp82xx_defaults.build_flags} + -Wl,-Teagle.flash.1m.ld + -DBEARSSL_SSL_BASIC +; NONOSDK221 +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK221 +; NONOSDK22x_190313 +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190313 +; NONOSDK22x_190703 (Tasmota default) + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703 +; NONOSDK22x_191024 +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191024 +; NONOSDK22x_191105 +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 +; NONOSDK3V0 (known issues) +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 +; lwIP 1.4 +; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH +; lwIP 2 - Low Memory +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY +; lwIP 2 - Higher Bandwidth +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH +; lwIP 2 - Higher Bandwidth Low Memory no Features +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH +; lwIP 2 - Higher Bandwidth no Features (Tasmota default) + -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH +; VTABLES in Flash (Tasmota default) + -DVTABLES_IN_FLASH +; VTABLES in Heap +; -DVTABLES_IN_DRAM +; VTABLES in IRAM +; -DVTABLES_IN_IRAM +; enable one option set -> No exception recommended +; No exception code in firmware + -fno-exceptions + -lstdc++ +; Exception code in firmware /needs much space! 90k +; -fexceptions +; -lstdc++-exc + [env:sonoff] platform = ${common.platform} framework = ${common.framework} @@ -260,6 +210,22 @@ upload_resetmethod = ${common.upload_resetmethod} upload_speed = ${common.upload_speed} extra_scripts = ${common.extra_scripts} +; *** Debug version used for PlatformIO Home Project Inspection +[env:sonoff-debug] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_build.flash_mode = ${common.board_build.flash_mode} +board_build.f_cpu = ${common.board_build.f_cpu} +build_type = debug +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} +monitor_speed = ${common.monitor_speed} +upload_port = ${common.upload_port} +upload_resetmethod = ${common.upload_resetmethod} +upload_speed = ${common.upload_speed} +extra_scripts = ${common.extra_scripts} + [env:sonoff-minimal] platform = ${common.platform} framework = ${common.framework}