Hi all
I've encountered some really strange behaviour since I've updeted the tool-chain (https://www.raspberrypi.com/news/raspbe ... installer/) an SDK-Version (1.6.0) to the official VS Code extension and the SDK-Version 2.1.0.
When I compile and debug my project, I'm running most of the time in an outdated flash binary on the device (e.g. adding some printf to the main loop and I don't see this output on the terminal). And in addition the breakpoints aren't hit or the device runs without "wait on main". And changing breakpoints without recompile has never worked in the new setup...
The only workaround that helps sometime is to "Delete Cache and Reconfigure " cmake and rebuild the hole solution. sometimes not even that helps.
what I've done so far:
- updated the pi pico probe
- updated openocd
- updated arm gcc
- updated vscode and the pico extension
Today I was able to limit the problem: I've used the same device & debugger at a different computer with an older repository version and therfore also other build files -> I've got the same log-outputs as yesterday after flashing the device without any error!
As I remember the older setup reports some "erase, flash, verify" output infomraitons - this I've nerver seen in the newer versions. So I think there is something wrong with the settings...
tasks.json
launch.json
What I see and I'm not able to resolve is the last line of this debug output (failed to launch...):
I've worked years with JLINK and other mcu brands without any Issues like this, so what I'm doing wrong?
What I want
- not rebuilding the hole solution after changing just one line
- reliable erase/flash/verify sequence before starting the debugging
- reliable debugging (start at main and hold there, hit breakpoints...)
Hope you can help me.
best regards
P51D
I've encountered some really strange behaviour since I've updeted the tool-chain (https://www.raspberrypi.com/news/raspbe ... installer/) an SDK-Version (1.6.0) to the official VS Code extension and the SDK-Version 2.1.0.
When I compile and debug my project, I'm running most of the time in an outdated flash binary on the device (e.g. adding some printf to the main loop and I don't see this output on the terminal). And in addition the breakpoints aren't hit or the device runs without "wait on main". And changing breakpoints without recompile has never worked in the new setup...
The only workaround that helps sometime is to "Delete Cache and Reconfigure " cmake and rebuild the hole solution. sometimes not even that helps.
what I've done so far:
- updated the pi pico probe
- updated openocd
- updated arm gcc
- updated vscode and the pico extension
Today I was able to limit the problem: I've used the same device & debugger at a different computer with an older repository version and therfore also other build files -> I've got the same log-outputs as yesterday after flashing the device without any error!
As I remember the older setup reports some "erase, flash, verify" output infomraitons - this I've nerver seen in the newer versions. So I think there is something wrong with the settings...
tasks.json
Code:
{ "version": "2.0.0", "tasks": [ { "label": "Compile Project", "type": "process", "isBuildCommand": true, "command": "${userHome}/.pico-sdk/ninja/v1.12.1/ninja", "args": [ "-C", "${workspaceFolder}/build" ], "group": "build", "presentation": { "reveal": "always", "panel": "dedicated" }, "problemMatcher": "$gcc", "windows": { "command": "${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1/ninja.exe" } }, { "label": "Run Project", "type": "process", "command": "${env:HOME}/.pico-sdk/picotool/2.1.0/picotool/picotool", "args": [ "load", "${command:raspberry-pi-pico.launchTargetPath}", "-fx" ], "presentation": { "reveal": "always", "panel": "dedicated" }, "problemMatcher": [], "windows": { "command": "${env:USERPROFILE}/.pico-sdk/picotool/2.1.0/picotool/picotool.exe" } }, { "label": "Flash", "type": "process", "command": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", "args": [ "-s", "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", "-f", "interface/cmsis-dap.cfg", "-f", "target/${command:raspberry-pi-pico.getTarget}.cfg", "-c", "adapter speed 5000; program \"${command:raspberry-pi-pico.launchTargetPath}\" verify reset exit" ], "problemMatcher": [], "windows": { "command": "${env:USERPROFILE}/.pico-sdk/openocd/0.12.0+dev/openocd.exe" } }, { "type": "cmake", "label": "CMake: clean", "command": "clean", "targets": [ "all" ], "problemMatcher": [], "detail": "CMake template clean task" }, { "type": "cmake", "label": "CMake: clean rebuild", "command": "cleanRebuild", "targets": [ "all" ], "group": "build", "problemMatcher": [], "detail": "CMake template clean rebuild task" } ]}launch.json
Code:
{ "version": "0.2.0", "configurations": [ { "name": "Pico Debug (Cortex-Debug)", "cwd": "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", "executable": "${command:raspberry-pi-pico.launchTargetPath}", "request": "launch", "type": "cortex-debug", "servertype": "openocd", //"rtos": "FreeRTOS", "serverpath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", "device": "${command:raspberry-pi-pico.getChipUppercase}", "configFiles": [ "interface/cmsis-dap.cfg", "target/${command:raspberry-pi-pico.getTarget}.cfg" ], "svdFile": "${userHome}/.pico-sdk/sdk/2.1.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", "runToEntryPoint": "main", // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected // Also works fine for flash binaries "overrideLaunchCommands": [ "monitor reset init", "load \"${command:raspberry-pi-pico.launchTargetPath}\"" ], "openOCDLaunchCommands": [ "adapter speed 5000" ] }, { "name": "Pico Debug (Cortex-Debug with external OpenOCD)", "cwd": "${workspaceRoot}", "executable": "${command:raspberry-pi-pico.launchTargetPath}", "request": "launch", "type": "cortex-debug", "servertype": "external", "gdbTarget": "localhost:3333", "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", "device": "${command:raspberry-pi-pico.getChipUppercase}", "svdFile": "${userHome}/.pico-sdk/sdk/2.1.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", "runToEntryPoint": "main", // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected // Also works fine for flash binaries "overrideLaunchCommands": [ "monitor reset init", "load \"${command:raspberry-pi-pico.launchTargetPath}\"" ] }, { "name": "Pico Debug (C++ Debugger)", "type": "cppdbg", "request": "launch", "cwd": "${workspaceRoot}", "program": "${command:raspberry-pi-pico.launchTargetPath}", "MIMode": "gdb", "miDebuggerPath": "${command:raspberry-pi-pico.getGDBPath}", "miDebuggerServerAddress": "localhost:3333", "debugServerPath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", "debugServerArgs": "-f interface/cmsis-dap.cfg -f target/${command:raspberry-pi-pico.getTarget}.cfg -c \"adapter speed 5000\"", "serverStarted": "Listening on port .* for gdb connections", "filterStderr": true, "hardwareBreakpoints": { "require": true, "limit": 4 }, "preLaunchTask": "Flash", "svdPath": "${userHome}/.pico-sdk/sdk/2.1.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd" }, ]}What I see and I'm not able to resolve is the last line of this debug output (failed to launch...):
Code:
Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usageReading symbols from c:/users/bep0101/.pico-sdk/toolchain/13_3_rel1/bin/arm-none-eabi-objdump --syms -C -h -w C:/GitRepo/TestProject/build/src/TestProject.elfReading symbols from c:/users/bep0101/.pico-sdk/toolchain/13_3_rel1/bin/arm-none-eabi-nm --defined-only -S -l -C -p C:/GitRepo/TestProject/build/src/TestProject.elfLaunching GDB: "C:\\Users\\BEP0101\\.pico-sdk\\toolchain\\13_3_Rel1\\bin\\arm-none-eabi-gdb" -q --interpreter=mi2 IMPORTANT: Set "showDevDebugOutput": "raw" in "launch.json" to see verbose GDB transactions here. Very helpful to debug issues or report problemsLaunching gdb-server: "C:\\Users\\BEP0101/.pico-sdk/openocd/0.12.0+dev/openocd.exe" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "C:\\Users\\BEP0101/.pico-sdk/openocd/0.12.0+dev/scripts" -f "c:/Users/BEP0101/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl" -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" Please check TERMINAL tab (gdb-server) for output from C:\Users\BEP0101/.pico-sdk/openocd/0.12.0+dev/openocd.exeFinished reading symbols from objdump: Time: 119 msFinished reading symbols from nm: Time: 179 msOutput radix now set to decimal 10, hex a, octal 12.Input radix now set to decimal 10, hex a, octal 12.`C:\GitRepo\TestProject\build\src\TestProject.elf' has changed; re-reading symbols.warning: multi-threaded target stopped without sending a thread-id, using first non-exited threadprvPassiveIdleTask (pvParameters=<optimized out>) at C:/GitRepo/TestProject/lib/FreeRTOS-Kernel/tasks.c:57615761 if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > ( UBaseType_t ) configNUMBER_OF_CORES )Program stopped, probably due to a reset and/or halt issued by debugger[rp2040.core0] halted due to breakpoint, current mode: Thread xPSR: 0xf1000000 pc: 0x000000ea msp: 0x20041f00[rp2040.core1] halted due to debug-request, current mode: Thread xPSR: 0xf1000000 pc: 0x000000ea msp: 0x20041f00C:GitRepoTestProjectuildsrcTestProject.elf: Invalid argument.Failed to launch GDB: C:GitRepoTestProjectuildsrcTestProject.elf: Invalid argument. (from interpreter-exec console "load C:\GitRepo\TestProject\build\src\TestProject.elf")I've worked years with JLINK and other mcu brands without any Issues like this, so what I'm doing wrong?
What I want
- not rebuilding the hole solution after changing just one line
- reliable erase/flash/verify sequence before starting the debugging
- reliable debugging (start at main and hold there, hit breakpoints...)
Hope you can help me.
best regards
P51D
Statistics: Posted by P51D — Fri Jun 06, 2025 6:26 am