Skip to content

Commit 8643a8b

Browse files
committed
Implement "erase" target
1 parent bd9ec53 commit 8643a8b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

builder/main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ def _update_max_upload_size(env):
184184
SIZECHECKCMD="$SIZETOOL -A -d $SOURCES",
185185
SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES',
186186

187+
ERASEFLAGS=[
188+
"-cp", "$UPLOAD_PORT",
189+
"-cd", "$UPLOAD_RESETMETHOD"
190+
],
191+
ERASECMD='esptool $ERASEFLAGS -ce',
192+
187193
PROGSUFFIX=".elf"
188194
)
189195

@@ -376,6 +382,17 @@ def _update_max_upload_size(env):
376382
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")])
377383
env.AlwaysBuild(target_upload)
378384

385+
#
386+
# Target: Erase Flash
387+
#
388+
389+
AlwaysBuild(
390+
env.Alias("erase", None, [
391+
env.VerboseAction(env.AutodetectUploadPort,
392+
"Looking for serial port..."),
393+
env.VerboseAction("$ERASECMD", "Ready for erasing")
394+
]))
395+
379396

380397
#
381398
# Default targets

0 commit comments

Comments
 (0)