forked from espressif/esp-idf
feat(idf_py): Allow tracing interactions during flashing with --trace
This commit is contained in:
@@ -44,7 +44,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# SERIAL_TOOL_ARGS is defined during the first cmake run
|
# SERIAL_TOOL_ARGS is defined during the first cmake run
|
||||||
# SERIAL_TOOL_EXTRA_ARGS is used for additional arguments from the command line during run-time
|
# EXTRA_ARGS and EXTRA_PRE_CMD_ARGS are used for additional arguments from the command line during run-time
|
||||||
|
list(APPEND serial_tool_cmd $ENV{SERIAL_TOOL_EXTRA_PRE_CMD_ARGS})
|
||||||
list(APPEND serial_tool_cmd ${SERIAL_TOOL_ARGS})
|
list(APPEND serial_tool_cmd ${SERIAL_TOOL_ARGS})
|
||||||
list(APPEND serial_tool_cmd $ENV{SERIAL_TOOL_EXTRA_ARGS})
|
list(APPEND serial_tool_cmd $ENV{SERIAL_TOOL_EXTRA_ARGS})
|
||||||
|
|
||||||
|
@@ -213,6 +213,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
|
|||||||
args: PropertyDict,
|
args: PropertyDict,
|
||||||
force: bool,
|
force: bool,
|
||||||
extra_args: str,
|
extra_args: str,
|
||||||
|
trace: bool,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Run esptool to flash the entire project, from an argfile generated by the build system
|
Run esptool to flash the entire project, from an argfile generated by the build system
|
||||||
@@ -224,15 +225,22 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
|
|||||||
return
|
return
|
||||||
|
|
||||||
args.port = args.port or get_default_serial_port()
|
args.port = args.port or get_default_serial_port()
|
||||||
extra = list()
|
|
||||||
|
extra_pre = list()
|
||||||
|
if trace:
|
||||||
|
extra_pre.append('--trace')
|
||||||
|
|
||||||
|
extra_post = list()
|
||||||
if force:
|
if force:
|
||||||
extra.append('--force')
|
extra_post.append('--force')
|
||||||
if extra_args:
|
if extra_args:
|
||||||
extra += shlex.split(extra_args)
|
extra_post += shlex.split(extra_args)
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
'ESPBAUD': str(args.baud),
|
'ESPBAUD': str(args.baud),
|
||||||
'ESPPORT': args.port,
|
'ESPPORT': args.port,
|
||||||
'SERIAL_TOOL_EXTRA_ARGS': ';'.join(extra),
|
'SERIAL_TOOL_EXTRA_PRE_CMD_ARGS': ';'.join(extra_pre),
|
||||||
|
'SERIAL_TOOL_EXTRA_ARGS': ';'.join(extra_post),
|
||||||
}
|
}
|
||||||
run_target(action, args, env, force_progression=True)
|
run_target(action, args, env, force_progression=True)
|
||||||
|
|
||||||
@@ -527,6 +535,11 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
|
|||||||
|
|
||||||
BAUD_AND_PORT = [BAUD_RATE, PORT]
|
BAUD_AND_PORT = [BAUD_RATE, PORT]
|
||||||
flash_options = BAUD_AND_PORT + [
|
flash_options = BAUD_AND_PORT + [
|
||||||
|
{
|
||||||
|
'names': ['--trace'],
|
||||||
|
'is_flag': True,
|
||||||
|
'help': 'Enable trace-level output of flasher tool interactions. Useful when submitting bug reports.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'names': ['--force'],
|
'names': ['--force'],
|
||||||
'is_flag': True,
|
'is_flag': True,
|
||||||
|
Reference in New Issue
Block a user