From 2cce47a13d721d66f0a622dfc92bc1e3cfe10f91 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 6 Nov 2019 12:20:42 +0200 Subject: [PATCH] Fix "pio_reset_run_target" for JLink debug probe --- platformio/commands/debug/client.py | 12 ++++++------ platformio/commands/debug/initcfgs.py | 16 +++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/platformio/commands/debug/client.py b/platformio/commands/debug/client.py index 990340e8..f7a81968 100644 --- a/platformio/commands/debug/client.py +++ b/platformio/commands/debug/client.py @@ -133,18 +133,18 @@ class GDBClient(BaseProcess): # pylint: disable=too-many-instance-attributes commands = self.debug_options["init_cmds"] commands.extend(self.debug_options["extra_cmds"]) - if not any("define pio_reset_target" in cmd for cmd in commands): + if not any("define pio_reset_run_target" in cmd for cmd in commands): commands = [ - "define pio_reset_target", - " echo Warning! Undefined pio_reset_target command\\n", - " mon reset", + "define pio_reset_run_target", + " echo Warning! Undefined pio_reset_run_target command\\n", + " monitor reset", "end", ] + commands if not any("define pio_reset_halt_target" in cmd for cmd in commands): commands = [ "define pio_reset_halt_target", " echo Warning! Undefined pio_reset_halt_target command\\n", - " mon reset halt", + " monitor reset halt", "end", ] + commands if not any("define pio_restart_target" in cmd for cmd in commands): @@ -193,7 +193,7 @@ class GDBClient(BaseProcess): # pylint: disable=too-many-instance-attributes if b"-gdb-exit" in data or data.strip() in (b"q", b"quit"): # Allow terminating via SIGINT/CTRL+C signal.signal(signal.SIGINT, signal.default_int_handler) - self.transport.write(b"pio_reset_target\n") + self.transport.write(b"pio_reset_run_target\n") self.transport.write(data) def processEnded(self, reason): # pylint: disable=unused-argument diff --git a/platformio/commands/debug/initcfgs.py b/platformio/commands/debug/initcfgs.py index fbd207f2..b241efc6 100644 --- a/platformio/commands/debug/initcfgs.py +++ b/platformio/commands/debug/initcfgs.py @@ -17,7 +17,7 @@ define pio_reset_halt_target monitor reset halt end -define pio_reset_target +define pio_reset_run_target monitor reset end @@ -34,7 +34,7 @@ define pio_reset_halt_target monitor halt end -define pio_reset_target +define pio_reset_run_target monitor reset end @@ -50,8 +50,10 @@ define pio_reset_halt_target monitor halt end -define pio_reset_target +define pio_reset_run_target + monitor clrbp monitor reset + monitor go end target extended-remote $DEBUG_PORT @@ -73,7 +75,7 @@ define pio_reset_halt_target set language auto end -define pio_reset_target +define pio_reset_run_target pio_reset_halt_target end @@ -97,7 +99,7 @@ GDB_MSPDEBUG_INIT_CONFIG = """ define pio_reset_halt_target end -define pio_reset_target +define pio_reset_run_target end target extended-remote $DEBUG_PORT @@ -112,8 +114,8 @@ define pio_reset_halt_target monitor system_reset end -define pio_reset_target - pio_reset_halt_target +define pio_reset_run_target + monitor system_reset end target extended-remote $DEBUG_PORT