Skip to content

Commit 7d9cbdb

Browse files
committed
fixes ota offset
1 parent 84e7c2d commit 7d9cbdb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

builder/esp32.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,13 +1173,23 @@ def compile(*args): # NOQA
11731173
sys.exit(ret_code)
11741174

11751175
if not skip_partition_resize and partition_size == -1:
1176-
if 'Error: app partition is too small' in output:
1176+
1177+
for pattern in (
1178+
'Error: app partition is too small',
1179+
'Error: All app partitions are too small'
1180+
):
1181+
if pattern in output:
1182+
break
1183+
else:
1184+
pattern = None
1185+
1186+
if pattern is not None:
11771187
sys.stdout.write(
11781188
'\n\033[31;1m***** Resizing Partition *****\033[0m\n'
11791189
)
11801190
sys.stdout.flush()
11811191

1182-
app_size = output.rsplit('Error: app partition is too small', 1)[1]
1192+
app_size = output.rsplit(pattern, 1)[1]
11831193
app_size = app_size.split('micropython.bin size', 1)[1]
11841194
app_size = int(app_size.split(':', 1)[0].strip(), 16)
11851195

0 commit comments

Comments
 (0)