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
Hot Topic (More than 8 Replies) Serial Port Monitor starts sluggish and quickly becomes nonresponsive (Read 3989 times)
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Oct 25th, 2022 at 3:05pm
Print Post  
I have a Arduino Nano 33 BLE project that runs well in Arduino IDE 2.0.0.  Their Serial Monitor shows that my main loop displays the changing value of my pot input as fast as I can move my pot.  The main loop cycles at about 440 us (~2700 hz).

When I run the same project in Visual Micro Release 22.09.05.7, its Serial Port Monitor updates very sluggishly in the first few seconds and then stops responding to changes in pot voltage (even waiting for minutes for the Serial Port Monitor to update to the current pot setting and for all those minutes of waiting, new print lines do show up about once per second in the port monitor but they are for extremely old pot positions).

Any idea why the VM Serial Port Monitor gets seemingly non responsive?

Thanks,
Dale
  

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


Posts: 2144
Joined: Feb 13th, 2019
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #1 - Oct 25th, 2022 at 3:11pm
Print Post  
If you set the disable the Serial Debugger (change to vMicro > Debugger > Debug: Off), does this improve?

Alternatively you can disable the Serial Debugger by selecting the Release Build Configuration, instead of the Debug one.
  
Back to top
 
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #2 - Oct 25th, 2022 at 3:39pm
Print Post  
Yes, that gets the responsiveness back but I REALLY need this project to run responsively in debug mode.

I do believe it is possible since I could not get analogRead serial printing to work at all at first in debug mode, then I made a simple sketch to start a forum topic which behaved the same for a while and then it simply started working in debug mode and the forum post was not needed.

I then spent a lot of time debugging and developing my posted sketch. I marvel at how well your debug features work  Smiley .  I LOVE your breakpoint plotting mode and I find it indispensable for PID tuning.  I have a Black Magic Probe V2.3 on the way to further explore hardware debugging but now, all of a sudden the project seems not to be able to use your normal debug mode anymore.

What could trigger this instant sluggishness?

Thanks,
Dale
  
Back to top
 
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #3 - Oct 25th, 2022 at 4:02pm
Print Post  
I just noticed this error window.  Even with these errors, the ino compiles and runs (but sluggish serial monitor as described).  Could these >700 errors cause this?
  

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


Posts: 2144
Joined: Feb 13th, 2019
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #4 - Oct 25th, 2022 at 4:07pm
Print Post  
The intellisense errors will have no effect over the Serial Monitor performance to our knowledge.

When you are using the Serial debugging, can you try it with the vMicro > Debugger > Full Speed (No Throttle) enabled, to see if this helps at all?
  
Back to top
 
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #5 - Oct 25th, 2022 at 4:14pm
Print Post  
I had already tried that, sadly no difference...
  
Back to top
 
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #6 - Oct 25th, 2022 at 4:53pm
Print Post  
I just realized that all my successful VM debugging before this issue was done with this code on an Arduino Nano.

This issue is related to switching the coding over to an Arduino Nano 33 BLE if that is a relevant clue for you ....
« Last Edit: Oct 25th, 2022 at 4:54pm by DaleCKramer »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #7 - Oct 25th, 2022 at 5:37pm
Print Post  
Please switch the tool bar configuration name from Debug to Release. Then upload again.

After doing that follow the guide in yellow above so that we can see your config.

Thanks
« Last Edit: Oct 25th, 2022 at 5:39pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #8 - Oct 25th, 2022 at 5:59pm
Print Post  
I think this is what you asked for:
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #9 - Oct 25th, 2022 at 6:16pm
Print Post  
Thanks, that isn't normal. We will try to replicate. Some questions that might be useful...

- What speed is your serial.begin() using?
- Does the same happen with a simple sketch such as blink with Serial.println("Hellow world");
- Make the Serial monitor wide and show a screen shot if possible.


Thanks
  
Back to top
WWW  
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #10 - Oct 25th, 2022 at 6:36pm
Print Post  
1. 115200 baud
2. Here is a more relevant simple sketch (than Hello World) that changes the value in Serial Port Monitor EXTREMELY slowly (minutes) when the analog input voltage to A0 changes.
3. Here it is:

Also, if I remove my breakpoint plotting of 4 variables split between 2 graphs and also keep my main loop rate to no shorter than about 4ms, then the original code of this post is not sluggish but this is not a productive way to debug for me Sad

Thanks for looking at this issue!
« Last Edit: Oct 25th, 2022 at 6:37pm by DaleCKramer »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #11 - Oct 25th, 2022 at 6:47pm
Print Post  
Here is that same simple sketch working fine on Arduino IDE 2.0.0 serial monitor:
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #12 - Oct 25th, 2022 at 7:59pm
Print Post  
Hello, I see you still have debug active. We can help with debug after we prove normal release mode is working.

Please switch to Release and report what happens

Thanks
  
Back to top
WWW  
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #13 - Oct 25th, 2022 at 8:10pm
Print Post  
In Release build, the VM Serial Port Monitor values change as fast as I can move the pot...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #14 - Oct 25th, 2022 at 8:58pm
Print Post  
Thanks. 

Assuming that you don't have any breakpoints that stop, and that you have switched on full speed debugging then it sounds like a debug packet is getting corrupted, maybe overflowing the buffer.

There is an update waiting to be published that might improve things. The download is available in this forum new releases section here https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Furthermore, the debugger has to do more work than simply read and display serial. The mcu can send at very high speeds. The PC is going to struggle at some point. Conditional breakpoints give many benefits, one being the ability to send a debug message every 100ms or 250ms etc.. These types of breakpoints don't cause the mcu to slow down due to over using the serial.

You can right click a breakpoint and set a condition on counter every 250.  The default setting in visual micro is to use counter as millis. Therefore a breakpoint conditona that is set to "multiple of 250" wold give you a debug update 4 times a second.

https://www.visualmicro.com/page/User-Guide.aspx?doc=Working-With-Breakpoints-Hi...



  
Back to top
WWW  
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #15 - Oct 25th, 2022 at 11:01pm
Print Post  
Tim@Visual Micro wrote on Oct 25th, 2022 at 8:58pm:
Assuming that you don't have any breakpoints that stop,

Why would you have to assume that, aren't all the active breakpoints visible by red icons next to the line number in the VM GUI?


Yes full speed debugging is ON.

I have been exploring breakpoints at that link and others for a while now.  Thanks for the link.

I am afraid updating my PID output plots only 4 times a second is not fast enough for my needs.  I was able to get my plots every 60ms or so and some other main loop  printed serial data when I ran my code on a basic Arduino Nano.  Something still seems strange to me.  Huh

I will setup the Nano again and provide more precise feedback on what seems to work on it and not on the Nano33BLE.

Also, I will try 22.09.05.11 and report back.

Dale
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Online


Posts: 2144
Joined: Feb 13th, 2019
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #16 - Oct 26th, 2022 at 12:49pm
Print Post  
We have done some further testing around this, and to ensure the buffer on the PC doesn't get filled quicker than it's being emptied, the below approaches can be used:

1) Throttling Approach:
Disable the vMicro > Debugger > Full Speed (No Throttle) setting
Open the Project Properties (vMicro > Project Properties), and set the "Throttle (ms)" to 60 (it defaults to 80 when the value is 0)
This should keep up with the real world actions of turning the pot with the @Plot charts and Serial Monitor

2) Non-Throttling Approach:
Enable the vMicro > Debugger > Full Speed (No Throttle) setting

Use the HitCounters on the breakpoints to only report when it is a multiple of 60 (so every 60ms).  This gives finer control of which breaks report how often which is useful when using a mixture of break/tracepoints in your sketch.  This can be changed from being ms to being a counter in the Project Properties > Hit Counters setting, if you want it to report every x times it hits the tracepoint instead of every x ms.

Additionally you can use conditions on the break/tracepoint to check the value has changed by more than a specified amount (e.g. 5) by storing the previous value in your sketch, and using the condition to compare the previous and current reading, ensuring they have changed by more than a specified amount before it reports.

Hit Counters and Conditions can be used together to prevent over-reporting a non-changing value, with much finer grained control over it when compared to the throttling, but at present if the data is coming in faster than ~60ms then it begins to lag behind reality.

We will look at improving the maximum speed this runs at in the future, and we will update when there is any change to this.


  
Back to top
 
IP Logged
 
DaleCKramer
Junior Member
**
Offline


Posts: 12
Joined: Oct 23rd, 2022
Re: Serial Port Monitor starts sluggish and quickly becomes nonresponsive
Reply #17 - Oct 26th, 2022 at 1:31pm
Print Post  
Thank-you!!!!

That is a very good explanation which I think I can work with.

You guys are great. Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint