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