Skip to content

Commit 741eb15

Browse files
valerosjonathandreyer
authored andcommitted
Update toolchain packages for IDF integration
Issue platformio#1360
1 parent e7c4381 commit 741eb15

File tree

3 files changed

+41
-18
lines changed

3 files changed

+41
-18
lines changed

builder/frameworks/espidf.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,23 @@
5858
idf_variant = mcu.lower()
5959

6060
# Required until Arduino switches to v5
61-
IDF5 = platform.get_package_version("framework-espidf").split(".")[1].startswith("5")
61+
IDF5 = (
62+
platform.get_package_version("framework-espidf")
63+
.split(".")[1]
64+
.startswith("5")
65+
)
6266
IDF_ENV_VERSION = "1.0.0"
6367
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
6468
TOOLCHAIN_DIR = platform.get_package_dir(
65-
"toolchain-%s" % ("riscv32-esp" if mcu in ("esp32c3", "esp32c6") else ("xtensa-%s" % mcu))
69+
"toolchain-riscv32-esp"
70+
if mcu in ("esp32c3", "esp32c6")
71+
else (
72+
(
73+
"toolchain-xtensa-esp-elf"
74+
if "arduino" not in env.subst("$PIOFRAMEWORK")
75+
else "toolchain-xtensa-%s" % mcu
76+
)
77+
)
6678
)
6779

6880

platform.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,19 @@
3333
"toolchain-xtensa-esp32": {
3434
"type": "toolchain",
3535
"owner": "espressif",
36-
"version": "8.4.0+2021r2-patch5",
37-
"optionalVersions": ["12.2.0+20230208"]
36+
"version": "8.4.0+2021r2-patch5"
3837
},
3938
"toolchain-xtensa-esp32s2": {
4039
"type": "toolchain",
4140
"optional": true,
4241
"owner": "espressif",
43-
"version": "8.4.0+2021r2-patch5",
44-
"optionalVersions": ["12.2.0+20230208"]
42+
"version": "8.4.0+2021r2-patch5"
4543
},
4644
"toolchain-xtensa-esp32s3": {
4745
"type": "toolchain",
4846
"optional": true,
4947
"owner": "espressif",
50-
"version": "8.4.0+2021r2-patch5",
51-
"optionalVersions": ["12.2.0+20230208"]
48+
"version": "8.4.0+2021r2-patch5"
5249
},
5350
"toolchain-riscv32-esp": {
5451
"type": "toolchain",
@@ -57,6 +54,12 @@
5754
"version": "8.4.0+2021r2-patch5",
5855
"optionalVersions": ["13.2.0+20230928"]
5956
},
57+
"toolchain-xtensa-esp-elf": {
58+
"type": "toolchain",
59+
"optional": true,
60+
"owner": "platformio",
61+
"version": "13.2.0+20230928"
62+
},
6063
"toolchain-esp32ulp": {
6164
"type": "toolchain",
6265
"optional": true,

platform.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,30 @@ def configure_default_packages(self, variables, targets):
114114
if "arduino" in frameworks:
115115
# Downgrade the IDF version for mixed Arduino+IDF projects
116116
self.packages["framework-espidf"]["version"] = "~3.40406.0"
117+
# Delete the latest toolchain packages from config
118+
self.packages.pop("toolchain-xtensa-esp-elf", None)
117119
else:
118-
# Use the latest toolchains available for IDF v5.0
120+
# Disable old toolchain packages and use the latest
121+
# available for IDF v5.0
119122
for target in (
120123
"xtensa-esp32",
121124
"xtensa-esp32s2",
122125
"xtensa-esp32s3",
123-
"riscv32-esp",
124126
):
125-
self.packages["toolchain-%s" % target]["version"] = (
126-
"13.2.0+20230928"
127-
if target == "riscv32-esp"
128-
else "12.2.0+20230208"
129-
)
130-
if target == "riscv32-esp":
131-
# Pull the latest RISC-V toolchain from PlatformIO organization
132-
self.packages["toolchain-%s" % target]["owner"] = "platformio"
127+
self.packages.pop("toolchain-%s" % target, None)
128+
129+
if mcu in ("esp32c3", "esp32c6"):
130+
self.packages.pop("toolchain-xtensa-esp-elf", None)
131+
else:
132+
self.packages["toolchain-xtensa-esp-elf"][
133+
"optional"
134+
] = False
135+
136+
# Pull the latest RISC-V toolchain from PlatformIO organization
137+
self.packages["toolchain-riscv32-esp"]["owner"] = "platformio"
138+
self.packages["toolchain-riscv32-esp"][
139+
"version"
140+
] = "13.2.0+20230928"
133141

134142
if "arduino" in frameworks:
135143
# Disable standalone GDB packages for Arduino and Arduino/IDF projects

0 commit comments

Comments
 (0)