Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Limited Debugging Options (Read 483 times)
Phillip A. Gonzales
Junior Member
**
Offline



Posts: 18
Limited Debugging Options
Jun 25th, 2019 at 8:55pm
 
I am able to use the debugging options laid out in the VM tuts (conditions, actions).

However, when trying to step through a loop I receive the following error message and then it breaks out of the what I am assuming is the VM debugging session.

Back to top
 

Debuggin.PNG (14 KB | 1 )
Debuggin.PNG
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10467
United Kingdom
Re: Limited Debugging Options
Reply #1 - Jun 26th, 2019 at 2:35am
 
We will do some testing. The software debugger does stop debugging when click the step because it can't step. It is possible that in the last release there is some confusion with the intercept of the step.
Back to top
 
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline



Posts: 18
Re: Limited Debugging Options
Reply #2 - Jun 27th, 2019 at 8:39pm
 
Here is what I am seeing/doing on my end.
https://imgur.com/a/PYJ5MNN

I was able to get the debugging to work, however, please let me know if I am doing something incorrectly. Or if there is another way to step through loops to see how the code is jumping to the cpp files and back to the .ino file.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10467
United Kingdom
Re: Limited Debugging Options
Reply #3 - Jun 27th, 2019 at 9:29pm
 
Great. That looks like an optimization problem. You can switch off optimization in a few ways. Optimization can increase program size, therefore there are various ways to disable the default which is probably -Os

1)

Right click the project name in the solution explorer and add an "extra flags (configuration)" of "-O0"

or

2)

In recent builds you can "Right click the project name in the solution explorer" and set "disable optimization project, libraries and/or core". This latter option has not been tested in atmel studio yet.

or

3)

You can just switch off optimization for a single code file or code part.

//code to switch off optimization
//
   Code (C++):
  pragma GCC push_options
     pragma GCC optimize ("O0")
  



//code to revert optimization to the standard setting for the hardware
//

Code (C++):
       pragma GCC pop_options
 


Back to top
 
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline



Posts: 18
Re: Limited Debugging Options
Reply #4 - Jun 28th, 2019 at 2:16pm
 
Even with the optimization off, I am still not able to "step into" any loops.
Back to top
 

Still-No-Do.PNG (136 KB | 0 )
Still-No-Do.PNG
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10467
United Kingdom
Re: Limited Debugging Options
Reply #5 - Jun 28th, 2019 at 2:36pm
 
Let's check the build output. please follow the yellow guide at the top of this page. Click build>Clean then click debug Start. After that in the "Micro Build Output" window we will see your full build config. Please attach at .txt


Thanks

Back to top
 
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline



Posts: 18
Re: Limited Debugging Options
Reply #6 - Jun 28th, 2019 at 3:48pm
 
I have attached the requested file. Please let me know if you need anything else.
Back to top
 

Build_6_28_19.txt (53 KB | 4 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10467
United Kingdom
Re: Limited Debugging Options
Reply #7 - Jun 28th, 2019 at 4:01pm
 
Great that explains a few things. You need to switch on "vMicro>Debugger>Use Atmel Studio Debugging". The Debug>Start will launch hardware debug instead of Serial debug and the compile will be for hardware debug too.

The F5 key then steps, the F9 key toggles a break-point. These are standard atmel short cuts and can be seen on the debug menu. With atmel debugging enabled the "Attach to process" and other functions will work better.

The optimization will also be more flexible, the serial debugger will certainly clash and I guess it appeared after upload and you closed it then attempted to start atmel debugging manually?

Does any of this make sense?

Back to top
« Last Edit: Jun 28th, 2019 at 4:49pm by Visual Micro »  
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline



Posts: 18
Re: Limited Debugging Options
Reply #8 - Jun 28th, 2019 at 4:13pm
 
Yes! Grin Cheesy, thank you. This is exactly what I am looking for thank you for all of your help.

I have one last question.
I am having difficulty understanding where VM starts and ends with AS7. From what I do understand VM is handling the board profile and pinouts on the Adafruit Metro M4 Express. As well as utilizing the breakpoints functionality. Is that correct?
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10467
United Kingdom
Re: Limited Debugging Options
Reply #9 - Jun 28th, 2019 at 4:48pm
 
Great, Now that you have atmel debugging enabled visual micro has nothing to do with breakpoints. After the debug launches that is 100% atmel studio.

Visual Micro is creating the build, same as the arduino ide but with an extra debug flag -g and also whatever optimization or extra settings you apply yourself. Atmel knows nothing about the build process except that we tell it where the resulting .elf program file is. It then uses the .elf to establish a debug session.

Visual Micro is performing the upload unless you have enabled "vMicro>Uploader>Use atmel studio device programming" in which case Visual Micro just tells atmel the location of the resulting program file (.elf/.hex) and then let's atmel do whatever it would normally do for the processor that is selected.

When you select an arduino board visual micro tells the atmel studio project which mcu is being used which it needs to know for intellisense, upload and/or debug.

The atmel studio intellisense is provided by the VisualAssistX plugin that is included free with atmel studio. Visual Micro simply ensures that the intellisense knows the mcu, include paths and pre-processor definitions based on the selected arduino board.

The visual micro web site and docs are worth a read. The home page has a link to the Atmel Studio 7 page which explains in red everything that you encountered.
https://www.visualmicro.com/page/Arduino-for-Atmel-Studio-7.aspx
Back to top
« Last Edit: Jun 28th, 2019 at 4:53pm by Visual Micro »  
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline



Posts: 18
Re: Limited Debugging Options
Reply #10 - Jun 28th, 2019 at 5:24pm
 
Thank you for the clarification.

I could not thank you enough for all your time and patience.

I have been reading the VM docs, it must have been later in the day when I got to that page you linked.

I will definitely be purchasing VM here shortly.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10467
United Kingdom
Re: Limited Debugging Options
Reply #11 - Jun 28th, 2019 at 8:43pm
 
Thank you
Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print