From a38146cc95925ea84a1837b4a88485992a922752 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 15 Jul 2025 18:42:30 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"Platform=202025.07.31=20Tasmota=20Ard?= =?UTF-8?q?uino=20Core=203.1.3.250712=20based=20on=20IDF=205.=E2=80=A6"=20?= =?UTF-8?q?(#23684)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 228588a6a3a005ef6cc88650225bb7c327f61f57. --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- pio-tools/custom_target.py | 27 ++++++++++++++------------- pio-tools/post_esp32.py | 10 +++++----- platformio_tasmota32.ini | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b7225f7c8..ea39a2f60 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ - [ ] Only relevant files were touched - [ ] Only one feature/fix was added per PR and the code change compiles without warnings - [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8 - - [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.3.250712 + - [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.3.250707 - [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla). _NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_ diff --git a/pio-tools/custom_target.py b/pio-tools/custom_target.py index 3ffb9833d..3480a1fc5 100644 --- a/pio-tools/custom_target.py +++ b/pio-tools/custom_target.py @@ -27,6 +27,7 @@ Import("env") platform = env.PioPlatform() board = env.BoardConfig() mcu = board.get("build.mcu", "esp32") +esptoolpy = os.path.join(ProjectConfig.get_instance().get("platformio", "packages_dir"),("tool-esptoolpy") or "", "esptool.py") IS_WINDOWS = sys.platform.startswith("win") class FSType(Enum): @@ -174,7 +175,7 @@ def get_partition_table(): if not os.path.exists(build_dir): os.makedirs(build_dir) fs_file = join(env.subst("$BUILD_DIR"), "partition_table_from_flash.bin") - esptool_flags = [ + esptoolpy_flags = [ "--chip", mcu, "--port", upload_port, "--baud", download_speed, @@ -185,9 +186,9 @@ def get_partition_table(): "0x1000", fs_file ] - esptool_cmd = [env["PYTHONEXE"], env.subst("$OBJCOPY")] + esptool_flags + esptoolpy_cmd = [env["PYTHONEXE"], esptoolpy] + esptoolpy_flags try: - returncode = subprocess.call(esptool_cmd, shell=False) + returncode = subprocess.call(esptoolpy_cmd, shell=False) except subprocess.CalledProcessError as exc: print("Downloading failed with " + str(exc)) with open(fs_file, mode="rb") as file: @@ -227,7 +228,7 @@ def download_fs(fs_info: FSInfo): env.AutodetectUploadPort() upload_port = join(env.get("UPLOAD_PORT", "none")) fs_file = join(env.subst("$BUILD_DIR"), f"downloaded_fs_{hex(fs_info.start)}_{hex(fs_info.length)}.bin") - esptool_flags = [ + esptoolpy_flags = [ "--chip", mcu, "--port", upload_port, "--baud", download_speed, @@ -238,10 +239,10 @@ def download_fs(fs_info: FSInfo): hex(fs_info.length), fs_file ] - esptool_cmd = [env["PYTHONEXE"], env.subst("$OBJCOPY")] + esptool_flags + esptoolpy_cmd = [env["PYTHONEXE"], esptoolpy] + esptoolpy_flags print("Download filesystem image") try: - returncode = subprocess.call(esptool_cmd, shell=False) + returncode = subprocess.call(esptoolpy_cmd, shell=False) return (True, fs_file) except subprocess.CalledProcessError as exc: print("Downloading failed with " + str(exc)) @@ -295,7 +296,7 @@ def upload_factory(*args, **kwargs): env.AutodetectUploadPort() upload_port = join(env.get("UPLOAD_PORT", "none")) if "tasmota" in target_firm: - esptool_flags = [ + esptoolpy_flags = [ "--chip", mcu, "--port", upload_port, "--baud", env.subst("$UPLOAD_SPEED"), @@ -303,9 +304,9 @@ def upload_factory(*args, **kwargs): "0x0", target_firm ] - esptool_cmd = [env["PYTHONEXE"], env.subst("$OBJCOPY")] + esptool_flags + esptoolpy_cmd = [env["PYTHONEXE"], esptoolpy] + esptoolpy_flags print("Flash firmware at address 0x0") - subprocess.call(esptool_cmd, shell=False) + subprocess.call(esptoolpy_cmd, shell=False) def esp32_use_external_crashreport(*args, **kwargs): try: @@ -357,15 +358,15 @@ def reset_target(*args, **kwargs): if "none" in upload_port: env.AutodetectUploadPort() upload_port = join(env.get("UPLOAD_PORT", "none")) - esptool_flags = [ + esptoolpy_flags = [ "--no-stub", "--chip", mcu, "--port", upload_port, "flash-id" ] - esptool_cmd = [env["PYTHONEXE"], env.subst("$OBJCOPY")] + esptool_flags + esptoolpy_cmd = [env["PYTHONEXE"], esptoolpy] + esptoolpy_flags print("Try to reset device") - subprocess.call(esptool_cmd, shell=False) + subprocess.call(esptoolpy_cmd, shell=False) # Custom Target Definitions env.AddCustomTarget( @@ -375,7 +376,7 @@ env.AddCustomTarget( reset_target ], title="Reset ESP32 target", - description="This command resets ESP32x target via esptool", + description="This command resets ESP32x target via esptoolpy", ) env.AddCustomTarget( diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index a36c8dda9..1c7474f3c 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -36,8 +36,8 @@ from colorama import Fore, Back, Style from SCons.Script import COMMAND_LINE_TARGETS from platformio.project.config import ProjectConfig -esptool = env.subst("$OBJCOPY") -sys.path.append(esptool) +esptoolpy = os.path.join(ProjectConfig.get_instance().get("platformio", "packages_dir"), "tool-esptoolpy") +sys.path.append(esptoolpy) import esptool config = env.GetProjectConfig() @@ -102,10 +102,10 @@ def esp32_detect_flashsize(): if not "esptool" in uploader: return "4MB",False else: - esptool_flags = ["flash-id"] - esptool_cmd = [env["PYTHONEXE"], env.subst("$OBJCOPY")] + esptool_flags + esptoolpy_flags = ["flash-id"] + esptoolpy_cmd = ["esptool"] + esptoolpy_flags try: - output = subprocess.run(esptool_cmd, capture_output=True).stdout.splitlines() + output = subprocess.run(esptoolpy_cmd, capture_output=True).stdout.splitlines() for l in output: if l.decode().startswith("Detected flash size: "): size = (l.decode().split(": ")[1]) diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index c05369354..31ac40d5a 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -81,7 +81,7 @@ lib_ignore = ${esp32_defaults.lib_ignore} ccronexpr [core32] -platform = https://github.com/tasmota/platform-espressif32/releases/download/2025.07.31/platform-espressif32.zip +platform = https://github.com/tasmota/platform-espressif32/releases/download/2025.07.30/platform-espressif32.zip platform_packages = build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags}