Merge branch 'bugfix/idfpy_before_flash_option_v4.0' into 'release/v4.0'
idf.py: Add --before flag to esptool.py call (v4.0) See merge request espressif/esp-idf!6625
This commit is contained in:
commit
668c0dfb9b
1 changed files with 14 additions and 20 deletions
34
tools/idf.py
34
tools/idf.py
|
@ -334,6 +334,7 @@ def _get_esptool_args(args):
|
||||||
flasher_args = json.load(f)
|
flasher_args = json.load(f)
|
||||||
|
|
||||||
extra_esptool_args = flasher_args["extra_esptool_args"]
|
extra_esptool_args = flasher_args["extra_esptool_args"]
|
||||||
|
result += ["--before", extra_esptool_args["before"]]
|
||||||
result += ["--after", extra_esptool_args["after"]]
|
result += ["--after", extra_esptool_args["after"]]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -783,26 +784,19 @@ def init_cli():
|
||||||
for o, f in flash_items:
|
for o, f in flash_items:
|
||||||
cmd += o + " " + flasher_path(f) + " "
|
cmd += o + " " + flasher_path(f) + " "
|
||||||
|
|
||||||
print(
|
print("%s %s -p %s -b %s --before %s --after %s write_flash %s" % (
|
||||||
"%s -p %s -b %s --after %s write_flash %s"
|
PYTHON,
|
||||||
% (
|
_safe_relpath("%s/components/esptool_py/esptool/esptool.py" % os.environ["IDF_PATH"]),
|
||||||
_safe_relpath(
|
args.port or "(PORT)",
|
||||||
"%s/components/esptool_py/esptool/esptool.py"
|
args.baud,
|
||||||
% os.environ["IDF_PATH"]
|
flasher_args["extra_esptool_args"]["before"],
|
||||||
),
|
flasher_args["extra_esptool_args"]["after"],
|
||||||
args.port or "(PORT)",
|
cmd.strip(),
|
||||||
args.baud,
|
))
|
||||||
flasher_args["extra_esptool_args"]["after"],
|
print("or run 'idf.py -p %s %s'" % (
|
||||||
cmd.strip(),
|
args.port or "(PORT)",
|
||||||
)
|
key + "-flash" if key != "project" else "flash",
|
||||||
)
|
))
|
||||||
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:
|
if "all" in actions or "build" in actions:
|
||||||
print_flashing_message("Project", "project")
|
print_flashing_message("Project", "project")
|
||||||
|
|
Loading…
Reference in a new issue