Raspberry Pi Pico 2W debugger not working on VSCode
I'm trying to debug my RaspberryPi Pico 2W in VSCode.
I can download and execute the program without problems, but if try debugging it I get error and the IDE breaks and ask me to edit the launch.json file.
I didn't find any solution right now.
I'm running the debugger on macOS Sequoia 15.6.1 (24G90), Apple Silicon M4.
Thank you in advance for any suggestion.
I can download and execute the program without problems, but if try debugging it I get error and the IDE breaks and ask me to edit the launch.json file.
I didn't find any solution right now.
I'm running the debugger on macOS Sequoia 15.6.1 (24G90), Apple Silicon M4.
Thank you in advance for any suggestion.
- will-v-pi
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 150
- Joined: Tue Sep 12, 2023 9:51 am
Re: Raspberry Pi Pico 2W debugger not working on VSCode
Have you connected your Debug Probe correctly (see 4.3 in https://datasheets.raspberrypi.com/pico ... h-pico.pdf)?
Also, what exact error messages are you getting (maybe look at the Debug Console tab, and the Terminal -> gdb-server tab, for more details)?
And are you using the Pico VS Code extension, or a different setup?
Also, what exact error messages are you getting (maybe look at the Debug Console tab, and the Terminal -> gdb-server tab, for more details)?
And are you using the Pico VS Code extension, or a different setup?
Re: Raspberry Pi Pico 2W debugger not working on VSCode
Thank for your reply!
The Pico Debugger is correctly connected.
I'm using the Pico VS Code extension.
If I select "Pico Debug (Cortex-Debug), i get the following error (dgb-server console):
[2025年09月28日T18:23:14.501Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
/Users/flaviorenga/.pico-sdk/openocd/0.12.0+dev/openocd.exe -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /Users/flaviorenga/.pico-sdk/openocd/0.12.0+dev/scripts -f /Users/flaviorenga/.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"
dyld[74461]: Library not loaded: /opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib
Referenced from: <1C1CBE82-1587-3EC3-8B7D-5786D04BAA56> /Users/flaviorenga/.pico-sdk/openocd/0.12.0+dev/libjim0.83.dylib
Reason: tried: '/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib' (no such file), '/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib' (no such file)
[2025年09月28日T18:23:14.592Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...
The Pico Debugger is correctly connected.
I'm using the Pico VS Code extension.
If I select "Pico Debug (Cortex-Debug), i get the following error (dgb-server console):
[2025年09月28日T18:23:14.501Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
/Users/flaviorenga/.pico-sdk/openocd/0.12.0+dev/openocd.exe -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /Users/flaviorenga/.pico-sdk/openocd/0.12.0+dev/scripts -f /Users/flaviorenga/.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"
dyld[74461]: Library not loaded: /opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib
Referenced from: <1C1CBE82-1587-3EC3-8B7D-5786D04BAA56> /Users/flaviorenga/.pico-sdk/openocd/0.12.0+dev/libjim0.83.dylib
Reason: tried: '/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib' (no such file), '/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib' (no such file)
[2025年09月28日T18:23:14.592Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...
- will-v-pi
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 150
- Joined: Tue Sep 12, 2023 9:51 am
Re: Raspberry Pi Pico 2W debugger not working on VSCode
Looks like our releases still don’t contain all the shared libraries used - as a workaround you could try installing OpenSSL with homebrew which should fix that issue
Re: Raspberry Pi Pico 2W debugger not working on VSCode
I would be interested to know if the recommended solution worked. I have been fighting the same problem for a long time now using Pi Pico 1. For a sanity check, I used platformio and wrote a small program using the Arduino framework, and the debugger works fine with the code. (the debugger hardware and openocd are the same). Going back to VS Code and the Pico IDE, I modified the launch.json configurations to use openocd in the .platformio directory and the debugger works. If you have platform installed, you can modify the launch.json to:
"server path": /Users/<PUT YOUR USER DIRECTORY HERE>/.platformio/packages/tool-openocd-rp2040-earlephilhower/bin/openocd".
Also, if it isn't there, you may need to add :
"overrideLaunchCommands" :[ "monitor reset init", "load \"${workspaceFolder}/build/<INSERT YOUR PROJECT NAME.ELF>\"" ]
If you haven't found another solution by now and want to try this, I am happy to provide the launch.json configurations so you don't need to type all this stuff.
I know this is messy and crude, but it is the only thing I found to work for me. I hope there will be a clean solution coming soon. THIS WORKED FOR THE RP2040. I didn't try it for the RP2350.
"server path": /Users/<PUT YOUR USER DIRECTORY HERE>/.platformio/packages/tool-openocd-rp2040-earlephilhower/bin/openocd".
Also, if it isn't there, you may need to add :
"overrideLaunchCommands" :[ "monitor reset init", "load \"${workspaceFolder}/build/<INSERT YOUR PROJECT NAME.ELF>\"" ]
If you haven't found another solution by now and want to try this, I am happy to provide the launch.json configurations so you don't need to type all this stuff.
I know this is messy and crude, but it is the only thing I found to work for me. I hope there will be a clean solution coming soon. THIS WORKED FOR THE RP2040. I didn't try it for the RP2350.
Re: Raspberry Pi Pico 2W debugger not working on VSCode
SOLVED!
Just uninstalled and reinstalled all the things from scratch
From VSCode:
1. uninstall all the extensions
2. update VSCode
2. close VSCode
3. update OpenSSL from terminal:
- brew update
- brew install openssl
- openssl version
4. open VSCode
5. install the required/desired extensions:
- Raspberry Pi Pico
- All the suggested extensions
6. close VSCode
7. open VSCode
8. create new blink project from examples
9. run the project => ok!
10. debug the project => ok!
Use Pico Debug (Cortex-Debug) for debugging.
It seems that all the required stuff (eg. OpenSSL) should be available and updated just BEFORE installing the Raspberry Pi and other extensions.
Let me know if that works for you!
Just uninstalled and reinstalled all the things from scratch
From VSCode:
1. uninstall all the extensions
2. update VSCode
2. close VSCode
3. update OpenSSL from terminal:
- brew update
- brew install openssl
- openssl version
4. open VSCode
5. install the required/desired extensions:
- Raspberry Pi Pico
- All the suggested extensions
6. close VSCode
7. open VSCode
8. create new blink project from examples
9. run the project => ok!
10. debug the project => ok!
Use Pico Debug (Cortex-Debug) for debugging.
It seems that all the required stuff (eg. OpenSSL) should be available and updated just BEFORE installing the Raspberry Pi and other extensions.
Let me know if that works for you!
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion