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 Breakpointing/Debugging an interrupt (Read 1413 times)
HomerRamone
Junior Member
**
Offline


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




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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpointing/Debugging an interrupt
Reply #1 - Apr 19th, 2022 at 6:43pm
Print Post  
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
« Last Edit: Apr 19th, 2022 at 6:46pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
HomerRamone
Junior Member
**
Offline


Posts: 38
Joined: Feb 5th, 2022
Re: Breakpointing/Debugging an interrupt
Reply #2 - Apr 20th, 2022 at 8:46am
Print Post  
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: 2143
Joined: Feb 13th, 2019
Re: Breakpointing/Debugging an interrupt
Reply #3 - Apr 20th, 2022 at 9:37am
Print Post  
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
Joined: Feb 5th, 2022
Re: Breakpointing/Debugging an interrupt
Reply #4 - Apr 20th, 2022 at 9:49am
Print Post  
And ESP-WROVER-KIT 
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2143
Joined: Feb 13th, 2019
Re: Breakpointing/Debugging an interrupt
Reply #5 - Apr 20th, 2022 at 9:57am
Print Post  
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.
« Last Edit: Apr 20th, 2022 at 9:57am by Simon@Visual Micro »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint