element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum have you debugged a Pico2 RISC program with a PICOPROBE / DEBUGPROBE?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 7 replies
  • Subscribers 660 subscribers
  • Views 557 views
  • Users 0 members are here
  • pico2
  • pico
  • pico 2
  • pico_eurocard
  • pico-eurocard
Related

have you debugged a Pico2 RISC program with a PICOPROBE / DEBUGPROBE?

Jan Cumps
Jan Cumps 29 days ago

Have you been able to debug a C Pico2 RISC project with a PicoProbe / DebugProbe?

edit: solution:  RE: have you debugged a Pico2 RISC program with a PICOPROBE / DEBUGPROBE? 

I use VSCode and the Raspberry Pico Extension - all up to date as of today - to create a Pico2 project.
If that project is using Pico2 ARM cores, the debugger manages to program the RP2350 and debug it.
If I switch that project to RISC (or create a fresh Pico2 RISC project), the build succeeds, but debugging doesn't.

image

Error:

[2025-06-19T22:57:07.909Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
"C:\\Users\\jancu/.pico-sdk/openocd/0.12.0+dev/openocd.exe" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "C:\\Users\\jancu/.pico-sdk/openocd/0.12.0+dev/scripts" -f "c:/Users/jancu/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl" -f interface/cmsis-dap.cfg -f target/rp2350-riscv.cfg -c "adapter speed 5000"
Open On-Chip Debugger 0.12.0+dev-g75bc439-dirty (2024-08-08-15:04)
Licensed under GNU GPL v2
For bug reports, read
openocd.org/.../bugs.html
CDLiveWatchSetup
Info : Hardware thread awareness created
Info : Hardware thread awareness created
adapter speed: 5000 kHz
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=4150323038323713
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 5000 kHz
Info : SWD DPIDR 0x4c013477
Info : [rp2350.dap.core0] datacount=1 progbufsize=2
Info : [rp2350.dap.core0] unavailable.
Error: [rp2350.dap.core0] Examination failed
Warn : target rp2350.dap.core0 examination failed
Info : [rp2350.dap.core1] datacount=1 progbufsize=2
Info : [rp2350.dap.core1] unavailable.
Error: [rp2350.dap.core1] Examination failed
Warn : target rp2350.dap.core1 examination failed
Info : starting gdb server for rp2350.dap.core0 on 50000
Info : Listening on port 50000 for gdb connections
Info : accepting 'gdb' connection on tcp/50000
Error: Target not examined yet
Error executing event gdb-attach on target rp2350.dap.core0:

Error: Target not examined yet
Error: Function FUNC_FLASH_EXIT_XIP not found in RP2xxx ROM.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
[2025-06-19T22:57:10.180Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

  • Sign in to reply
  • Cancel
  • Jan Cumps
    0 Jan Cumps 29 days ago

    Exactly the same project, but I ask the extension to build it for ARM:. That works.

    [2025-06-19T22:59:23.283Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
    "C:\\Users\\jancu/.pico-sdk/openocd/0.12.0+dev/openocd.exe" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "C:\\Users\\jancu/.pico-sdk/openocd/0.12.0+dev/scripts" -f "c:/Users/jancu/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl" -f interface/cmsis-dap.cfg -f target/rp2350.cfg -c "adapter speed 5000"
    Open On-Chip Debugger 0.12.0+dev-g75bc439-dirty (2024-08-08-15:04)
    Licensed under GNU GPL v2
    For bug reports, read
    openocd.org/.../bugs.html
    CDLiveWatchSetup
    Info : Hardware thread awareness created
    Info : Hardware thread awareness created
    Info : Hardware thread awareness created
    Info : Hardware thread awareness created
    cortex_m reset_config sysresetreq
    adapter speed: 5000 kHz
    Info : Listening on port 50001 for tcl connections
    Info : Listening on port 50002 for telnet connections
    Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=4150323038323713
    Info : CMSIS-DAP: SWD supported
    Info : CMSIS-DAP: Atomic commands supported
    Info : CMSIS-DAP: Test domain timer supported
    Info : CMSIS-DAP: FW Version = 2.0.0
    Info : CMSIS-DAP: Interface Initialised (SWD)
    Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
    Info : CMSIS-DAP: Interface ready
    Info : clock speed 5000 kHz
    Info : SWD DPIDR 0x4c013477
    Info : [rp2350.dap.core0] Cortex-M33 r1p0 processor detected
    Info : [rp2350.dap.core0] target has 8 breakpoints, 4 watchpoints
    Info : [rp2350.dap.core0] Examination succeed
    Info : [rp2350.dap.core1] Cortex-M33 r1p0 processor detected
    Info : [rp2350.dap.core1] target has 8 breakpoints, 4 watchpoints
    Info : [rp2350.dap.core1] Examination succeed
    Info : starting gdb server for rp2350.dap.core0 on 50000
    Info : Listening on port 50000 for gdb connections
    Info : accepting 'gdb' connection on tcp/50000
    Info : RP2040 Flash Probe: 33554432 bytes @0x10000000, in 8192 sectors

    Info : New GDB Connection: 1, Target rp2350.dap.core0, state: halted
    undefined debug reason 8 (UNDEFINED) - target needs reset
    Warn : [rp2350.dap.core1] VECTRESET is not supported on this Cortex-M core, using SYSRESETREQ instead.
    Warn : [rp2350.dap.core1] Set 'cortex_m reset_config sysresetreq'.
    [rp2350.dap.core0] halted due to breakpoint, current mode: Thread
    xPSR: 0xf9000000 pc: 0x00000088 msp: 0xf0000000
    [rp2350.dap.core1] halted due to debug-request, current mode: Thread
    xPSR: 0xf9000000 pc: 0x00000088 msp: 0xf0000000
    Warn : [rp2350.dap.core1] VECTRESET is not supported on this Cortex-M core, using SYSRESETREQ instead.
    Warn : [rp2350.dap.core1] Set 'cortex_m reset_config sysresetreq'.
    [rp2350.dap.core0] halted due to breakpoint, current mode: Thread
    xPSR: 0xf9000000 pc: 0x00000088 msp: 0xf0000000
    [rp2350.dap.core1] halted due to debug-request, current mode: Thread
    xPSR: 0xf9000000 pc: 0x00000088 msp: 0xf0000000
    Info : Padding image section 0 at 0x100017a4 with 92 bytes (bank write end alignment)
    Warn : [rp2350.dap.core1] VECTRESET is not supported on this Cortex-M core, using SYSRESETREQ instead.
    Warn : [rp2350.dap.core1] Set 'cortex_m reset_config sysresetreq'.
    [rp2350.dap.core0] halted due to breakpoint, current mode: Thread
    xPSR: 0xf9000000 pc: 0x00000088 msp: 0xf0000000
    [rp2350.dap.core1] halted due to debug-request, current mode: Thread
    xPSR: 0xf9000000 pc: 0x00000088 msp: 0xf0000000
    [rp2350.dap.core1] halted due to debug-request, current mode: Thread
    xPSR: 0x09000000 pc: 0x000000ec msp: 0xf0000000

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • BigG
    +1 BigG 28 days ago

    Tried Claude 3.7 for insight:

    https://claude.ai/share/5c40ee71-5752-451a-a4bd-4a0c04cd7ba1

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps 28 days ago in reply to BigG

    This got me a step further!

    image

    It's not breaking or stopping yet, but finds the cores.

    The part that got me to this:

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps 28 days ago in reply to BigG

    Fixed!

    image

    I needed to adapt the launch.json, based on these instructions:

    image

    not 100% exact, but close enough to put me on track.

    Here's the actual script I added:

            {
                "name": "Pico Debug RISC (Debug Probe)",
                "cwd": "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts",
                "type": "cortex-debug",
                "request": "launch",
                "executable": "${command:raspberry-pi-pico.launchTargetPath}",
                "servertype": "openocd",
                "serverpath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe",
                "gdbPath": "${command:raspberry-pi-pico.getGDBPath}",
                "configFiles": [
                    "interface/cmsis-dap.cfg",
                    "target/rp2350-riscv.cfg"
                ],
                "openOCDPreConfigLaunchCommands": [
                    "set ENABLE_RESCUE 0",
                    "set PICO_CORE riscv"
                ],
                "serverArgs": [
                    "-c", "adapter speed 1000"
                ],
                "runToEntryPoint": "main",
                "showDevDebugOutput": "raw"
            }

    gdb server log:

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps 28 days ago in reply to Jan Cumps

    strange thing: now that picotool has set it to riscv, it also works with the standard launch.json profile Pico Debug (Cortex-Debug)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • BigG
    0 BigG 28 days ago in reply to Jan Cumps

    I suppose like most things, these sort of niggles still have to worked out through future probe firmware mods. At least you have it working. That's so cool. Well done.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps 26 days ago

    repeatable solution to get a new RP2350 debug-able in riscv mode:

    1 time:

    • build a program
    • start pico2 up in BOOTSEL mode (push bootsel and connect to computer with USB)
    • from project folder, execute (I use VSCode PowerShell terminal): picotool reboot -c riscv -u
    • drop the riscv uf2 firmware on the disc (only needed 1 time)
    • disconnect

    from then on:

    • connect a debugger, and now you can flash and debug with the default Pico Debug (Cortex-Debug) profile.
    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube