From 6f0078eadcbe1a00e022c01227f958a3ee86c09d Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:30:41 +0200 Subject: [PATCH 01/14] tasmota32c2 is a default env now --- examples/tasmota_platformio_override.ini | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/examples/tasmota_platformio_override.ini b/examples/tasmota_platformio_override.ini index dc80a73c6..c31712c3e 100644 --- a/examples/tasmota_platformio_override.ini +++ b/examples/tasmota_platformio_override.ini @@ -7,14 +7,3 @@ default_envs = [env:tasmota32_base] platform = symlink://. - -[env:tasmota32c2] -extends = env:tasmota32_base -board = esp32c2 -build_unflags = ${env:tasmota32_base.build_unflags - -mtarget-align - -flto -build_flags = ${env:tasmota32_base.build_flags} - -fno-lto - -DFIRMWARE_TASMOTA32 - -DOTA_URL='""' From 8f93bdac200b30c99abdee17524a8e527e0ec31a Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:22:41 +0200 Subject: [PATCH 02/14] Update filter_exception_decoder.py --- monitor/filter_exception_decoder.py | 146 ++++++++++++++-------------- 1 file changed, 75 insertions(+), 71 deletions(-) diff --git a/monitor/filter_exception_decoder.py b/monitor/filter_exception_decoder.py index ecb4ef7cd..d0f4a39b3 100644 --- a/monitor/filter_exception_decoder.py +++ b/monitor/filter_exception_decoder.py @@ -32,76 +32,57 @@ class Esp32ExceptionDecoder(DeviceMonitorFilterBase): NAME = "esp32_exception_decoder" + ADDR_PATTERN = re.compile(r"((?:0x[0-9a-fA-F]{8}[: ]?)+)\s?$") + ADDR_SPLIT = re.compile(r"[ :]") + PREFIX_RE = re.compile(r"^ *") + def __call__(self): self.buffer = "" - # regex matches potential PC value (0x4xxxxxxx) - # Logic identical to https://github.com/espressif/esp-idf/blob/master/tools/idf_monitor_base/constants.py#L56 - self.pcaddr_re = re.compile(r'0x4[0-9a-f]{7}', re.IGNORECASE) self.firmware_path = None self.addr2line_path = None self.enabled = self.setup_paths() - return self - - def setup_paths(self): - self.project_dir = os.path.abspath(self.project_dir) - - self.project_strip_dir = os.environ.get("esp32_exception_decoder_project_strip_dir") - self.firmware_path = os.environ.get("esp32_exception_decoder_firmware_path") - self.addr2line_path = os.environ.get("esp32_exception_decoder_addr2line_path") - - if self.project_strip_dir is None: - self.project_strip_dir = self.project_dir - - try: - if self.firmware_path is None or self.addr2line_path is None: - # Only load if necessary, as the call is expensive - data = load_build_metadata(self.project_dir, self.environment) - - if self.firmware_path is None: - # Only do this check when the firmware path is not externally provided - if self.config.get("env:" + self.environment, "build_type") != "debug": - print( + if self.config.get("env:" + self.environment, "build_type") != "debug": + print( """ Please build project in debug configuration to get more details about an exception. See https://docs.platformio.org/page/projectconf/build_configurations.html """ - ) - self.firmware_path = data["prog_path"] + ) + + return self + def setup_paths(self): + self.project_dir = os.path.abspath(self.project_dir) + try: + data = load_build_metadata(self.project_dir, self.environment, cache=True) + + self.firmware_path = data["prog_path"] if not os.path.isfile(self.firmware_path): sys.stderr.write( - "%s: disabling, firmware at %s does not exist, rebuild the project?\n" + "%s: firmware at %s does not exist, rebuild the project?\n" % (self.__class__.__name__, self.firmware_path) ) return False - if self.addr2line_path is None: - cc_path = data.get("cc_path", "") - if "-gcc" in cc_path: - self.addr2line_path = cc_path.replace("-gcc", "-addr2line") - else: - sys.stderr.write( - "%s: disabling, failed to find addr2line.\n" % self.__class__.__name__ - ) - return False - - if not os.path.isfile(self.addr2line_path): - sys.stderr.write( - "%s: disabling, addr2line at %s does not exist\n" - % (self.__class__.__name__, self.addr2line_path) - ) - return False - - return True + cc_path = data.get("cc_path", "") + if "-gcc" in cc_path: + path = cc_path.replace("-gcc", "-addr2line") + if os.path.isfile(path): + self.addr2line_path = path + return True except PlatformioException as e: sys.stderr.write( "%s: disabling, exception while looking for addr2line: %s\n" % (self.__class__.__name__, e) ) return False + sys.stderr.write( + "%s: disabling, failed to find addr2line.\n" % self.__class__.__name__ + ) + return False def rx(self, text): if not self.enabled: @@ -121,47 +102,70 @@ def rx(self, text): self.buffer = "" last = idx + 1 - # Output each trace on a separate line below ours - # Logic identical to https://github.com/espressif/esp-idf/blob/master/tools/idf_monitor_base/logger.py#L131 - for m in re.finditer(self.pcaddr_re, line): - if m is None: - continue - - trace = self.get_backtrace(m) - if len(trace) != "": - text = text[: last] + trace + text[last :] - last += len(trace) + m = self.ADDR_PATTERN.search(line) + if m is None: + continue + trace = self.build_backtrace(line, m.group(1)) + if trace: + text = text[: idx + 1] + trace + text[idx + 1 :] + last += len(trace) return text - def get_backtrace(self, match): + def is_address_ignored(self, address): + return address in ("", "0x00000000") + + def filter_addresses(self, adresses_str): + addresses = self.ADDR_SPLIT.split(adresses_str) + size = len(addresses) + while size > 1 and self.is_address_ignored(addresses[size-1]): + size -= 1 + return addresses[:size] + + def build_backtrace(self, line, address_match): + addresses = self.filter_addresses(address_match) + if not addresses: + return "" + + prefix_match = self.PREFIX_RE.match(line) + prefix = prefix_match.group(0) if prefix_match is not None else "" + trace = "" enc = "mbcs" if IS_WINDOWS else "utf-8" args = [self.addr2line_path, u"-fipC", u"-e", self.firmware_path] try: - addr = match.group() - output = ( - subprocess.check_output(args + [addr]) - .decode(enc) - .strip() - ) - output = output.replace( - "\n", "\n " - ) # newlines happen with inlined methods - output = self.strip_project_dir(output) - # Output the trace in yellow color so that it is easier to spot - trace += "\033[33m=> %s: %s\033[0m\n" % (addr, output) + i = 0 + for addr in addresses: + output = ( + subprocess.check_output(args + [addr]) + .decode(enc) + .strip() + ) + + # newlines happen with inlined methods + output = output.replace( + "\n", "\n " + ) + + # throw out addresses not from ELF + if output == "?? ??:0": + continue + + output = self.strip_project_dir(output) + trace += "%s #%-2d %s in %s\n" % (prefix, i, addr, output) + i += 1 except subprocess.CalledProcessError as e: sys.stderr.write( "%s: failed to call %s: %s\n" % (self.__class__.__name__, self.addr2line_path, e) ) - return trace + + return trace + "\n" if trace else "" def strip_project_dir(self, trace): while True: - idx = trace.find(self.project_strip_dir) + idx = trace.find(self.project_dir) if idx == -1: break - trace = trace[:idx] + trace[idx + len(self.project_strip_dir) + 1 :] + trace = trace[:idx] + trace[idx + len(self.project_dir) + 1 :] return trace From 9d4b8e6b355eba14b6c1c3b38cf42a7a1d101ec9 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:44:28 +0200 Subject: [PATCH 03/14] Build 2297 IDF 5.1 updates --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 348c7fb77..e34a5133f 100644 --- a/platform.json +++ b/platform.json @@ -33,7 +33,7 @@ "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.0.240412/framework-arduinoespressif32.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2297/framework-arduinoespressif32-all-release_v5.1-e1e25bb.zip" }, "framework-arduino-solo1": { "type": "framework", From ad8f520e68ca37770d5481d631c6b2544fc31dce Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 20 Apr 2024 18:47:52 +0200 Subject: [PATCH 04/14] Build 2307 --- platform.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform.json b/platform.json index e34a5133f..a6fec8058 100644 --- a/platform.json +++ b/platform.json @@ -33,19 +33,19 @@ "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2297/framework-arduinoespressif32-all-release_v5.1-e1e25bb.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2307/framework-arduinoespressif32-all-release_v5.1-e1e25bb.zip" }, "framework-arduino-solo1": { "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.0.240412/framework-arduinoespressif32-solo1.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2309/framework-arduinoespressif32-solo1-release_v5.1-e1e25bb.zip" }, "framework-arduino-ITEAD": { "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.0.240412/framework-arduinoespressif32-ITEAD.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2308/framework-arduinoespressif32-ITEAD-esp32-release_v5.1-e1e25bb.zip" }, "framework-espidf": { "type": "framework", From 17a500c78c21f277d46d439827640b1d5422724c Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 20 Apr 2024 18:53:37 +0200 Subject: [PATCH 05/14] Update IDF v5.1.3.240418 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index a6fec8058..f62a9ff91 100644 --- a/platform.json +++ b/platform.json @@ -51,7 +51,7 @@ "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/tasmota/esp-idf/releases/download/v5.1.3.240325/esp-idf-v5.1.3.zip" + "version": "https://github.com/tasmota/esp-idf/releases/download/v5.1.3.240418/esp-idf-v5.1.3.zip" }, "toolchain-xtensa-esp32": { "type": "toolchain", From 43e09b142789e2313823d462403df9b9768a2eb4 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 20 Apr 2024 19:33:09 +0200 Subject: [PATCH 06/14] Update platformio.ini --- examples/espidf-arduino-littlefs/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/espidf-arduino-littlefs/platformio.ini b/examples/espidf-arduino-littlefs/platformio.ini index ec6e9e2f8..4b02d04af 100644 --- a/examples/espidf-arduino-littlefs/platformio.ini +++ b/examples/espidf-arduino-littlefs/platformio.ini @@ -11,6 +11,7 @@ [env] platform = espressif32 framework = arduino, espidf +board_build.esp-idf.preserve_source_file_extension = yes monitor_speed = 115200 [env:esp32-s3] From 0427948d846fc14a881e018e48dd7025017b6f9b Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 20 Apr 2024 20:36:35 +0200 Subject: [PATCH 07/14] change `preserve_source_file_extension` to `True` as default --- builder/frameworks/espidf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index ab09718cf..a214aa542 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -691,7 +691,7 @@ def compile_source_files( obj_path = os.path.join(obj_path, os.path.basename(src_path)) preserve_source_file_extension = board.get( - "build.esp-idf.preserve_source_file_extension", False + "build.esp-idf.preserve_source_file_extension", True ) objects.append( From ad12683211f5b5a60c326aaf8193a45a0aecbdb1 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 20 Apr 2024 21:04:09 +0200 Subject: [PATCH 08/14] revert setting --- examples/espidf-arduino-littlefs/platformio.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/espidf-arduino-littlefs/platformio.ini b/examples/espidf-arduino-littlefs/platformio.ini index 4b02d04af..ec6e9e2f8 100644 --- a/examples/espidf-arduino-littlefs/platformio.ini +++ b/examples/espidf-arduino-littlefs/platformio.ini @@ -11,7 +11,6 @@ [env] platform = espressif32 framework = arduino, espidf -board_build.esp-idf.preserve_source_file_extension = yes monitor_speed = 115200 [env:esp32-s3] From 54aaf87613259120f80ae1f06e9b85c2bc184a0f Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 20 Apr 2024 23:02:39 +0200 Subject: [PATCH 09/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d7438a67a..14c73e2dc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Espressif Systems is a privately held fabless semiconductor company. They provid 1. [Install PlatformIO](http://platformio.org) 2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file: -### Development build Arduino 3.0.0-rc1 and IDF 5.1.3 +### Development build Arduino 3.0.0 and IDF 5.1.3 (build from development branches) Support for the ESP32/ESP32solo1, ESP32C2, ESP32C3, ESP32C6, ESP32S2, ESP32S3 and ESP32-H2 ``` [platformio] From 092759d4f04216f5933a16fa612191e5ed24280e Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 21 Apr 2024 22:49:20 +0200 Subject: [PATCH 10/14] Build 2316 --- platform.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform.json b/platform.json index f62a9ff91..767b97544 100644 --- a/platform.json +++ b/platform.json @@ -33,19 +33,19 @@ "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2307/framework-arduinoespressif32-all-release_v5.1-e1e25bb.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2316/framework-arduinoespressif32-all-release_v5.1-33bc584.zip" }, "framework-arduino-solo1": { "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2309/framework-arduinoespressif32-solo1-release_v5.1-e1e25bb.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2318/framework-arduinoespressif32-solo1-release_v5.1-33bc584.zip" }, "framework-arduino-ITEAD": { "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2308/framework-arduinoespressif32-ITEAD-esp32-release_v5.1-e1e25bb.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2317/framework-arduinoespressif32-ITEAD-esp32-release_v5.1-33bc584.zip" }, "framework-espidf": { "type": "framework", From eb402588b90db65344530c7e1af5a237f42a596b Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:52:18 +0200 Subject: [PATCH 11/14] Build 2322 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 767b97544..b903846df 100644 --- a/platform.json +++ b/platform.json @@ -33,7 +33,7 @@ "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2316/framework-arduinoespressif32-all-release_v5.1-33bc584.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2322/framework-arduinoespressif32-all-release_v5.1-33bc584.zip" }, "framework-arduino-solo1": { "type": "framework", From ca3d3a216879a87a5435b6be179be9420b4d81ef Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:47:04 +0200 Subject: [PATCH 12/14] Build 2323 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index b903846df..48150cd03 100644 --- a/platform.json +++ b/platform.json @@ -33,7 +33,7 @@ "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2322/framework-arduinoespressif32-all-release_v5.1-33bc584.zip" + "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2323/framework-arduinoespressif32-all-release_v5.1-33bc584.zip" }, "framework-arduino-solo1": { "type": "framework", From 3f01ec594194126e855be734927c39fdced5bdbd Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:12:30 +0200 Subject: [PATCH 13/14] Platform 3.0.0.240413 --- platform.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform.json b/platform.json index 48150cd03..0fe800957 100644 --- a/platform.json +++ b/platform.json @@ -18,7 +18,7 @@ "type": "git", "url": "https://github.com/tasmota/platform-espressif32.git" }, - "version": "2024.04.12", + "version": "2024.04.13", "frameworks": { "arduino": { "script": "builder/frameworks/arduino.py" @@ -33,19 +33,19 @@ "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2323/framework-arduinoespressif32-all-release_v5.1-33bc584.zip" + "version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.0.240413/framework-arduinoespressif32.zip" }, "framework-arduino-solo1": { "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2318/framework-arduinoespressif32-solo1-release_v5.1-33bc584.zip" + "version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.0.240413/framework-arduinoespressif32-solo1.zip" }, "framework-arduino-ITEAD": { "type": "framework", "optional": true, "owner": "tasmota", - "version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2317/framework-arduinoespressif32-ITEAD-esp32-release_v5.1-33bc584.zip" + "version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.0.240413/framework-arduinoespressif32-ITEAD.zip" }, "framework-espidf": { "type": "framework", From 1445800dc3116650c0384d4dec4aaa3f3952599e Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:30:54 +0200 Subject: [PATCH 14/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14c73e2dc..1927f06fc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Espressif Systems is a privately held fabless semiconductor company. They provid 1. [Install PlatformIO](http://platformio.org) 2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file: -### Development build Arduino 3.0.0 and IDF 5.1.3 (build from development branches) +### Development build Arduino 3.0.0-rc and IDF 5.1.3 Support for the ESP32/ESP32solo1, ESP32C2, ESP32C3, ESP32C6, ESP32S2, ESP32S3 and ESP32-H2 ``` [platformio]