Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu VSC OpenOCD debug and SWD flash configured as Windows by default #114

Open
bartola-valves opened this issue Oct 28, 2024 · 1 comment

Comments

@bartola-valves
Copy link

I have a dual boot machine with Windows and Ubuntu.
Under Windows (Win 11 pro), I can successfully configure, debug and flash via SWD into a Pico and a Pico2.

Now, under Ubuntu, I can't make it work out of the box despite following all the instructions. I can only get the debug functionality working for the Pico Debug (Cortex Debug with external OpenOCD) only and if I modify the Flash Task.JSON I can get to work the Flash over SWD.

When I look at the tasks.json or the launch.json files when building an out of the box standard Hello Word program, I can see that all the configuration is by default as a Windows machine, not for OpenOCD in a Linux environment

launch.json
tasks.json

Attached are the examples files.

Below is the output of the terminal when executing the SWD flash:

 *  Executing task: /home/bartolo/.pico-sdk/openocd/0.12.0+dev/openocd.exe -s /home/bartolo/.pico-sdk/openocd/0.12.0+dev/scripts -f interface/cmsis-dap.cfg -f target/rp2350.cfg -c adapter speed 5000; program "/home/bartolo/Code/BlinkyUbuntu/build/BlinkyUbuntu.elf" verify reset exit 

Open On-Chip Debugger 0.12.0+dev-gebec950-dirty (2024-09-09-14:16)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter serial' not 'cmsis_dap_serial'
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
Error: unable to find a matching CMSIS-DAP device
** OpenOCD init failed **
shutdown command invoked


 *  The terminal process "/home/bartolo/.pico-sdk/openocd/0.12.0+dev/openocd.exe '-s', '/home/bartolo/.pico-sdk/openocd/0.12.0+dev/scripts', '-f', 'interface/cmsis-dap.cfg', '-f', 'target/rp2350.cfg', '-c', 'adapter speed 5000; program "/home/bartolo/Code/BlinkyUbuntu/build/BlinkyUbuntu.elf" verify reset exit'" failed to launch (exit code: 1). 
 *  Terminal will be reused by tasks, press any key to close it. 
 * 

Is there any specific way of installing the extension under Ubuntu to get recognised as a Linux environment and get the debug and SWD capability to work out of the box like in Windows?

Thank you

@will-v-pi
Copy link
Collaborator

It looks like the issue is on Ubuntu it can’t find your debug probe - have you set up appropriate udev rules for it to work, as you would for other USB devices on Linux? The extension works out of the box on Rasberry Pi OS, which has the correct udev rules installed, so it does work on Linux environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants