VS Arduino
Visual Micro >> Usb/Serial/WiFi Debugging >> "serial debugger was delayed" when using debugger inside .cpp
https://www.visualmicro.com/forums/YaBB.pl?num=1583559324

Message started by Ricordi on Mar 7th, 2020 at 5:35am

Title: "serial debugger was delayed" when using debugger inside .cpp
Post by Ricordi on 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.

Title: Re: "serial debugger was delayed" when using debugger inside .cpp
Post by Visual Micro on 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


Title: Re: "serial debugger was delayed" when using debugger inside .cpp
Post by Ricordi on 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.

Title: Re: "serial debugger was delayed" when using debugger inside .cpp
Post by Visual Micro on 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.

Title: Re: "serial debugger was delayed" when using debugger inside .cpp
Post by Visual Micro on Mar 22nd, 2020 at 12:25am
Off-Topic replies have been moved to this Topic.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.