From e10cbfc81fceebc37a2384678aa8a0eaa23ae44d Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 1 Nov 2020 15:24:12 +0100 Subject: [PATCH 1/4] No core_version.h in ESP32 stage --- tasmota/tasmota.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 9e13d9c49..3034013a3 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -34,7 +34,9 @@ \*********************************************************************************************/ // Location specific includes +#ifndef ESP32_STAGE // ESP32 Stage has no core_version.h file. Disable include via PlatformIO Option #include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_7_1) +#endif #include "tasmota_compat.h" #include "tasmota_version.h" // Tasmota version information #include "tasmota.h" // Enumeration used in my_user_config.h From ed24e8d99f6408eb67a295c33e63c03e85c6c14b Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 1 Nov 2020 15:27:26 +0100 Subject: [PATCH 2/4] Build Flag for ESP32 Stage --- platformio_override_sample.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index 058ad1788..dc5555a2e 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -184,12 +184,12 @@ build_flags = ${esp82xx_defaults.build_flags} ; Activate Stage Core32 by removing ";" in next line, if you want to override the standard core32 ;platform_packages = ${core32_stage.platform_packages} - [core32_stage] -platform_packages = tool-esptoolpy@1.20800.0 - ; latest working commit - framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#c09ec5bd3d35ba7dfc135755ab300e2b45416def +platform_packages = tool-esptoolpy@1.20800.0 + framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#f7fb00632e04d74a7890a77fa7dbbb8ae572e866 +build_flags = ${common32.build_flags} + -D ESP32_STAGE=true ; *** Debug version used for PlatformIO Home Project Inspection [env:tasmota-debug] From 864e8d788cd26ae5672dce030f45684965732d32 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 1 Nov 2020 17:27:50 +0100 Subject: [PATCH 3/4] Refactor platformio files --- platformio.ini | 11 ++--- platformio_override_sample.ini | 7 +-- platformio_tasmota32.ini | 87 +++++++++++++++------------------- 3 files changed, 47 insertions(+), 58 deletions(-) diff --git a/platformio.ini b/platformio.ini index 84970115a..3aa8a9a12 100644 --- a/platformio.ini +++ b/platformio.ini @@ -81,9 +81,9 @@ upload_speed = 115200 upload_resetmethod = nodemcu upload_port = COM5 extra_scripts = ${scripts_defaults.extra_scripts} -lib_ldf_mode = chain+ +lib_ldf_mode = chain+ shared_libdeps_dir = lib -lib_extra_dirs = +lib_extra_dirs = lib/lib_basic lib/lib_i2c lib/lib_display @@ -107,12 +107,12 @@ build_flags = -Wno-deprecated-declarations -DDECODE_HASH=true -DDECODE_NEC=true -DSEND_NEC=true -DDECODE_RC5=true -DSEND_RC5=true -DDECODE_RC6=true -DSEND_RC6=true ; new mechanism to set the IRremoteESP8266 supported protocols: none except HASH, NEC, RC5, RC6 + ; ********************************************************************* ; *** Use custom settings from file user_config_override.h -DUSE_CONFIG_OVERRIDE ; ********************************************************************* - [esp82xx_defaults] build_flags = ${esp_defaults.build_flags} -Wl,-Map,firmware.map @@ -126,18 +126,17 @@ build_flags = ${esp_defaults.build_flags} ; lwIP 2 - Higher Bandwidth no Features -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH ; VTABLES in Flash - -DVTABLES_IN_FLASH + -DVTABLES_IN_FLASH ; remove the 4-bytes alignment for PSTR() -DPSTR_ALIGN=1 ; restrict to minimal mime-types -DMIMETYPE_MINIMAL - + [irremoteesp_full] build_flags = -DUSE_IR_REMOTE_FULL -U_IR_ENABLE_DEFAULT_ -DDECODE_PRONTO=false -DSEND_PRONTO=false - [core] ; *** Esp8266 Tasmota modified Arduino core based on core 2.7.4 platform = espressif8266@2.6.2 diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index dc5555a2e..b081258c4 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -72,7 +72,7 @@ extra_scripts = ${scripts_defaults.extra_scripts} ; pio/strip-floats.py ; pio/http-uploader.py -lib_ldf_mode = chain+ +lib_ldf_mode = chain+ shared_libdeps_dir = lib ; *** Library disable / enable for variant Tasmota. Disable reduces compile time @@ -80,7 +80,7 @@ shared_libdeps_dir = lib ; *** The resulting firmware will NOT be different if you leave all libs enabled ; *** Disabling by putting a ";" in front of the lib name ; *** If you dont know what it is all about, do not change -lib_extra_dirs = +lib_extra_dirs = ; *** Only disabled for Tasmota minimal and Tasmota light. For all other variants needed! lib/lib_basic ; **** I2C devices. Most sensors. Disable only if you dont have ANY I2C device enabled @@ -181,8 +181,9 @@ build_flags = ${esp82xx_defaults.build_flags} ; -lstdc++-exc [core32] -; Activate Stage Core32 by removing ";" in next line, if you want to override the standard core32 +; Activate Stage Core32 by removing ";" in next lines, if you want to override the standard core32 ;platform_packages = ${core32_stage.platform_packages} +;build_flags = ${core32_stage.build_flags} [core32_stage] platform_packages = tool-esptoolpy@1.20800.0 diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index 6cc05dfe7..341f0c286 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -39,65 +39,54 @@ default_envs = ${build_envs.default_envs} ; tasmota32-UK ; tasmota32-VN - -[core32] -platform = espressif32@2.0.0 -platform_packages = tool-esptoolpy@1.20800.0 - platformio/framework-arduinoespressif32 @ 3.10004.201016 - [common32] -platform = ${core32.platform} -platform_packages = ${core32.platform_packages} -board = esp32dev -board_build.ldscript = esp32_out.ld -board_build.partitions = esp32_partition_app1984k_spiffs64k.csv -board_build.flash_mode = ${common.board_build.flash_mode} -board_build.f_flash = ${common.board_build.f_flash} -board_build.f_cpu = ${common.board_build.f_cpu} -build_unflags = ${esp_defaults.build_unflags} - -Wpointer-arith -monitor_speed = ${common.monitor_speed} -upload_port = ${common.upload_port} -upload_resetmethod = ${common.upload_resetmethod} -upload_speed = 921600 -extra_scripts = ${common.extra_scripts} +board = esp32dev +board_build.flash_mode = ${common.board_build.flash_mode} +board_build.ldscript = esp32_out.ld +board_build.partitions = esp32_partition_app1984k_spiffs64k.csv -build_flags = ${esp_defaults.build_flags} +platform = ${core32.platform} +platform_packages = ${core32.platform_packages} +build_unflags = ${esp_defaults.build_unflags} + -Wpointer-arith +build_flags = ${core32.build_flags} - -D CORE_DEBUG_LEVEL=0 - -D BUFFER_LENGTH=128 - -D MQTT_MAX_PACKET_SIZE=1200 - -D uint32=uint32_t - -D uint16=uint16_t - -D uint8=uint8_t - -D sint8_t=int8_t - -D sint32_t=int32_t - -D sint16_t=int16_t - -D memcpy_P=memcpy - -D memcmp_P=memcmp +board_build.f_cpu = ${common.board_build.f_cpu} +board_build.f_flash = ${common.board_build.f_flash} +monitor_speed = ${common.monitor_speed} +upload_port = ${common.upload_port} +upload_resetmethod = ${common.upload_resetmethod} +upload_speed = 921600 +extra_scripts = ${common.extra_scripts} -lib_ldf_mode = chain+ -shared_libdeps_dir = lib -; *** Library disable / enable for variant Tasmota. Disable reduces compile time -; *** !!! Disabling needed libs will generate compile errors !!! -; *** The resulting firmware will NOT be different if you leave all libs enabled -; *** Disabling by putting a ";" in front of the lib name -; *** If you dont know what it is all about, do not change -lib_extra_dirs = -; *** ESP32 lib. ALWAYS needed for ESP32 !!! +lib_ldf_mode = chain+ +shared_libdeps_dir = lib +lib_extra_dirs = lib/libesp32 -; *** Only disabled for Tasmota minimal and Tasmota light. For all other variants needed! lib/lib_basic -; **** I2C devices. Most sensors. Disable only if you dont have ANY I2C device enabled lib/lib_i2c -; *** Displays. Disable if you dont have any Display activated lib/lib_display -; *** Bear SSL and base64. Disable if you dont have SSL or TLS activated lib/lib_ssl -; *** Audio needs a lot of time to compile. Mostly not used functions. Recommended to disable lib/lib_audio -; *** RF 433 stuff (not RF Bridge). Recommended to disable lib/lib_rf -; *** Mostly not used functions. Recommended to disable lib/lib_div +[esp32_defaults] +build_flags = ${esp_defaults.build_flags} + -D CORE_DEBUG_LEVEL=0 + -D BUFFER_LENGTH=128 + -D MQTT_MAX_PACKET_SIZE=1200 + -D uint32=uint32_t + -D uint16=uint16_t + -D uint8=uint8_t + -D sint8_t=int8_t + -D sint32_t=int32_t + -D sint16_t=int16_t + -D memcpy_P=memcpy + -D memcmp_P=memcmp + +[core32] +platform = espressif32@2.0.0 +platform_packages = tool-esptoolpy@1.20800.0 + platformio/framework-arduinoespressif32 @ 3.10004.201016 +build_flags = ${esp32_defaults.build_flags} From 32f3eee89d6b2b6203c35fac5ec06055cf703283 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 1 Nov 2020 17:31:44 +0100 Subject: [PATCH 4/4] Fix ESP32 override build_flags --- platformio_override_sample.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index b081258c4..f884c6596 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -186,10 +186,10 @@ build_flags = ${esp82xx_defaults.build_flags} ;build_flags = ${core32_stage.build_flags} [core32_stage] -platform_packages = tool-esptoolpy@1.20800.0 - framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#f7fb00632e04d74a7890a77fa7dbbb8ae572e866 +platform_packages = tool-esptoolpy@1.20800.0 + framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#f7fb00632e04d74a7890a77fa7dbbb8ae572e866 -build_flags = ${common32.build_flags} +build_flags = ${esp32_defaults.build_flags} -D ESP32_STAGE=true ; *** Debug version used for PlatformIO Home Project Inspection