diff --git a/tools/idf.py b/tools/idf.py index 1083d1d026..b8968450b3 100755 --- a/tools/idf.py +++ b/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")