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) Strange behaviors in Visual Studio. (Read 2149 times)
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Strange behaviors in Visual Studio.
Feb 1st, 2021 at 8:40am
Print Post  
As I said in another post I am very demoralized, I cannot use Visual Micro with Microchip Studio or Visual Studio.

I have Windows 10 Pro. Here I want to speak about Visual Studio.

I can import an example from Arduino IDE, I can compile, apparently without errors, see attached file "compile 2feb2021.txt", in the subdir Debug there are many files, .elf .hex etc.

So i set one breakpoint at line 55 and press vMicro - Build - Upload. 
The file is uploaded true Atme-ICE on the board MKR WiFi1010.
The terminal window opens.
Now I was expecting, as in Atmel Studio, an arrow at line 55 indicating the position of the program.
No, only in the Output window is show: "EthernetHTTPS is paused at EthernetHTTPS.ino, line 55, setup()".

In the left corner of the windows of the source program I see an red icon with white X and the number 1 on the right, see attached image "error.jpg".
If I click on this icon in the error list are show 1714 Errors ??? But I have compiled ???

Ok, I proceed, now I am still stop at line 55 (without any indication on the screen about this).
The line 55 is: Ethernet.init(5);   // MKR ETH shield
I decide to go inside and I press Step Into (F11).
In the output windows is show: "EthernetHTTPS Running" and the program runs untill the end.
No step inside? No debugging? No step-by-step ?

what am I wrong?

Thank you
Livio
  

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


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Strange behaviors in Visual Studio.
Reply #1 - Feb 1st, 2021 at 9:11am
Print Post  
If I remember well, when I used Atmel Studio, during the upload with Atmel-ICE some led on the box flash.

Now nothing flash on the box.

I think the Atmel-ICE is enabled, see attached image.
  

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


Posts: 2431
Joined: Feb 13th, 2019
Re: Strange behaviors in Visual Studio.
Reply #2 - Feb 1st, 2021 at 10:17am
Print Post  
Thanks for the report.

Using the Serial Debugger the line of code is highlighted (as shown in the second image), but step into is not supported with Serial Debugging.  All breakpoints and trace information and conditions have to be set before the sketch is uploaded to the board, as they are coded into the uploaded sketch.
https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-Explained.html

If using the GDB Hardware Debugging, breakpoints can be set at runtime, and step into also works as normal, but requires a Hardware Debugger e.g. Atmel ICE.
Doc:https://www.visualmicro.com/page/SAMD-Debugging.aspx

The differences between the Serial and GDB Debuggers is detailed here: https://www.visualmicro.com/page/User-Guide.aspx?doc=Arduino-gdb-Differences.htm...
  
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Strange behaviors in Visual Studio.
Reply #3 - Feb 1st, 2021 at 10:38pm
Print Post  
Hi
I have some problems with the page: https://www.visualmicro.com/page/SAMD-Debugging.aspx the picture are different from my screen, probably a different version of software.

I have the Atmel-ICE connected from the SAM Port to the board MKRWiFi1010.

In VS I have two options: "Atmel-ICE" and "Atmel ICE over OpenOCD(vMicro)" I try both and nothing change.

Here you can find a screenshot to check if you see something wrong.

Thank you
Livio
  

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


Posts: 2431
Joined: Feb 13th, 2019
Re: Strange behaviors in Visual Studio.
Reply #4 - Feb 4th, 2021 at 11:41am
Print Post  
Thanks for the information.

The Debugger menu is missing two more entries at the top to select the debugger type, and model if Hardware.

Is this the same if you create a new Project in Visual Micro?

Can you confirm the Visual Micro Version installed from the Extensions > Manage Extensions > Installed screen?
  
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Strange behaviors in Visual Studio.
Reply #5 - Feb 4th, 2021 at 3:29pm
Print Post  
I have disinstalled Visual Studio and start again from the beginning.

During all the following operations Atmel-ICE is connected via USB to the PC and via JTAG to the board MKRWiFi1010 which is connected to the same PC to another usb port, so is powered on.

Arduino IDE is already installed, version 1.8.13 (the last)

I downloaded again Visual Studio and install with workloads checked only "Sviluppo di applicazioni desktop con C++" (is in italian, I can't dowload it in english, but I add the english pack).

I put the sketch, EthernetHTTPS.ino in a folder and compile with Arduino IDE without errors.

Open Visual Studio -  Extensions – Manage Extensions – Arduino IDE for Visual Studio (Visual Micro) Trial – Download

When I close Visual Studio, Visual Micro is installed.

I open again Visual Studio Without code - Extensions – vMicro – Open Existing Arduino Project – I select the file EthernetHTTPSfile .ino, is loaded without problems.

Now I have to do some selection on Visual Studio, I'm not sure if they are all the necessary ones:
- I select Atmel-ICE as debugger on the left.
- vMicro - Uploader - Hardware Programmer: Atmel-ICE
- vMicro - Debugger (see screenshot1)

VMicro - Build 

The program is compiled without errors, no more strange errors like the first post.
I set a breakpoint at line 55 clicking on the left, a red dot is displayed.
vMicro - Build & Upload
The program is uploaded and stop at breakpoint at line 55.

Now I close this post here, untill here all is ok, the problems are about debugging, next post.
  

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


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Strange behaviors in Visual Studio.
Reply #6 - Feb 4th, 2021 at 3:45pm
Print Post  
Quote:
The Debugger menu is missing two more entries at the top to select the debugger type, and model if Hardware.


I have selected the debugger in Optional: Hardware Programmer, see screenshot2.jpg, is not enough?

You can see the Debugger menu in screenshot3.jpg

Quote:
Is this the same if you create a new Project in Visual Micro?


If I create a new VM Arduino project, I can select Atmel-ICE as before, on the left, as you can see  in screensot4.jpg (sorry only 2 attachment? see next post)
  

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


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Strange behaviors in Visual Studio.
Reply #7 - Feb 4th, 2021 at 3:46pm
Print Post  
The missing attachment from the previous post.
  

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


Posts: 2431
Joined: Feb 13th, 2019
Re: Strange behaviors in Visual Studio.
Reply #8 - Feb 4th, 2021 at 4:14pm
Print Post  
Can you ensure that you have not switched off "vMicro > General > Global Options > GDB Enable". Please set it back to True which is the default.

Then restart Visual Studio, this will restore the menu options.

« Last Edit: Feb 4th, 2021 at 4:58pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Strange behaviors in Visual Studio.
Reply #9 - Feb 4th, 2021 at 4:59pm
Print Post  
Good to hear you sorted that. Moved your next questions to a new thread so that we can classify and read posts more easily.

Off-Topic replies have been moved to this Topic.

btw: When you are debugging the underlying core you might find some code comes from .a libraries and therefore there is no source code available for the debugger. Debugging you own code and most libraries should always work. Optimization can be an issue for gdb and some underlying library and core codes are not designed to run without optimization.

I suggest you test the debugger on known code to start with and then delve deeper. The Microsoft GDB system gets it right most of the time. If you have a problem then creating a new forum thread for each seperate issue will help us be more accurate with our answers.

« Last Edit: Feb 4th, 2021 at 5:11pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Strange behaviors in Visual Studio.
Reply #10 - Feb 4th, 2021 at 5:35pm
Print Post  
Sorry I didn't see your answer # 9 because I was writing answer # 10.
I delete answer #10 from here and I will post again in a new forum thread.

We consider this closed with a positive solution to import an Arduino project in Visual Studio / Visual Micro and compile without errors as in Arduino IDE.

Thanks for your patience.
Livio
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint