49
49
sys .stderr .write ("Error: Couldn't execute 'idf_tools.py install'\n " )
50
50
else :
51
51
shutil .copytree (join (IDF_TOOLS_PATH_DEFAULT , "tools" , "tool-packages" ), join (IDF_TOOLS_PATH_DEFAULT , "tools" ), symlinks = False , ignore = None , ignore_dangling_symlinks = False , dirs_exist_ok = True )
52
- for p in ("tool-mklittlefs" , "tool-mkfatfs" , "tool-mkspiffs" , "tool-dfuutil" , "tool-openocd" , "tool-cmake" , "tool-ninja" , "tool-cppcheck" , "tool-clangtidy" , "tool-pvs-studio" , "tc-xt-esp32" , "tc-xt-esp32s2" , "tc-xt-esp32s3" , "tc-ulp" , "tc-rv32" , "tl-xt-gdb" , "tl-rv-gdb" , "contrib-piohome" , "contrib-pioremote" ):
52
+ for p in ("tool-mklittlefs" , "tool-mkfatfs" , "tool-mkspiffs" , "tool-dfuutil" , "tool-openocd" , "tool-cmake" , "tool-ninja" , "tool-cppcheck" , "tool-clangtidy" , "tool-pvs-studio" , "tc-xt-esp32" , "tc-xt-esp32s2" , "tc-xt-esp32s3" , "tc-ulp" , "tc-rv32" , "tl-xt-gdb" , "tl-rv-gdb" , "contrib-piohome" , "contrib-pioremote" ):
53
53
tl_path = "file://" + join (IDF_TOOLS_PATH_DEFAULT , "tools" , p )
54
54
pm .install (tl_path )
55
55
@@ -72,8 +72,10 @@ def configure_default_packages(self, variables, targets):
72
72
self .packages ["riscv32-esp-elf-gdb" ]["optional" ] = True
73
73
self .packages ["xtensa-esp-elf-gdb" ]["optional" ] = True
74
74
75
- # Enable check tools only when "check_tool" is enabled
76
75
if tl_flag :
76
+ # Install tool is not needed anymore
77
+ del self .packages ["tl-install" ]
78
+ # Enable check tools only when "check_tool" is enabled
77
79
for p in self .packages :
78
80
if p in ("tool-cppcheck" , "tool-clangtidy" , "tool-pvs-studio" ):
79
81
self .packages [p ]["optional" ] = False if str (variables .get ("check_tool" )).strip ("['']" ) in p else True
@@ -82,6 +84,12 @@ def configure_default_packages(self, variables, targets):
82
84
self .packages ["framework-arduinoespressif32" ]["optional" ] = False
83
85
self .packages ["framework-arduinoespressif32-libs" ]["optional" ] = False
84
86
87
+ # packages for IDF and mixed Arduino+IDF projects
88
+ if tl_flag and "espidf" in frameworks :
89
+ for p in self .packages :
90
+ if p in ("tool-scons" , "tool-cmake" , "tool-ninja" ):
91
+ self .packages [p ]["optional" ] = False
92
+
85
93
if "" .join (targets ) in ("upload" , "buildfs" , "uploadfs" ):
86
94
filesystem = variables .get ("board_build.filesystem" , "littlefs" )
87
95
if filesystem == "littlefs" :
@@ -125,23 +133,28 @@ def configure_default_packages(self, variables, targets):
125
133
else :
126
134
del self .packages ["tool-dfuutil" ]
127
135
128
- # Enable needed toolchains
129
- for available_mcu in ("esp32" , "esp32s2" , "esp32s3" ):
130
- if available_mcu == mcu and tl_flag :
136
+ # Enable needed toolchain for MCU
137
+ if tl_flag and mcu in ("esp32" , "esp32s2" , "esp32s3" ):
138
+ for available_mcu in ( "esp32" , "esp32s2" , "esp32s3" ) :
131
139
tc_path = "file://" + join (IDF_TOOLS_PATH_DEFAULT , "tools" , "tc-xt-%s" % mcu )
132
140
self .packages ["toolchain-xtensa-%s" % mcu ]["optional" ] = False
133
141
self .packages ["toolchain-xtensa-%s" % mcu ]["version" ] = tc_path
134
- if available_mcu == "esp32" :
135
- del self .packages ["toolchain-riscv32-esp" ]
136
- # Enable riscv and ULP toolchains
137
- if mcu in ("esp32s2" , "esp32s3" , "esp32c2" , "esp32c3" , "esp32c6" , "esp32h2" ):
138
- if mcu in ("esp32c2" , "esp32c3" , "esp32c6" , "esp32h2" ):
139
- del self .packages ["toolchain-esp32ulp" ]
140
- # RISC-V based toolchain for ESP32C3, ESP32C6 ESP32S2, ESP32S3 ULP
142
+ else :
141
143
if tl_flag :
142
144
tc_path = "file://" + join (IDF_TOOLS_PATH_DEFAULT , "tools" , "tc-rv32" )
143
145
self .packages ["toolchain-riscv32-esp" ]["optional" ] = False
144
146
self .packages ["toolchain-riscv32-esp" ]["version" ] = tc_path
147
+
148
+ # Enable FSM ULP toolchain for ESP32, ESP32S2, ESP32S3 when IDF is selected
149
+ if tl_flag and "espidf" in frameworks and mcu in ("esp32" , "esp32s2" , "esp32s3" ):
150
+ tc_path = "file://" + join (IDF_TOOLS_PATH_DEFAULT , "tools" , "tc-ulp" )
151
+ self .packages ["toolchain-esp32ulp" ]["optional" ] = False
152
+ self .packages ["toolchain-esp32ulp" ]["version" ] = tc_path
153
+ # Enable RISC-V ULP toolchain for ESP32C6, ESP32S2, ESP32S3 when IDF is selected
154
+ if tl_flag and "espidf" in frameworks and mcu in ("esp32s2" , "esp32s3" , "esp32c6" ):
155
+ tc_path = "file://" + join (IDF_TOOLS_PATH_DEFAULT , "tools" , "tc-rv32" )
156
+ self .packages ["toolchain-riscv32-esp" ]["optional" ] = False
157
+ self .packages ["toolchain-riscv32-esp" ]["version" ] = tc_path
145
158
146
159
return super ().configure_default_packages (variables , targets )
147
160
0 commit comments