Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
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....
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
"serial debugger was delayed" when using debugger inside .cpp (Read 296 times)
Ricordi
Newbies
*
Offline



Posts: 2
"serial debugger was delayed" when using debugger inside .cpp
Mar 7th, 2020 at 5:35am
 
Hello. I'm about 4 days into Visual Micro. It's so nice vs the Arduino IDE.

I'm having an issue I can't find the answer for online. In the main .ino file, I can use the debugger just fine. However, when I use it with a breakpoint set in a .cpp file, I get the error message "The serial debugger was delayed waiting for an incoming line of data..."

I've gotten that error message. I set Serial.begin(57600). But I've changed Visual Micro's default to match. It somehow seems that the override of the baud rate only applies to breakpoints in the main .ino.

Thank you for any suggestions.
Back to top
« Last Edit: Mar 7th, 2020 at 5:36am by Ricordi »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10653
United Kingdom
Re: "serial debugger was delayed" when using debugger inside .cpp
Reply #1 - Mar 7th, 2020 at 8:52pm
 
Thanks for the message.

The attempt to detect if the code is already setting a specific serial speed is crude and does simply look in the .ino code and attempt to find a [serialObj].begin(#number). Therefore if you have Serial.begin(57600) in the .ino code it will resolve otherwise you have to alter the default RemoteSpeed (or LocalSpeed) on the vMicro>Debugger menu.

The "delayed" message should only happen if your own code is omitting serial (but without a line terminator) and sharing the same port as the debugger.

If you ensure that your own serial completes with Serial.println() before a breakpoint is hit then you should not see the "delayed" message.

"Delayed" simply means we did not show your own serial for 3 seconds while we waited to see if a line terminator would arrive


Does this make sense or have I missed the point.

I should also say there is a new release waiting to go into the gallery. It does include a few minor improvements that affect soft debugging. The release is here.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Back to top
 
WWW  
IP Logged
 
Ricordi
Newbies
*
Offline



Posts: 2
Re: "serial debugger was delayed" when using debugger inside .cpp
Reply #2 - Mar 11th, 2020 at 5:31am
 
>Does this make sense or have I missed the point.

It makes sense, but I think maybe I wasn't clear. My code only receives Serial input. There's no Serial.print or Serial.println in the whole codebase. I've already set LocalSpeed (but not RemoteSpeed) on the vMicro>Debugger menu.

Also, the breakpoints work when placed in the .ino file. It's only when I move a breakpoint to a .cpp file that the "delayed" message occurs. The code doesn't change.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10653
United Kingdom
Re: "serial debugger was delayed" when using debugger inside .cpp
Reply #3 - Mar 11th, 2020 at 6:32pm
 
Ah, you need to debug on a different serial port or use the visual micro SoftwareSerial with couple of digi pins. We can not stop ar breakpoints if you use serial.read(). You can try enabling the vMicro>Debugger>Trace Only option, which won't then use the serial.reader and therefore will continue at each brakpoint.
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10653
United Kingdom
Re: "serial debugger was delayed" when using debugger inside .cpp
Reply #4 - Mar 22nd, 2020 at 12:25am
 
Off-Topic replies have been moved to this Topic.
Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print