diff --git a/platformio.ini b/platformio.ini index ea5cd7f2c..ea6b99a69 100644 --- a/platformio.ini +++ b/platformio.ini @@ -38,76 +38,127 @@ src_dir = sonoff ;env_default = sonoff-TW ;env_default = sonoff-UK -[common] ; ************************************************************ +[esp82xx_defaults] +build_flags = -D NDEBUG + -mtarget-align + -Wl,-Map,firmware.map + +[core_2_3_0] ; *** Esp8266 core for Arduino version 2.3.0 -platform = espressif8266@1.5.0 +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 -;platform = espressif8266@1.8.0 -; *** Esp8266 core for Arduino version Core 2.5.0 beta tested for Tasmota -;platform = https://github.com/Jason2866/platform-espressif8266.git#Tasmota -; *** Esp8266 core for Arduino version latest beta -;platform = https://github.com/platformio/platform-espressif8266.git#feature/stage -; *** Esp8266 core for Arduino current version (located in %USERPROFILE%\.platformio\platforms\espressif8266) -;platform = espressif8266 - -framework = arduino -board = esp01_1m -board_build.flash_mode = dout - -; set CPU frequency to 80MHz (default) or 160MHz -board_build.f_cpu = 80000000L -;board_build.f_cpu = 160000000L - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = -; if using esp8266 core 2.5.0 (stage) or up -; -Wl,-Tesp8266.flash.1m.ld -Wl,-Map,firmware.map -; if using esp8266 core < 2.5.0 - -Wl,-Tesp8266.flash.1m0.ld -Wl,-Map,firmware.map - -mtarget-align -; -DUSE_CONFIG_OVERRIDE +platform = espressif8266@1.8.0 +build_flags = ${esp82xx_defaults.build_flags} + -Wl,-Tesp8266.flash.1m0.ld + -lstdc++ -lsupc++ ; lwIP 1.4 (Default) -; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH +; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH ; lwIP 2 - Low Memory -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -; lwIP 2 - Higher Bandwitdh - -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -; lwIP 2 - Higher Bandwitdh no Features -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH -; lwIP 2 - Higher Bandwitdh Low Memory no Features -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH -; VTABLES in Flash (default) - -DVTABLES_IN_FLASH +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY +; lwIP 2 - Higher Bandwidth (Tasmota default) + -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH + -DVTABLES_IN_FLASH -; if using esp8266 core 2.5.0 (stage) or up +[core_2_5_0] +; *** Esp8266 core for Arduino version Core 2.5.0 beta tested for Tasmota +platform = https://github.com/Jason2866/platform-espressif8266.git#Tasmota +build_flags = ${esp82xx_defaults.build_flags} + -Wl,-Tesp8266.flash.1m.ld +; lwIP 1.4 (Default) +; -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 + -DVTABLES_IN_FLASH + -fno-exceptions + -lstdc++-nox + +[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,-Tesp8266.flash.1m.ld +; lwIP 1.4 (Default) +; -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 Bandwitdh Low Memory no Features +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH +; lwIP 2 - Higher Bandwitdh no Features + -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++-nox + -fno-exceptions + -lstdc++-nox ; Exception code in firmware /needs much space! 90k -; -fexceptions -; -lstdc++ +; -fexceptions +; -lstdc++ -; *** Serial Monitor options -monitor_speed = 115200 +[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_2_5_0.platform} +;build_flags = ${core_2_5_0.build_flags} +;platform = ${core_stage.platform} +;build_flags = ${core_stage.build_flags} + +[common] +framework = arduino +board = esp01_1m +board_build.flash_mode = dout + +platform = ${core_active.platform} +build_flags = ${core_active.build_flags} +; -DUSE_CLASSIC +; -DBE_MINIMAL +; -DUSE_SENSORS +; -DUSE_BASIC +; -DUSE_KNX_NO_EMULATION +; -DUSE_DISPLAYS +; -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +; set CPU frequency to 80MHz (default) or 160MHz +board_build.f_cpu = 80000000L +;board_build.f_cpu = 160000000L + +monitor_speed = 115200 +upload_speed = 115200 +upload_resetmethod = nodemcu ; *** Upload Serial reset method for Wemos and NodeMCU -upload_speed = 115200 -upload_resetmethod = nodemcu -upload_port = COM5 - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py +upload_port = COM5 +extra_scripts = pio/strip-floats.py ; *** Upload file to OTA server using SCP -;upload_port = user@host:/path -;extra_scripts = pio/strip-floats.py, pio/sftp-uploader.py +;upload_port = user@host:/path +;extra_scripts = pio/strip-floats.py, pio/sftp-uploader.py -; *** Upload file to OTA server using HTTP -;upload_port = domus1:80/api/upload-arduino.php -;extra_scripts = pio/strip-floats.py, pio/http-uploader.py +; *** Upload file to OTA server in folder api/arduino using HTTP +;upload_port = domus1:80/api/upload-arduino.php +;extra_scripts = pio/strip-floats.py, pio/http-uploader.py ; *********************************************************************