From 1917bfcd6cfdf40b25a98f39eae58979b374d2e7 Mon Sep 17 00:00:00 2001 From: paulober <44974737+paulober@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:07:39 +0100 Subject: [PATCH] Revert adapter speed removal as without it OpenOCD throws more warnings even though linuxgpiod doesn't support it Signed-off-by: paulober <44974737+paulober@users.noreply.github.com> --- scripts/pico_project.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/pico_project.py b/scripts/pico_project.py index 81e17a5..0f426b1 100644 --- a/scripts/pico_project.py +++ b/scripts/pico_project.py @@ -778,10 +778,8 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, file.close() debugger = debugger_config_list[debugger] - debugger_supports_configurable_speed = True if debugger == "raspberrypi-swd.cfg": - debugger_supports_configurable_speed = False shutil.copyfile(sourcefolder + "/" + "raspberrypi-swd.cfg", projectPath / "raspberrypi-swd.cfg") # Need to escape windows files paths backslashes @@ -795,7 +793,6 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, openocd_path = "" server_path = "\n \"serverpath\"" # Because no \ in f-strings - extraDebugServerArgs = ' -c \\"adapter speed 5000\\"' if debugger_supports_configurable_speed else "" openocd_path_os = Path(user_home, relativeOpenOCDPath(openOCDVersion).replace("/", "", 1), "openocd.exe") if os.path.exists(openocd_path_os): openocd_path = f'{codeOpenOCDPath(openOCDVersion)}/openocd.exe' @@ -826,10 +823,10 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, "overrideLaunchCommands": [ "monitor reset init", "load \\"${{command:raspberry-pi-pico.launchTargetPath}}\\"" - ]''' + (''', + ], "openOCDLaunchCommands": [ "adapter speed 5000" - ]''' if debugger_supports_configurable_speed else "") + f''' + ] }}, {{ "name": "Pico Debug (Cortex-Debug with external OpenOCD)", @@ -859,7 +856,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, "miDebuggerPath": "${{command:raspberry-pi-pico.getGDBPath}}", "miDebuggerServerAddress": "localhost:3333", "debugServerPath": "{openocd_path if openocd_path else "openocd"}", - "debugServerArgs": "-f {debugger} -f target/${{command:raspberry-pi-pico.getTarget}}.cfg{extraDebugServerArgs}", + "debugServerArgs": "-f {debugger} -f target/${{command:raspberry-pi-pico.getTarget}}.cfg -c \\"adapter speed 5000\\"", "serverStarted": "Listening on port .* for gdb connections", "filterStderr": true, "hardwareBreakpoints": {{ @@ -1039,7 +1036,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, "-f", "target/${{command:raspberry-pi-pico.getTarget}}.cfg", "-c", - "{"adapter speed 5000; " if debugger_supports_configurable_speed else ""}program \\"${{command:raspberry-pi-pico.launchTargetPath}}\\" verify reset exit" + "adapter speed 5000; program \\"${{command:raspberry-pi-pico.launchTargetPath}}\\" verify reset exit" ], "problemMatcher": [], "windows": {{