Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Support for the Raspberry Pi Debug Probe (Read 3498 times)
NworbLegin
Newbies
*
Offline


Posts: 5
Joined: Feb 4th, 2023
Support for the Raspberry Pi Debug Probe
Mar 4th, 2023 at 11:45am
Print Post  
Hi.

I see that there is support for making a pico-probe from an additional RPi Pico, but is there a way to debug using the new Raspberry Pi Debug Probe?

https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html



Cheers

Nigel
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: Support for the Raspberry Pi Debug Probe
Reply #1 - Mar 6th, 2023 at 11:15am
Print Post  
Yes we support debugging an RPi Pico using the PicoProbe debug probe.

Documentation: https://www.visualmicro.com/page/RasPiPico-Debugging.aspx
Creating a DIY PicoProbe: https://www.visualmicro.com/page/Creating-a-PicoProbe-Debug-Probe.aspx
Video Guide: https://www.youtube.com/watch?v=5bX0G1oyV00
  
Back to top
IP Logged
 
NworbLegin
Newbies
*
Offline


Posts: 5
Joined: Feb 4th, 2023
Re: Support for the Raspberry Pi Debug Probe
Reply #2 - Mar 25th, 2023 at 3:14pm
Print Post  
Thanks for the information but I am unable to get this working with the probe that I linked you to earlier. Can you describe how to get this working with this specific probe please?

This is the issue that I'm getting when attempting to use the Raspberry Pi Debug Probe as suggested in the documentation/videos.

Compiling 'ScanNetworks' for 'Raspberry Pi Pico W (Picoprobe)                                                                                        (rp2040_rpipicowpicoprobe)'
Program size: 320052 bytes (used 15% of a 2093056 byte maximum) (3.40 secs)
Minimum Memory Usage: 59560 bytes (23% of a 262144 byte maximum)
 
Uploading 'ScanNetworks' to 'Raspberry Pi Pico W (Picoprobe)(rp2040_rpipicowpicoprobe)' using 'COM8'
Open On-Chip Debugger 0.11.0-g610f137 (2022-02-11-13:57)
The uploader process failed
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
adapter speed: 5000 kHz
Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
Error: Failed to open or find the device
Error: Can't find a picoprobe device! Please check device connections and permissions.
Error: No Valid JTAG Interface Configured.
« Last Edit: Mar 25th, 2023 at 3:21pm by NworbLegin »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: Support for the Raspberry Pi Debug Probe
Reply #3 - Mar 27th, 2023 at 9:04am
Print Post  
Apologies for my confusion.

There is built in support for the Pico Probe, however we are still working on integrating the support for the new official Raspberry Pi Debug Probe firmware (whether its on the official board or flashed onto a Pico).

If you can attach a build log with the below settings enabled, we can provide a custom launch json for your project to use the configuration currently being integrated:
  • vMicro > Compiler > Verbose
  • vMicro > Compiler > Show Build Properties
  • vMicro > Uploader > Verbose


Can you also confirm if you are using the official board, or if you have flashed the official firmware onto a Pico?
« Last Edit: Mar 27th, 2023 at 9:05am by Simon@Visual Micro »  
Back to top
IP Logged
 
NworbLegin
Newbies
*
Offline


Posts: 5
Joined: Feb 4th, 2023
Re: Support for the Raspberry Pi Debug Probe
Reply #4 - Mar 27th, 2023 at 7:08pm
Print Post  
Here is a link to the build log
https://drive.google.com/file/d/1FPi4Yx-RcZn4jqo56fv-IgedgyyxRaFc/view?usp=share...

I am using the official board with the debug and uart connections attached. This is working and debugging/logging okay through a test project in Visual Studio Code - but I'd really like to get this working through Visual Micro on VS2022
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: Support for the Raspberry Pi Debug Probe
Reply #5 - Mar 28th, 2023 at 8:58am
Print Post  
Thanks for the logs, the instructions below should get you up and running before the full integration is available:

1) Download the OpenOCD ZIP below:
https://visualmicro.com/Downloads/Tools/openocd-0.12.0.2023.03.16/openocd-0.12.0...
2) Extract the ZIP to "C:\ProgramData\vMicro\tools"
3) Copy the attached file into your Project (next to the INO file), and remove the ".txt" suffix so its' just a JSON file.
4) Change the Debug Configuration to vMicro > Debugger > Hardware Debugger: Manual/Custom

If you then try and attach the debugger again in Visual Micro it should succeed.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
NworbLegin
Newbies
*
Offline


Posts: 5
Joined: Feb 4th, 2023
Re: Support for the Raspberry Pi Debug Probe
Reply #6 - Mar 28th, 2023 at 7:48pm
Print Post  
So I renamed the file to "RASPBERRY_PI_PICO_W.Debug.debugger_launch.json"
Set Debug to Hardware with Manual/Custom set and with the Pico W selected as the correct COM port attempted to debug the app.

It uploaded the app to the device and it reset and started to run, but VisualStudio showed an error saying that it could not find the MatrixOrnamentV3.ino.bin file referenced from the JSON file on line 25. I edited the json file and specified the .elf file and after trying again, and waiting for the debugger to kick in, I could eventually start to debug the running program by adding a breakpoint.

Is the .bin generation missing? Was I correct changing this to the .elf file instead?

I am unable to put a breakpoint within the setup() function as the program seems to run on the Pico before the initial breakpoint is hit. I attempted to change the "stopAtEntry" value in the json to true, but this made no difference. Is there some other way to get the debugger to hold off from starting the program until everything is ready?

I also had trouble stopping the debugger and restarting it. The program would not upload again to the Pico. I had to manually reset the Pico and try again for it to work. Shouldn't the program be uploaded via the Debug Probe?

Sorry to be a pain, but I hope this is some useful info for you.
« Last Edit: Mar 28th, 2023 at 8:17pm by NworbLegin »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: Support for the Raspberry Pi Debug Probe
Reply #7 - Mar 29th, 2023 at 8:52am
Print Post  
Yes the change to the ELF File was correct, I had tested with the wrong board package version to build the base JSON file.

In v3.1.0 it builds the BIN and uses this with GDB, however in v2.3.2 it uses the ELF.

Thanks for confirming this works, we will update this thread when it is integrated into a menu option and the JSON can be removed.

To get the program to restart as the debugger connects (to debug setup()) you can add a delay at the start of setup() (e.g. 15s) and use Debug > Start to perform the upload and attach the debugger.  The delay ensures the code doesn't run until the session is attached.

To reset the board on Debug > Attach to Process, change the DebugServerArgs in the JSON from -c \"init\" to -c \"init; reset\".

To Upload via the Debug Probe, if you upgrade to v3.1.0 of the board package, you can select the Upload Method of "Picoprobe (CMSIS-DAP)" on the Board Options.
« Last Edit: Mar 29th, 2023 at 9:30am by Simon@Visual Micro »  
Back to top
IP Logged
 
NworbLegin
Newbies
*
Offline


Posts: 5
Joined: Feb 4th, 2023
Re: Support for the Raspberry Pi Debug Probe
Reply #8 - Mar 29th, 2023 at 8:28pm
Print Post  
Thanks. I've updated to v3.0.0 and this is also working okay - although still with the ELF file. The BIN file is being generated, but setting that instead of the ELF give a missing or corrupt file warning when the debugger is attempting to start. Maybe this only works with v.3.1.0

The upload through the debug probe is also working - although it's fairly slow compared to the uf2 file method, but I think that is just the speed that the debug port runs at.

Thanks for all your help with this. How soon do you expect to have a working solution without the need for a custom json file? weeks? months?

I added the delay and this is working fine
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: Support for the Raspberry Pi Debug Probe
Reply #9 - Mar 30th, 2023 at 10:27am
Print Post  
Thanks for the update and detail around all of this.

We expect the update to be released in the next week with the debugger integrated into the drop down list options.

We will update this thread when it is available for download from the forum.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: Support for the Raspberry Pi Debug Probe
Reply #10 - Apr 24th, 2023 at 4:56pm
Print Post  
Apologies for the delay on releasing this, please download the latest version (23.0424.0) from the board below to use the integrated menu option for this debugger;
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint