Skip to content

Commit

Permalink
feat: Also set ESPTOOL_RETRY_OPEN_SERIAL when --retry-open is set
Browse files Browse the repository at this point in the history
This is needed in order to properly invoke esptool with --retry-open-serial
through idf.py (with a patch coming later on)
  • Loading branch information
2opremio committed Jul 17, 2024
1 parent 080bf0f commit e894d66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions esp_idf_monitor/base/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
EVENT_QUEUE_TIMEOUT = 0.03 # timeout before raising queue.Empty exception in case of empty event queue

ESPPORT_ENVIRON = str('ESPPORT')
ESPTOOL_RETRY_OPEN_SERIAL_ENVIRON = str('ESPTOOL_RETRY_OPEN_SERIAL')
MAKEFLAGS_ENVIRON = 'MAKEFLAGS'

GDB_UART_CONTINUE_COMMAND = '+$c#63'
Expand Down
6 changes: 4 additions & 2 deletions esp_idf_monitor/idf_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
DEFAULT_TARGET_RESET,
DEFAULT_TOOLCHAIN_PREFIX,
ESPPORT_ENVIRON,
ESPTOOL_RETRY_OPEN_SERIAL_ENVIRON,
EVENT_QUEUE_TIMEOUT,
GDB_EXIT_TIMEOUT,
GDB_UART_CONTINUE_COMMAND,
Expand Down Expand Up @@ -90,7 +91,7 @@ def __init__(
make='make', # type: str
encrypted=False, # type: bool
reset=DEFAULT_TARGET_RESET, # type: bool
retry_open=False, # type: bool
retry_open=False, # type: bool
toolchain_prefix=DEFAULT_TOOLCHAIN_PREFIX, # type: str
eol='CRLF', # type: str
decode_coredumps=COREDUMP_DECODE_INFO, # type: str
Expand Down Expand Up @@ -398,7 +399,8 @@ def main() -> None:
# has a check for this).
# To make sure the key as well as the value are str type, by the requirements of subprocess
espport_val = str(args.port)
os.environ.update({ESPPORT_ENVIRON: espport_val})
retryopen_val = str(args.retry_open)
os.environ.update({ESPPORT_ENVIRON: espport_val, ESPTOOL_RETRY_OPEN_SERIAL_ENVIRON: retryopen_val})

cls = SerialMonitor
yellow_print('--- esp-idf-monitor {v} on {p.name} {p.baudrate} ---'.format(v=__version__, p=serial_instance))
Expand Down

0 comments on commit e894d66

Please sign in to comment.