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) Arduino Uno serial output problem when using Visual Micro debugger (Read 14054 times)
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Arduino Uno serial output problem when using Visual Micro debugger
Mar 28th, 2014 at 1:59pm
Print Post  
I am using Atmel studio 6.2 the corresponding beta version of the debugger and Arduino 1.5.6. However the same problem occurs under the previous version.

When I run this 

void setup()
{
}

void loop()
{
int      i;
     i++;
}

Debugs trace works fine and I get the usual default debug trace on loop()

However when I run

void setup()
{

  Serial.begin(115000);

}

void loop()
{
int      i;
     i++;
     Serial.println(i,DEC);
}

I get neither the serial output or any debug trace

If I comment out the serial commands it wont work again until I restart the IDE.

This happens regardless of the baud rate.

Any ideas please?

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


Posts: 12204
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #1 - Mar 28th, 2014 at 2:28pm
Print Post  
Hi Richard

115000 is not a valid standard Arduino or Windows speed

Please use 115200

Thanks


  
Back to top
IP Logged
 
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #2 - Mar 28th, 2014 at 6:30pm
Print Post  
void setup()
{

  Serial.begin(115200);

}

void loop()
{
int      i;
     i++;
     Serial.println(i,DEC);
}


Makes not difference, please note I have tried lots of baud rates, all work if using the Ardurio IDE, I.E. i get the serial text come through to the console. If I move the same code to run under Atmel studio/VM Debug it neither does serial or debug. If I remove the serial code and relaunch the IDE it works, put serial back it stops.

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


Posts: 12204
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #3 - Mar 28th, 2014 at 6:56pm
Print Post  
Hi,

Serial is standard stuff we use it everywhere. 

Visual Micro uses windows usb and Arduino uses java. Maybe windows has a problem and needs to power off and re-start.

However here are some questions about things that might cause the problem

1) Did you alter the speed on the serial monitor? It defaults to 115200 and needs to match whatever you use in your sketch

2) Did you try "debug>start without debugging" to ensure that debugger settings have not confused things?

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


Posts: 12204
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #4 - Mar 28th, 2014 at 8:58pm
Print Post  
ps:

Sorry I meant Visual Micro uses .NET and not java so that will be the difference. I know that doesn't help but just explaining things.

Out of interest, can you tell me which version of Visual Micro you are using? tools>options>visual micro>version>version

And also what hardware you are using? Which board?

It is quite a strange problem so a power off and re-start should certainly be tried as explained above.

Thanks
  
Back to top
IP Logged
 
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #5 - Mar 28th, 2014 at 9:48pm
Print Post  
Its not a "turn it off & on" issue Smiley

I have installed it on 2 systems, both have the same issue, multiple reboots & even uninstall/reinstall. I use an Uno over USB. I can debug fine until I add serial code, then it all dies until a restart.

I had the same problem with IDE V6.1 and the old version of Arduino + release version of the debugger.

The only thing I can think of is that the port asssigned by the driver is COM11, I seem to remember Windows has issues with ports>10.

To recap. It works fine, until I add the Serial stuff, then it breaks, when I move the code to the Arduino IDE it works fine, serial output is ok, of course there is no debug.

Happy to zip of project files if this helps.


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


Posts: 12204
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #6 - Mar 28th, 2014 at 10:06pm
Print Post  
Hi,

Thanks for the info and sorry i asked which board I have just seen it in the title. 

Q: So the manual serial in your code works on its own without debug, and the debug works without manual serial?

If debug works then this is certainly not a usb problem.

After a debug upload, it would help to have the sketch zipped including the visual micro sub folder and email to info [at] visualmicro.com

Please also switch on "tools>options>visual micro>compiler>always show build folder" prior to the upload and you will see a link to the temp build folder in the output window. In the folder there will be a sketchname.cpp source code file. Please email that too.

Thanks very much
  
Back to top
IP Logged
 
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #7 - Mar 28th, 2014 at 10:19pm
Print Post  
I can run the code I posted in the Arduino IDE and serial works fine.

I can run the code without the serial calls in Atmel Studio with the VM debugger and I get the debug info

If I try to run the code with serial in Atmel Studio with the VM debugger I do not get any serial messages nor does the debug info come up.

This is semi permanent, ie, if  just comment the serial lines out and re-run it won't work until I shut the IDE down and restart.

I will zip code up now and send
« Last Edit: Mar 28th, 2014 at 10:22pm by Richard Leinfellner »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12204
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #8 - Mar 28th, 2014 at 10:24pm
Print Post  
Strange one. Thanks I will look at the code.
  
Back to top
IP Logged
 
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #9 - Mar 28th, 2014 at 10:32pm
Print Post  
Much appriciated , I prefer this IDE setup to the native one, however as is its impossible to use.

It may well be a setting issue, but I have reinstalled many times now and also tried 2 machines etc. Which is why it got it down to just a few lines which fail to elliminate any other issues.

I have mailed the code.

Regards

Richard
  
Back to top
 
IP Logged
 
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #10 - Mar 28th, 2014 at 10:41pm
Print Post  
Just noticed that "i" should be static, but this does not affect the test, other than that it will always be 1 (or some other number+1)  when printed.

I have rechecked with "i" as static and it makes no difference ie. it works in Arduino IDE but fails under Amtel/VM

Richard

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


Posts: 12204
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #11 - Mar 28th, 2014 at 10:50pm
Print Post  
It doesn't matter about i it has a value of 1. I have used the same code with i and also using millis(). Yes, if i was defined outside of the loop it would increment.

When the debug or serial does not show is the serial window open? Is auto re-connect ticked?

The files you sent show that the upload was without debug information. Can you please send a version after debug upload?

Please also show what the "Micro Build" output window contains after debug upload.

thanks
  
Back to top
IP Logged
 
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #12 - Mar 28th, 2014 at 11:06pm
Print Post  
Ok, now I feel a fool! Just did this again and now it appears to be working, see email.

Its getting late now in the UK, so will figure out whats different tomorrow as I have now spent 2 days on this, I'd love to know what I did differently this time.

Will also try it on the second system, to see if its a a single setting.

Sorry if this was a wild goose chase.

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


Posts: 12204
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #13 - Mar 28th, 2014 at 11:09pm
Print Post  
No probs, I'm in the uk too  Smiley

Your screen shot looks good. I'm not sure what was happening before. I am keen to know if it happens again.

Thanks
  
Back to top
IP Logged
 
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #14 - Mar 28th, 2014 at 11:15pm
Print Post  
I am helping out at a Arduino workshow tomorrow, so will have some time to track it down. Its very weird as my friend also had the same issue, ie. no debug info when serial was used.

Whats weird is that I cuold literally do a new scetch, compile, upload and get debug. I'd then manually add the serial code and that would break it.

Then remove the serial code, restart IDE and it would work again.

I felt like I was going mad Smiley


Will post results

Thanks

Richard
  
Back to top
 
IP Logged
 
Richard Leinfellner
Newbies
*
Offline


Posts: 9
Joined: Mar 28th, 2014
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #15 - Mar 29th, 2014 at 10:03am
Print Post  
Ok, I have copied the project to my 2nd machine and it works fine now. 

I think I know the issue now, the lllegal baud rate seems to have hand to play.

Setting it wrong will not just affect that session it will stop it working from that point on until an IDE reboot, I suspect its because the debugger may not reset to baud rate to anyting legal other than on startup, once its wrong, it stays wrong.

Trying other baud rates wont work because the debugger is expecting 115200.

It may be an idea to add a warning if there is a baud rate mismatch, as its quite subtle to find.

Thanks for your help.

Richard

PS Great product, makes it feel almost like a Pic using MPLAB. Will recommend to others today in the workshop







Richard
« Last Edit: Mar 29th, 2014 at 10:03am by Richard Leinfellner »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12204
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Uno serial output problem when using Visual Micro debugger
Reply #16 - Mar 29th, 2014 at 5:34pm
Print Post  
Great news thanks Richard.

For you info Visual Micro micro does not have the control your outline over the serial port. We currently use the standard .net interface to manage the ports and that gives very simple high level information.

I suspect it is the windows api that falls over but will do some testing to see if there is anything that can be done.

Thanks again for the useful update, best of luck with your workshop
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint