|
|
@@ -4,7 +4,7 @@ import sys
|
|
|
|
|
|
from idf_py_actions.errors import FatalError
|
|
|
from idf_py_actions.global_options import global_options
|
|
|
-from idf_py_actions.tools import ensure_build_directory, run_tool
|
|
|
+from idf_py_actions.tools import ensure_build_directory, run_tool, run_target
|
|
|
|
|
|
PYTHON = sys.executable
|
|
|
|
|
|
@@ -99,18 +99,11 @@ def action_extensions(base_actions, project_path):
|
|
|
"""
|
|
|
Run esptool to flash the entire project, from an argfile generated by the build system
|
|
|
"""
|
|
|
- flasher_args_path = {
|
|
|
- # action -> name of flasher args file generated by build system
|
|
|
- "bootloader-flash": "flash_bootloader_args",
|
|
|
- "partition_table-flash": "flash_partition_table_args",
|
|
|
- "app-flash": "flash_app_args",
|
|
|
- "flash": "flash_project_args",
|
|
|
- "encrypted-app-flash": "flash_encrypted_app_args",
|
|
|
- "encrypted-flash": "flash_encrypted_project_args",
|
|
|
- }[action]
|
|
|
- esptool_args = _get_esptool_args(args)
|
|
|
- esptool_args += ["write_flash", "@" + flasher_args_path]
|
|
|
- run_tool("esptool.py", esptool_args, args.build_dir)
|
|
|
+ if args.port is None:
|
|
|
+ args.port = _get_default_serial_port()
|
|
|
+
|
|
|
+ run_target(action, args, {"ESPPORT": args.port,
|
|
|
+ "ESPBAUD": str(args.baud)})
|
|
|
|
|
|
def erase_flash(action, ctx, args):
|
|
|
esptool_args = _get_esptool_args(args)
|