From 16d9ba7a5e878284380b9e5a52838e110e15f601 Mon Sep 17 00:00:00 2001 From: Sly Gryphon Date: Fri, 29 Mar 2024 15:46:44 +1000 Subject: [PATCH 1/2] Add framework-arduinoespressif32-libs SDK to platform and load when referenced by platform package --- platform.json | 6 ++++++ platform.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/platform.json b/platform.json index da7586bd8..b36b6b8a3 100644 --- a/platform.json +++ b/platform.json @@ -81,6 +81,12 @@ "owner": "platformio", "version": "~3.20014.0" }, + "framework-arduinoespressif32-libs": { + "type": "sdk", + "optional": true, + "owner": "espressif", + "version": "~5.1.0" + }, "framework-espidf": { "type": "framework", "optional": true, diff --git a/platform.py b/platform.py index 54629c4f3..b923610d8 100644 --- a/platform.py +++ b/platform.py @@ -326,6 +326,7 @@ def _parse_version(original_version): ) toolchain_remap = { + "esp32-arduino-libs": "framework-arduinoespressif32-libs", "xtensa-esp32-elf-gcc": "toolchain-xtensa-esp32", "xtensa-esp32s2-elf-gcc": "toolchain-xtensa-esp32s2", "xtensa-esp32s3-elf-gcc": "toolchain-xtensa-esp32s3", @@ -385,6 +386,8 @@ def configure_arduino_toolchains(self, package_index): self.packages[toolchain_package]["version"] = version self.packages[toolchain_package]["owner"] = "espressif" self.packages[toolchain_package]["type"] = "toolchain" + if (toolchain_package == "framework-arduinoespressif32-libs"): + self.packages[toolchain_package]["optional"] = False def configure_upstream_arduino_packages(self, url_items): framework_index_file = os.path.join( From 2e23f27f18fdc182839ea779130948f4572d60d5 Mon Sep 17 00:00:00 2001 From: Sly Gryphon Date: Fri, 29 Mar 2024 15:46:44 +1000 Subject: [PATCH 2/2] Update version number parsing to include esp-arduino-libs format --- platform.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform.py b/platform.py index b923610d8..abd09da41 100644 --- a/platform.py +++ b/platform.py @@ -305,6 +305,7 @@ def _parse_version(original_version): r"^gcc(?P\d+)_(?P\d+)_(?P\d+)-esp-(?P.+)$", r"^esp-(?P.+)-(?P\d+)\.(?P\d+)\.?(?P\d+)$", r"^esp-(?P\d+)\.(?P\d+)\.(?P\d+)(_(?P.+))?$", + r"^idf-release_v(?P\d+)\.(?P\d+)(.(?P\d+))?(-(?P.+))?$", ) for pattern in version_patterns: match = re.search(pattern, original_version) @@ -312,7 +313,7 @@ def _parse_version(original_version): result = "%s.%s.%s" % ( match.group("MAJOR"), match.group("MINOR"), - match.group("PATCH"), + match.group("PATCH") if match.group("PATCH") is not None else "0", ) if match.group("EXTRA"): result = result + "+%s" % match.group("EXTRA")