Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 

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 and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Breakpointing/Debugging an interrupt (Read 514 times)
HomerRamone
Junior Member
**
Offline



Posts: 38
Breakpointing/Debugging an interrupt
Apr 19th, 2022 at 7:21pm
 
Will the debugger cope ok with a breakpoint set in an interrupt ?
One set with say
Code:
attachInterrupt(digitalPinToInterrupt(PinIndex), HandlePinChange, CHANGE);
 




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



Posts: 11484
United Kingdom
Re: Breakpointing/Debugging an interrupt
Reply #1 - Apr 19th, 2022 at 7:43pm
 
The serial debugger will work wherever serial.print works. It can depend on the hardware or implementation of serial that you are using.

If not then you can set global variables from the interrupt and watch them in the debug in safer code.

Thanks
Back to top
« Last Edit: Apr 19th, 2022 at 7:46pm by Tim@Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Breakpointing/Debugging an interrupt
Reply #2 - Apr 20th, 2022 at 9:46am
 
Serial print definitely doesnt work in an interrupt.
Which is why id like to put a breakpoint there - so I can inspect variables (and ideally step)
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1456
Re: Breakpointing/Debugging an interrupt
Reply #3 - Apr 20th, 2022 at 10:37am
 
Can you confirm which board you are using?

The Serial debugger only supports unlimited break/trace points but does not support stepping directly.  The only way to step with the Serial debugger is to add multiple breakpoints with the values you wish to watch added to the actions, and then continue between them.

Hardware debugging may be better suited to debug the interrupt handler, however this does have a performance impact on the speed the code is run at.
Back to top
 
 
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Breakpointing/Debugging an interrupt
Reply #4 - Apr 20th, 2022 at 10:49am
 
And ESP-WROVER-KIT
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1456
Re: Breakpointing/Debugging an interrupt
Reply #5 - Apr 20th, 2022 at 10:57am
 
Thanks for confirming, I have been able to run a simple Serial.println() in an interrupt handler on this board, however the Serial debugger causes an exception when it is used within the interrupt handler.

You can use the built in hardware debugger for this board, which is shown in the below documentation:
https://www.visualmicro.com/page/ESP32-Debugging.aspx

Which will also require the USB Driver for the debug interface (Interface 0) to be changed as shown on this page:
https://www.visualmicro.com/page/Zadig-Driver-Installation-Guide.aspx

For the ESP-WROVER-KIT, select the "Debug: Hardware", and then the "ESP32 DEVKIT" option, which will allow single stepping and variable inspection at runtime.
Back to top
« Last Edit: Apr 20th, 2022 at 10:57am by Simon@Visual Micro »  
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print