@@ -144,6 +144,8 @@ def get_esptoolpy_reset_flags(resetmethod):
144
144
env = DefaultEnvironment ()
145
145
env .SConscript ("compat.py" , exports = "env" )
146
146
platform = env .PioPlatform ()
147
+ board = env .BoardConfig ()
148
+ filesystem = board .get ("build.filesystem" , "spiffs" )
147
149
148
150
env .Replace (
149
151
__get_flash_size = _get_flash_size ,
@@ -161,10 +163,16 @@ def get_esptoolpy_reset_flags(resetmethod):
161
163
ARFLAGS = ["rc" ],
162
164
163
165
#
164
- # Misc
166
+ # Filesystem
165
167
#
166
168
167
- MKFSTOOL = "mklittlefs" ,
169
+ MKFSTOOL = "mk%s" % filesystem ,
170
+ ESP8266_FS_IMAGE_NAME = env .get ("ESP8266_FS_IMAGE_NAME" , env .get (
171
+ "SPIFFSNAME" , filesystem )),
172
+
173
+ #
174
+ # Misc
175
+ #
168
176
169
177
SIZEPROGREGEXP = r"^(?:\.irom0\.text|\.text|\.text1|\.data|\.rodata|)\s+([0-9]+).*" ,
170
178
SIZEDATAREGEXP = r"^(?:\.data|\.rodata|\.bss)\s+([0-9]+).*" ,
@@ -223,14 +231,17 @@ def get_esptoolpy_reset_flags(resetmethod):
223
231
target_elf = join ("$BUILD_DIR" , "${PROGNAME}.elf" )
224
232
if set (["uploadfs" , "uploadfsota" ]) & set (COMMAND_LINE_TARGETS ):
225
233
fetch_fs_size (env )
226
- target_firm = join ("$BUILD_DIR" , "%s .bin" % env . get ( "FSIMAGENAME" , "fs" ) )
234
+ target_firm = join ("$BUILD_DIR" , "${ESP8266_FS_IMAGE_NAME} .bin" )
227
235
else :
228
236
target_firm = join ("$BUILD_DIR" , "${PROGNAME}.bin" )
229
237
else :
230
238
target_elf = env .BuildProgram ()
231
239
if set (["buildfs" , "uploadfs" , "uploadfsota" ]) & set (COMMAND_LINE_TARGETS ):
240
+ if filesystem not in ("littlefs" , "spiffs" ):
241
+ sys .stderr .write ("Filesystem %s is not supported!\n " % filesystem )
242
+ env .Exit (1 )
232
243
target_firm = env .DataToBin (
233
- join ("$BUILD_DIR" , env . get ( "FSIMAGENAME" , "fs" ) ), "$PROJECTDATA_DIR" )
244
+ join ("$BUILD_DIR" , "${ESP8266_FS_IMAGE_NAME}" ), "$PROJECTDATA_DIR" )
234
245
AlwaysBuild (target_firm )
235
246
else :
236
247
target_firm = env .ElfToBin (
0 commit comments