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 Serial output not showing (Read 1876 times)
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Serial output not showing
Nov 30th, 2018 at 12:41am
Print Post  
I make extensive use of the Serial.print statement to display debugging diagnostics. Lots of these messages happen during Setup and more occur during the Loop. There is a large amount of code involved, but when I add code, no serial output happens. If I add code in the loop, the code in the Setup section doesn't get displayed. I have the output logs enabled, and when this happens, the entire content of the log file is:

2018-11-29 16:21:25      Message      Opening port
Port open

I can make the output reappear simply by not executing some code late in the setup process. I put a "return;" statement in some long initialization code, long after lots of diagnostics have already been displayed. If I remove the "return;" statement, NO OUTPUT appears. How can this be? Doesn't make any sense to me.

The compiler output ends with:
Program size: 33,744 bytes (used 13% of a 253,952 byte maximum) (2.69 secs)
Minimum Memory Usage: 3980 bytes (49% of a 8192 byte maximum)

I am running this code on a Mega.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial output not showing
Reply #1 - Nov 30th, 2018 at 11:14am
Print Post  
Debug or Release mode?
  
Back to top
WWW  
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Serial output not showing
Reply #2 - Nov 30th, 2018 at 3:43pm
Print Post  
Same problem in both modes.
  
Back to top
 
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Serial output not showing
Reply #3 - Nov 30th, 2018 at 8:14pm
Print Post  
I figured out what the problem was.My classes have some code in their constructors that writes a message on Serial output that confirms the class being constructed. Some of those classes were being constructed before the Serial.begin statement happened. So instead of simply throwing the bad messages away, it... threw everything away.

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial output not showing
Reply #4 - Dec 1st, 2018 at 1:04am
Print Post  
Thanks for the update. Yes class init is prone to happen before the arduino core loads. Surprised the cpu doesn't just crash.

  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint