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
Normal Topic RP2040 debug (Read 689 times)
FrankieM
Newbies
*
Offline


Posts: 4
Joined: Mar 9th, 2023
RP2040 debug
Dec 5th, 2023 at 8:55am
Print Post  
Hi, I'm trying to debug a program with RP2040 and a pico-debug [re-flashed 1.03].
Debugging from 'start debugging' play button doesn't work, it launches but seems to stick at an odd bit of code- i.e. wire library.
Debugging by programming and then 'attach to process' sort of works but runs to the first breakpoint in loop.
- it neither stops at the beginning of loop or breaks on any breakpoint in setup.
- if I set a breakpoint in a function and the break seems to happen elsewhere in a different function.
What's going wrong ???
  

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


Posts: 2193
Joined: Feb 13th, 2019
Re: RP2040 debug
Reply #1 - Dec 5th, 2023 at 12:28pm
Print Post  
Thanks for the report and the logging information.

If you add a Local board.txt to your project (vMicro > Add Code > Add Local board.txt) and paste in the contents of the below file, does this help with landing on breakpoints in loop(), and any other functions you have set?
  

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


Posts: 4
Joined: Mar 9th, 2023
Re: RP2040 debug
Reply #2 - Dec 5th, 2023 at 1:46pm
Print Post  
Hi, it seems to have improved the 'start debugging' play button - it now operates the same as attach to process.
There is a breakpoint in setup which isn't hit, it seems to be breaking and automatically restarting in line 96 [the actual breakpoint is in line 90] and eventually hits the breakpoint in 201.
  

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


Posts: 1
Joined: Dec 13th, 2023
Re: RP2040 debug
Reply #3 - Dec 13th, 2023 at 11:53am
Print Post  

FrankieM wrote on Dec 5th, 2023 at 8:55am:
Hi, I'm trying to debug a program with RP2040 and a pico-debug [re-flashed 1.03].
Debugging from 'start debugging' play button doesn't work, it launches but seems to stick at an odd bit of code- i.e. wire library.
Debugging by programming and then 'attach to process' sort of works but runs to the first breakpoint in loop.
- it neither stops at the beginning of loop or breaks on any breakpoint in setup.
- if I set a breakpoint in a function and the break seems to happen elsewhere in a different function.
What's going wrong ???

You can watch this video to get instructions https://www.youtube.com/watch?v=jnC5LrTx470&embeds_referring_euri=https%3A%2F%2F...
« Last Edit: Dec 14th, 2023 at 7:56am by charlesgrayyy »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2193
Joined: Feb 13th, 2019
Re: RP2040 debug
Reply #4 - Dec 13th, 2023 at 12:04pm
Print Post  
Thanks for the link, however that video shows VSCode which is a different product and will use different packages to configure and run the debugging.

This forum and thread is only for Visual Micro in Visual Studio.
  
Back to top
 
IP Logged
 
FrankieM
Newbies
*
Offline


Posts: 4
Joined: Mar 9th, 2023
Re: RP2040 debug
Reply #5 - Dec 13th, 2023 at 12:17pm
Print Post  
Hi Simon, is there anything else I can try ?
Is it worth uninstalling and re-installing VS &/ VM ?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2193
Joined: Feb 13th, 2019
Re: RP2040 debug
Reply #6 - Dec 13th, 2023 at 1:04pm
Print Post  
Can you try adding a delay at the very top of setup() (e.g. delay(5000)), and then use the Start button again?

This seems to allow the debugger to connect before the delay has finished, so you should be able to debug the code within setup.
  
Back to top
 
IP Logged
 
FrankieM
Newbies
*
Offline


Posts: 4
Joined: Mar 9th, 2023
Re: RP2040 debug
Reply #7 - Dec 14th, 2023 at 12:08pm
Print Post  
Hi, thank you for your support, adding the delay worked ! Grin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint