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 Arduino stuck during initialization just within VisualMicro (Read 1248 times)
RaphM
Newbies
*
Offline


Posts: 3
Joined: Apr 21st, 2020
Arduino stuck during initialization just within VisualMicro
Apr 23rd, 2020 at 10:27am
Print Post  
Hello, 

I have the following strange issue. I have implemented a code using two classes calling each other. A very abstract version of it can be found in the attachements.

If I run the code on the Arduino and open the Serial Monitor I see these lines:
  Opening port
  Port open

but no other issue is mentioned.

Interesting is now:
1) If i delete the line 35: Serial.println("CurrentArrayPosition:aaaaaaaaaaaaaaaaaaaaaaaaaaa");
the skript is running fine.
2) Within the Arduino IDE the original Code is also running fine

Tried with:
Visual Micro 2020.321.3
Visual Studio 16.5.4.
Arduino IDE 1.8.10
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: Arduino stuck during initialization just within VisualMicro
Reply #1 - Apr 23rd, 2020 at 10:32am
Print Post  
Thanks for the report, we cannot see any attachments at present.

If you could also attach the logs requested at the top of this page in the yellow box it will help us to diagnose the issue more quickly.
  
Back to top
 
IP Logged
 
RaphM
Newbies
*
Offline


Posts: 3
Joined: Apr 21st, 2020
Re: Arduino stuck during initialization just within VisualMicro
Reply #2 - Apr 23rd, 2020 at 11:47am
Print Post  
Hi I hope it works now. For the log file I used the Email functionallity.
BR
« Last Edit: Apr 23rd, 2020 at 11:48am by RaphM »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino stuck during initialization just within VisualMicro
Reply #3 - Apr 23rd, 2020 at 12:01pm
Print Post  
For accurate test please ensure:-

1) The tool bar says Release and not Debug
2) The DTR checkbox is enabled in the serial monitor
3) The speed on the serial monitor bottom bar is set to 9600

Thanks
  
Back to top
WWW  
IP Logged
 
RaphM
Newbies
*
Offline


Posts: 3
Joined: Apr 21st, 2020
Re: Arduino stuck during initialization just within VisualMicro
Reply #4 - Apr 23rd, 2020 at 1:04pm
Print Post  
Okay 1) solved the issue. Thank you very much  Smiley:)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino stuck during initialization just within VisualMicro
Reply #5 - Apr 23rd, 2020 at 1:24pm
Print Post  
Great. The issue happens because the setup runs very quickly very early in startup, therefore some things can affect if the serial window has started before the message arrives on the pc from the mcu.

Things to keep in mind

The DTR is important because it causes the mcu to reboot when serial starts. Arduino IDE always has DTR on, in Visual Micro is defaults to on but is optional. If debug starts when the DTR if off then the mcu does not reboot and the setup() does not run.

When debug is running more is happening and it's possible for the very start of the mcu code to be missed. Adding a delay of 2 second to the start of the setup() can resolve that issue if debug is needed in setup().

Adding a breakpoint or using the auto created tutorial breakpoint will cause the mcu to stop/pause (unless the breakpoint has "Continue Execution" enabled). When the mcu is paused there should be messages showing in the VS status bar and trace.

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