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 Instruction Stepping (Read 4165 times)
JohnB
Junior Member
**
Offline


Posts: 14
Joined: Jun 1st, 2013
Instruction Stepping
Jun 1st, 2013 at 6:11pm
Print Post  
I am new to Visual Studio 6.1, Arduino and Visual Micro.  Lots of experience with SiLabs and Microchip IDE & debuggers.

I have installed Visual Studio 6.1 along with the recommend patch and Visual Micro along with a purchased copy of the debugger.  I also have Arduino 1.0.3 installed.

I am trying to debug an Arduino sketch on a Leonardo design.

I am able to compile the sketch, download to the Leonardo and set breakpoints.  If I use breakpoints with just message prints all is well.

If I un-check "continue" so that I can do some debug at that point the debug halts as it should.  The problem I have is that if I attempt to Step Into the sketch starts running again.

I was expecting that it would just step one instructions (either one "C" statement or one assembler statement).  

Should I be able to instruction step and see the stop advance through my code?  If so, any recommendations for things to check.

I also have not figured out how to display a Watch window for my variables, but I think that is a Visual Studio issue, not a Visual Micro issue.

All suggestions welcome.

I have also attempted to use a Dragon setup as JTAG with the same results so all of my problems might be with Visual Studio or my lack of understanding of it's usage.

Thanks in advance,
John Cry
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Instruction Stepping
Reply #1 - Jun 1st, 2013 at 7:45pm
Print Post  
Hi,

There is a youtube video on the debugger overview page that shows some basic features of the debugger. I suggest you skip the first minute or two which is for novices and take a look at the rest.

There are a number of user submitted youtube videos showing the debugger, one is here and Dennis Hill has a growing channel of various Visual Micro videos on youtube.

I hope to create a combined single "How do I" help document with the money generated from sales of the debugger, however the documents above will give you a basic overview of how the usb/serial debugger works.   

A USB debugger is different to a hardware debugger and uses a usb cable, does not use anything like JTAG.

You have obviously setup the debug to work correctly if you have breakpoint trace.

Although the page above, the youtube video and the wiki gives information I will attempt to bullet a few points here.

This serial debugger has to compile with your watch expressions pre-defined. You will see that you do that using the "When Hit" message. Enter a combination of "text and {expressions}" or just text or just {expressions}. The expressions will show in a watch window that automatically opens when debug starts. There are various output windows that show either just the trace you already see or a combination of trace and "when hit" text messages, or just the messages. 

Expression Watch and/or Text Message Examples

Code
Select All
Hi, this is my first breakpoint message. Millis={millis()} 



or just watch expressions

Code
Select All
{millis()}{i}{i*100} 



If you want to be able to change the value of a variable when the arduino is running then suffix the name with "?="

Code
Select All
{millis()}{i}{myVar=?} 



Break/Pause

You will read that break/pause is off by default. This is to prevent new users from crashing robots when the Arduino stops at a breakpoint Smiley

Set the project property "Break/Pause=True" to stop at a BreakPoint and allow F5, or any of the "start" menu/tool bar items to Continue/Step to the next breakpoint.

Stepping between breakpoints is all that this debugger can do, it can not step every line of code.

Ensuring the Arduino runs at full speed

If you are using Break/Pause the following might not be relevant

The use of BreakPoint "Conditions" and/or the BreakPoint "Hit Count" property is recommended. 

By default the "When Hit" is set to millis() so a value of 250 would cause the breakpoint to fire every 250 milliseconds (4 times per second)

The Condition property can include any expression or variable and will ensure a BreakPoint is only executed when the value of the expression has changed, or evaluates to tru/false etc. Useful for exception reporting.

NB: If neither of these two features are used breakpoint trace messages will be forced to no more than 12 per second and the arduino will pause if required to ensure this throttling/smoothing occurs. As with every Visual Micro feature, the "Throttle" can be disabled but it is recommended that the "conditions" and the "when hit" features are used instead.
« Last Edit: Jun 2nd, 2013 at 8:20am by Tim@Visual Micro »  
Back to top
IP Logged
 
JohnB
Junior Member
**
Offline


Posts: 14
Joined: Jun 1st, 2013
Re: Instruction Stepping
Reply #2 - Jun 2nd, 2013 at 4:27pm
Print Post  
Tim, thank you for the reply.  Now I understand why I could not step of view variables.

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