@@ -193,15 +193,15 @@ def install_tool(TOOL, retry_count=0):
193
193
if check_tool in package :
194
194
install_tool (package )
195
195
196
- if "buildfs" in targets :
196
+ if "buildfs" or "uploadfs" in targets :
197
197
filesystem = variables .get ("board_build.filesystem" , "littlefs" )
198
198
if filesystem == "littlefs" :
199
199
# ensure use of mklittlefs 3.2.0
200
200
piopm_path = os .path .join (ProjectConfig .get_instance ().get ("platformio" , "packages_dir" ), "tool-mklittlefs" , ".piopm" )
201
201
if os .path .exists (piopm_path ):
202
202
with open (piopm_path , "r" ) as file :
203
203
package_data = json .load (file )
204
- if package_data ['version' ] == "4.0 .0" :
204
+ if package_data ['version' ] != "3.2 .0" :
205
205
os .remove (piopm_path )
206
206
install_tool ("tool-mklittlefs" )
207
207
elif filesystem == "fatfs" :
@@ -232,10 +232,15 @@ def install_tool(TOOL, retry_count=0):
232
232
os .path .join (mklittlefs400_dir , "package.json" ),
233
233
)
234
234
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" )
235
238
236
239
# Currently only Arduino Nano ESP32 uses the dfuutil tool as uploader
237
240
if variables .get ("board" ) == "arduino_nano_esp32" :
238
241
install_tool ("tool-dfuutil-arduino" )
242
+ else :
243
+ del self .packages ["tool-dfuutil-arduino" ]
239
244
240
245
return super ().configure_default_packages (variables , targets )
241
246
0 commit comments