From 92f7dcb58178125dcb6b3ac25002284ff5b325cc Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Fri, 5 May 2023 16:13:17 +0200 Subject: [PATCH] Add pico-debug openocd call --- platform.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/platform.py b/platform.py index 642ef77..68475fd 100644 --- a/platform.py +++ b/platform.py @@ -15,7 +15,7 @@ import platform from platformio.public import PlatformBase - +import sys class RaspberrypiPlatform(PlatformBase): @@ -86,7 +86,7 @@ class RaspberrypiPlatform(PlatformBase): if "tools" not in debug: debug["tools"] = {} - for link in ("blackmagic", "cmsis-dap", "jlink", "raspberrypi-swd", "picoprobe"): + for link in ("blackmagic", "cmsis-dap", "jlink", "raspberrypi-swd", "picoprobe", "pico-debug"): if link not in upload_protocols or link in debug["tools"]: continue if link == "blackmagic": @@ -113,6 +113,17 @@ class RaspberrypiPlatform(PlatformBase): }, "onboard": link in debug.get("onboard_tools", []) } + elif link == "pico-debug": + debug["tools"][link] = { + "server": { + "executable": "bin/openocd", + "package": "tool-openocd-rp2040-earlephilhower", + "arguments": [ + "-s", "$PACKAGE_DIR/share/openocd/scripts", + "-f", "board/%s.cfg" % link, + ] + } + } else: openocd_target = debug.get("openocd_target") assert openocd_target, ("Missing target configuration for %s" %