mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
idf.py: Add --before flag to esptool.py call
Merges https://github.com/espressif/esp-idf/pull/4125
This commit is contained in:
parent
a7107d9bbd
commit
6f6629e568
34
tools/idf.py
34
tools/idf.py
@ -334,6 +334,7 @@ def _get_esptool_args(args):
|
||||
flasher_args = json.load(f)
|
||||
|
||||
extra_esptool_args = flasher_args["extra_esptool_args"]
|
||||
result += ["--before", extra_esptool_args["before"]]
|
||||
result += ["--after", extra_esptool_args["after"]]
|
||||
return result
|
||||
|
||||
@ -772,26 +773,19 @@ def init_cli():
|
||||
for o, f in flash_items:
|
||||
cmd += o + " " + flasher_path(f) + " "
|
||||
|
||||
print(
|
||||
"%s -p %s -b %s --after %s write_flash %s"
|
||||
% (
|
||||
_safe_relpath(
|
||||
"%s/components/esptool_py/esptool/esptool.py"
|
||||
% os.environ["IDF_PATH"]
|
||||
),
|
||||
args.port or "(PORT)",
|
||||
args.baud,
|
||||
flasher_args["extra_esptool_args"]["after"],
|
||||
cmd.strip(),
|
||||
)
|
||||
)
|
||||
print(
|
||||
"or run 'idf.py -p %s %s'"
|
||||
% (
|
||||
args.port or "(PORT)",
|
||||
key + "-flash" if key != "project" else "flash",
|
||||
)
|
||||
)
|
||||
print("%s %s -p %s -b %s --before %s --after %s write_flash %s" % (
|
||||
PYTHON,
|
||||
_safe_relpath("%s/components/esptool_py/esptool/esptool.py" % os.environ["IDF_PATH"]),
|
||||
args.port or "(PORT)",
|
||||
args.baud,
|
||||
flasher_args["extra_esptool_args"]["before"],
|
||||
flasher_args["extra_esptool_args"]["after"],
|
||||
cmd.strip(),
|
||||
))
|
||||
print("or run 'idf.py -p %s %s'" % (
|
||||
args.port or "(PORT)",
|
||||
key + "-flash" if key != "project" else "flash",
|
||||
))
|
||||
|
||||
if "all" in actions or "build" in actions:
|
||||
print_flashing_message("Project", "project")
|
||||
|
Loading…
Reference in New Issue
Block a user