Skip to content

Commit 02cd3f2

Browse files
authored
fix uploadfs
1 parent 1c0b5d8 commit 02cd3f2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

platform.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ def install_tool(TOOL, retry_count=0):
193193
if check_tool in package:
194194
install_tool(package)
195195

196-
if "buildfs" in targets:
196+
if "buildfs" or "uploadfs" in targets:
197197
filesystem = variables.get("board_build.filesystem", "littlefs")
198198
if filesystem == "littlefs":
199199
# ensure use of mklittlefs 3.2.0
200200
piopm_path = os.path.join(ProjectConfig.get_instance().get("platformio", "packages_dir"), "tool-mklittlefs", ".piopm")
201201
if os.path.exists(piopm_path):
202202
with open(piopm_path, "r") as file:
203203
package_data = json.load(file)
204-
if package_data['version'] == "4.0.0":
204+
if package_data['version'] != "3.2.0":
205205
os.remove(piopm_path)
206206
install_tool("tool-mklittlefs")
207207
elif filesystem == "fatfs":
@@ -232,10 +232,15 @@ def install_tool(TOOL, retry_count=0):
232232
os.path.join(mklittlefs400_dir, "package.json"),
233233
)
234234
shutil.copytree(mklittlefs400_dir, mklittlefs_dir, dirs_exist_ok=True)
235+
del self.packages["tool-mkfatfs"]
236+
elif filesystem == "fatfs":
237+
install_tool("tool-mkfatfs")
235238

236239
# Currently only Arduino Nano ESP32 uses the dfuutil tool as uploader
237240
if variables.get("board") == "arduino_nano_esp32":
238241
install_tool("tool-dfuutil-arduino")
242+
else:
243+
del self.packages["tool-dfuutil-arduino"]
239244

240245
return super().configure_default_packages(variables, targets)
241246

0 commit comments

Comments
 (0)