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) Limited Debugging Options (Read 3542 times)
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Limited Debugging Options
Jun 25th, 2019 at 7:55pm
Print Post  
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. 

  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Limited Debugging Options
Reply #1 - Jun 26th, 2019 at 1:35am
Print Post  
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
Joined: Jun 19th, 2019
Re: Limited Debugging Options
Reply #2 - Jun 27th, 2019 at 7:39pm
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Limited Debugging Options
Reply #3 - Jun 27th, 2019 at 8:29pm
Print Post  
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++)
Select All
  pragma GCC push_options
     pragma GCC optimize ("O0")
  



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

Code (C++)
Select All
       pragma GCC pop_options
 


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


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

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Limited Debugging Options
Reply #5 - Jun 28th, 2019 at 1:36pm
Print Post  
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
Joined: Jun 19th, 2019
Re: Limited Debugging Options
Reply #6 - Jun 28th, 2019 at 2:48pm
Print Post  
I have attached the requested file. Please let me know if you need anything else.
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Limited Debugging Options
Reply #7 - Jun 28th, 2019 at 3:01pm
Print Post  
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?

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


Posts: 18
Joined: Jun 19th, 2019
Re: Limited Debugging Options
Reply #8 - Jun 28th, 2019 at 3:13pm
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Limited Debugging Options
Reply #9 - Jun 28th, 2019 at 3:48pm
Print Post  
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
« Last Edit: Jun 28th, 2019 at 3:53pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Re: Limited Debugging Options
Reply #10 - Jun 28th, 2019 at 4:24pm
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Limited Debugging Options
Reply #11 - Jun 28th, 2019 at 7:43pm
Print Post  
Thank you
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint