diff --git a/platform.py b/platform.py index fe4f8ecae..b90069485 100644 --- a/platform.py +++ b/platform.py @@ -286,10 +286,12 @@ def configure_debug_session(self, debug_config): ["-c", "adapter speed %s" % (debug_config.speed or "5000")] ) + # The images may not exist yet: `pio debug` configures the session + # before building them, and falling back to GDB `load` would write + # the new sections over the application already in flash ignore_conds = [ debug_config.load_cmds != ["load"], not flash_images, - not all([os.path.isfile(item["path"]) for item in flash_images]), ] if any(ignore_conds):