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 VisualMicro and Leonardo Serial.print issue (Read 3904 times)
DP
Newbies
*
Offline


Posts: 3
Joined: Oct 17th, 2014
VisualMicro and Leonardo Serial.print issue
Oct 17th, 2014 at 6:56am
Print Post  
Hi, I'm having an issue where the serial monitor window allows me to send characters to a Leonardo USB device but does not receive characters using Serial.print.  The Arduino IDE serial monitor is able to show characters from the device so it is only the Atmel Studio + VisualMicro serial monitor that has this issue.  I made a 2 minute video showing the problem.  In the video I was using a slightly older version of VisualMicro but just installed the latest version and still have the same problem.
https://www.youtube.com/watch?v=NGmHmpjQm8w

When uploading via VisualMicro the Leonardo USB device switches to COM8 and then back to COM7 as expected, and I am able to send characters to the Leonardo (it's RX led lights).  When I disconnect from COM7 in VisualMicro and open the Arduino IDE serial monitor (also on COM7), it begins showing the serial output as expected.  I've tried adding delays before calling Serial.begin, adding delays before sending characters, added { while (!Serial) } in setup(), and other various tricks but still no luck.  So any help would be appreciated, thank you!

PS I am loving VisualMicro, really nice work!

Code (C++)
Select All
void setup()
{
	Serial.begin(4800);
	while (!Serial)	{;} // Wait for serial port to connect. Needed for Leonardo only
}

void loop()
{
	if (Serial.available()) // Sending characters to the Leonardo works
	{
		// This output never shows in the VisualMicro serial monitor and the TX light on the Leonardo never flashes.
		// It does flash when disconnecting the VisualMicro serial monitor and connecting the Arduino IDE serial monitor,
		// and also the output appears as expected.
		Serial.println(millis());
		delay(2000);
	}
}
 

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


Posts: 12164
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VisualMicro and Leonardo Serial.print issue
Reply #1 - Oct 17th, 2014 at 9:08am
Print Post  
Thanks for the message and congratulations for the being the 2nd of 4000 people to switch on topic notifications. normally I have to do it Smiley

It is possible that the problem is the debugger is enabled. the debugger defaults to 115200 serial speed (which can be changed in the project properties)

However, for now I suggest switching the "debug" setting on the tool bar to "Release" then uploading and tying again.

Thanks
  
Back to top
IP Logged
 
DP
Newbies
*
Offline


Posts: 3
Joined: Oct 17th, 2014
Re: VisualMicro and Leonardo Serial.print issue
Reply #2 - Oct 17th, 2014 at 9:55am
Print Post  
geez weak sauce, I guess they didn't really want help...write some demo code, post a video, and for Pete's sake turn on the stinking notification people Wink

I tried the release mode compile and upload, then the baud rate change in the serial monitor and code, but still no dice.  However, to my surprise, after restarting Atmel Studio with these changes in place, and doing another compile and upload, serial output started flowing in.

So I've purchased a license and thank you again for this great extension and the support, well done!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12164
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VisualMicro and Leonardo Serial.print issue
Reply #3 - Oct 17th, 2014 at 10:13am
Print Post  
Great stuff, thanks for the update.

I am not sure why a re-start was required but give it another test before next release just to make sure it is ok.


Might not be useful but for the future ...

If you do need to do debugging and also use serial.read in your sketches then it would be better to use a different port or couple of digital pins for debug. 

http://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-With-Different-Por...
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint