@@ -187,15 +187,15 @@ def install_tool(TOOL, retry_count=0):
187
187
if check_tool in package :
188
188
install_tool (package )
189
189
190
- if "buildfs" in targets :
190
+ if "buildfs" or "uploadfs" in targets :
191
191
filesystem = variables .get ("board_build.filesystem" , "littlefs" )
192
192
if filesystem == "littlefs" :
193
193
# ensure use of mklittlefs 3.2.0
194
194
piopm_path = os .path .join (ProjectConfig .get_instance ().get ("platformio" , "packages_dir" ), "tool-mklittlefs" , ".piopm" )
195
195
if os .path .exists (piopm_path ):
196
196
with open (piopm_path , "r" ) as file :
197
197
package_data = json .load (file )
198
- if package_data ['version' ] == "4.0 .0" :
198
+ if package_data ['version' ] != "3.2 .0" :
199
199
os .remove (piopm_path )
200
200
install_tool ("tool-mklittlefs" )
201
201
elif filesystem == "fatfs" :
@@ -226,10 +226,15 @@ def install_tool(TOOL, retry_count=0):
226
226
os .path .join (mklittlefs400_dir , "package.json" ),
227
227
)
228
228
shutil .copytree (mklittlefs400_dir , mklittlefs_dir , dirs_exist_ok = True )
229
+ del self .packages ["tool-mkfatfs" ]
230
+ elif filesystem == "fatfs" :
231
+ install_tool ("tool-mkfatfs" )
229
232
230
233
# Currently only Arduino Nano ESP32 uses the dfuutil tool as uploader
231
234
if variables .get ("board" ) == "arduino_nano_esp32" :
232
235
install_tool ("tool-dfuutil-arduino" )
236
+ else :
237
+ del self .packages ["tool-dfuutil-arduino" ]
233
238
234
239
return super ().configure_default_packages (variables , targets )
235
240
0 commit comments