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) Raspberry Pi Pico Debug Problem (Read 4193 times)
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Raspberry Pi Pico Debug Problem
Apr 19th, 2023 at 11:39am
Print Post  
Hello Dear Forum Members;
I'm debugging my Raspberry Pi Pico with ESP32-Prog with no problem in Visual Studio.

I need to use  "Earle Phil Hower's rp2040 core" because my code is just working on this board.
(The Reason is: Wire.h files are different between Phil Hower's and Arduino Mbed OS boards.)

When I change my board to Earle Phil Howers pico in Visual Studio, I'm not able to upload my code with ESP-Prog. (You can see it in ScreenShot.)

Can somebody tell me how to upload&debug my code by using  Phil Hower's pico? 

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico Debug Problem
Reply #1 - Apr 19th, 2023 at 11:49am
Print Post  
Thanks for the report.

The ESP-PROG is not currently configured for upload for this board, and all available options can be seen on the Board Options > (Option 11) Upload Method menu shown in your screenshot.

Is there any reason you cannot use the standard UF2 upload via the USB port on the RPi Pico Board?
  
Back to top
IP Logged
 
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #2 - Apr 19th, 2023 at 12:02pm
Print Post  
Thanks for quick reply.
I have no idea for how to debug with ESP-Prog while using USB Port upload option. 
What should I do for this combination? Can you explain me?
Thanks.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico Debug Problem
Reply #3 - Apr 19th, 2023 at 12:08pm
Print Post  
Documentation: https://www.visualmicro.com/page/RasPiPico-Debugging.aspx
If you set the below options:
vMicro > Debugger > Debug: Hardware
vMicro > Debugger > Hardware Debugger: ESP32 PROG

If you leave the upload method as UF2 as shown in the picture, and ensure you have the USB lead connected to the board it should upload as expected.

As you will now be powering the ESP-PROG and the RPi Pico boards from their own USB connection you need to disconnect the 3v3 line between the ESP-PROG and Rpi Pico if it is connected.  Make sure you leave the GND connected between the two boards.

Once the code is uploaded you can begin a Debug session from the Debug > Attach to Process.  If you want to perform the upload and begin the debugging session in one click use Debug > Start Debugging.

  
Back to top
IP Logged
 
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #4 - Apr 19th, 2023 at 1:54pm
Print Post  
Thank you very much for your time.
I'll follow these steps and upload the topic in a few days. 
See you later Simon!
  
Back to top
 
IP Logged
 
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #5 - Apr 25th, 2023 at 1:04pm
Print Post  
Simon@Visual Micro wrote on Apr 19th, 2023 at 12:08pm:
Documentation: https://www.visualmicro.com/page/RasPiPico-Debugging.aspx
If you set the below options:
vMicro > Debugger > Debug: Hardware
vMicro > Debugger > Hardware Debugger: ESP32 PROG

If you leave the upload method as UF2 as shown in the picture, and ensure you have the USB lead connected to the board it should upload as expected.

As you will now be powering the ESP-PROG and the RPi Pico boards from their own USB connection you need to disconnect the 3v3 line between the ESP-PROG and Rpi Pico if it is connected.  Make sure you leave the GND connected between the two boards.

Once the code is uploaded you can begin a Debug session from the Debug > Attach to Process.  If you want to perform the upload and begin the debugging session in one click use Debug > Start Debugging.



Hey Simon,
I tried your solution. I successfully uploaded my sketch with a MicroUSB cable then I tried to debug with ESP-Prog but I couldn't. Here is my 2 screenshot. 
1. Finished uploading then selected "Attach to process"
2. Directly selected "Start Debugging".
 
And I wonder that, Which one should I choose? ARM or ARM64?







« Last Edit: Apr 25th, 2023 at 1:06pm by omerziya »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico Debug Problem
Reply #6 - Apr 25th, 2023 at 2:50pm
Print Post  
Thanks for the update.

This seems to be an issue with the specific version of GDB from the board package and the fact it is on a Windows system.

One workaround is to open a command line and run the below:
setx HOME %USERPROFILE%

Then when you next try to attach the debugger the warning message about the index cache directory should not be shown.
  
Back to top
IP Logged
 
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #7 - Apr 25th, 2023 at 3:05pm
Print Post  
Simon@Visual Micro wrote on Apr 25th, 2023 at 2:50pm:
Thanks for the update.

This seems to be an issue with the specific version of GDB from the board package and the fact it is on a Windows system.

One workaround is to open a command line and run the below:
setx HOME %USERPROFILE%

Then when you next try to attach the debugger the warning message about the index cache directory should not be shown.


I didn't understand that what did you mean by Quote:
One workaround
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico Debug Problem
Reply #8 - Apr 25th, 2023 at 3:11pm
Print Post  
If you open a command prompt on your pc, and run the command stated, it will stop the error appearing about the index cache directory which you are seeing when you try to attach the debugger.
  
Back to top
IP Logged
 
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #9 - Apr 26th, 2023 at 6:16am
Print Post  
I tried but it didn't fix the error.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico Debug Problem
Reply #10 - Apr 26th, 2023 at 9:16am
Print Post  
If you run the below commands in the command prompt what is the output?
ECHO %HOME%
one-eabi-gdb.exe


  
Back to top
IP Logged
 
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #11 - Apr 26th, 2023 at 11:34am
Print Post  
Code
Select All
'one-eabi-gdb.exe' is not recognized as an internal or external command,
>> >> operable program or batch file. 



I was able to use ESP-prog debugging before trying this board, as you can remember.

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


Posts: 2695
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico Debug Problem
Reply #12 - Apr 26th, 2023 at 12:11pm
Print Post  
Ah, sorry I hadn't noticed the forum had misinterpreted the commands, can you try the ones from the attached text file and send the output from both commands (either as a text file or a screenshot).
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #13 - Apr 26th, 2023 at 1:42pm
Print Post  
Here you can see the output message.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico Debug Problem
Reply #14 - Apr 26th, 2023 at 1:44pm
Print Post  
Thanks for confirming, this shows that GDB is no longer producing the Index cache error (its normally the first message shown when run from the command line).

When you try and start debugging in Visual Studio are you seeing a different error now this element is resolved?
  
Back to top
IP Logged
 
omerziya
Junior Member
**
Offline


Posts: 18
Location: Turkey
Joined: Feb 28th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #15 - May 2nd, 2023 at 6:17am
Print Post  
Simon@Visual Micro wrote on Apr 26th, 2023 at 1:44pm:
Thanks for confirming, this shows that GDB is no longer producing the Index cache error (its normally the first message shown when run from the command line).

When you try and start debugging in Visual Studio are you seeing a different error now this element is resolved?


Sorry for the late reply. I'll try the debugging in a few days. Nowadays, I'm so busy.
  
Back to top
 
IP Logged
 
discman
Junior Member
**
Offline


Posts: 27
Joined: Apr 13th, 2023
Re: Raspberry Pi Pico Debug Problem
Reply #16 - Jun 24th, 2023 at 4:27am
Print Post  
Hi Simon,
Please pardon me for jumping into this thread.

I’ve been using a PicoProbe successfully until today.  When I launched VM, it popped up a dialog about some path settings.  After clicking OK, I now am no longer able to “Attach the Debugger”.

I saw this thread and worked through the messages.  I now at the exact output as omerziya had reported in Reply #13 above.  When I attempt to Attach, I get:
   “Unable to start debugging. GDB exited unexpectedly with exit code 1”

Can you please suggest what I can do next?
Thank you.


Problem is fixed after updating to 2023_0507_2203.
« Last Edit: Jun 24th, 2023 at 11:14pm by discman »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint