Debugger starts only once on Windows

Open
#141 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
c

Research direction

Reproduce the second-debug-session failure with the tinyusb_dev_hid_composite example on Windows 11, using the Pico W and Debug Probe. Start with the OpenOCD and CMSIS-DAP output in the issue, especially the “unable to find a matching CMSIS-DAP device” error. Done means stopping and restarting the debugger works without rebooting either device.

Written by the indexing model from the issue text.

Description

Pico W + Debug Probe + Windows 11 + Pico Visual Studio from Pico Setup
The probe is updated to the latest firmware.
Looks like that issue is specific to tinyusb_dev_hid_composite example.
The Pico W blink example works just fine.

I can start the debugger once and it seems to work fine. Then when I stop it the probe's yellow LED stays on.
Trying to restart it gives me OpenOCD timeout:
image

The only way to get it to work again is to reboot both Pico W and Probe.

Logs:

Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usage
Reading symbols from arm-none-eabi-objdump --syms -C -h -w S:/Dev/GitHub/raspberrypi/pico-examples/build/usb/device/tinyusb_device_examples/hid_composite/tinyusb_dev_hid_composite.elf
Reading symbols from arm-none-eabi-nm --defined-only -S -l -C -p S:/Dev/GitHub/raspberrypi/pico-examples/build/usb/device/tinyusb_device_examples/hid_composite/tinyusb_dev_hid_composite.elf
Launching GDB: 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 problems
Launching gdb-server: openocd.exe -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "S:\\Dev\\GitHub\\raspberrypi\\pico-examples" -f "c:/Users/micro/.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 openocd.exe
Finished reading symbols from objdump: Time: 56 ms
Finished reading symbols from nm: Time: 78 ms
Output radix now set to decimal 10, hex a, octal 12.
Input radix now set to decimal 10, hex a, octal 12.
Failed to launch OpenOCD GDB Server: Timeout.
Waiting for gdb server to start...[2024-06-12T19:37:52.124Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
openocd.exe -c "gdb_port 50007" -c "tcl_port 50008" -c "telnet_port 50009" -s "S:\\Dev\\GitHub\\raspberrypi\\pico-examples" -f "c:/Users/micro/.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"
Open On-Chip Debugger 0.12.0-g4257276 (2023-01-27-10:19)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
CDLiveWatchSetup
Info : Hardware thread awareness created
Info : Hardware thread awareness created
adapter speed: 5000 kHz

Info : Listening on port 50008 for tcl connections
Info : Listening on port 50009 for telnet connections
Error: unable to find a matching CMSIS-DAP device

[2024-06-12T19:37:52.397Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...
Dominant language
C
Stars
1.2k
Forks
363
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/debugprobe

All issues in raspberrypi/debugprobe

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.