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
Debugging problems (Read 839 times)
greebstreebling
Newbies
*
Offline



Posts: 7
Debugging problems
Jan 3rd, 2019 at 4:40pm
 
Hi I have just started using the Vm debug tools in Atmel Studio 7 and I am doing some simple things (having read the VM tutorials). There are two problems:

When I upload the Arduino sketch (with the breakpoints active), sometimes the output window says 'Launching debugger....' and just stops there, it doesn't show the BP text. I tried disabling the BP but this didn't help.

The other problem is that the serial monitor window is showing unexpected characters such as VMDPE + other graphic characters.

My program is not very demanding of the serial port, it's a driver for a stepper motor which receives commands from a main program, so serial traffic is confined to commands such as 'SA220.00#' which would result in an 'OK#' response - very little serial traffic.


I ensured VM was setup as in the tutorial.

Any thoughts appreciated.
Paul


Back to top
 
 
IP Logged
 
greebstreebling
Newbies
*
Offline



Posts: 7
Re: Debugging problems
Reply #1 - Jan 3rd, 2019 at 5:01pm
 
It looks like the serial port locks up after I send the initial command using the serial monitor. The contents of two of the variables I asked for in the BP are displayed once only, then the output window ceases to scroll too.
Thanks for any help,
Paul
Back to top
 
 
IP Logged
 
greebstreebling
Newbies
*
Offline



Posts: 7
Re: Debugging problems
Reply #2 - Jan 4th, 2019 at 10:38am
 
I learnt from this post:

http://electronics4dogs.blogspot.com/2014/12/debugger-for-arduino-visual-micro.h...

which is quite informative, that the VMDPE messages are part of Visual Micro's breakpoint operations, so at least I know the origin, but should I be expecting these messages? The tutorial does not mention them and they make my serial comms very messy. Is there anything I can do to clean things up?

I still haven't got breakpoints to work reliably in my code, but I'll keep trying.

thanks for any help.
Paul
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10573
United Kingdom
Re: Debugging problems
Reply #3 - Jan 4th, 2019 at 1:26pm
 
You should not need to be inspecting vm debug messages.

There are a few things to note.

1) When debug is ON, The serial send by your own code must be be terminated by a println() prior to Visual Micro sending it's own serial packets.

2) If the setup() method of your chip is called very quickly (starts quickly) there is possibility that the initial "debug hello" packet will be missed by the pc because they arrive before the serial monitor can open/start. This is not an issue but breakpoints and trace points in setup() can also be missed for this reason.

3) Sharing a serial port between debugger and your own code can be problematic if your own code does not send println() type terminator and also if your own code reads the serial port. In this case debug supports an alternative serial port if your hardware does or support a SoftwareSerial type of connection on one or two digital pins.


Back to top
 
WWW  
IP Logged
 
greebstreebling
Newbies
*
Offline



Posts: 7
Re: Debugging problems
Reply #4 - Jan 5th, 2019 at 8:34am
 
ok thanks for the reply Tim, I can work around what you've said and  have made some progress myself. If I used a Teensy microcontroller, presumably I could use one of its two USB ports for debugging?

In the little time I've used visual studio debug tools, I can see they're really useful aids.
Thanks
Paul
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10573
United Kingdom
Re: Debugging problems
Reply #5 - Jan 5th, 2019 at 5:38pm
 
Great thanks.

Yes you can either use another serial port for the visual micro debugger or use a usb>serial cable along with a couple of spare digital pins. To use a different serial port you set vMicro>Debugger> "Local Port" to the other COM port and "Remote Port" to Serial2 or other valid port name.

Docs here

Debugging-With-Different-Ports
Back to top
« Last Edit: Jan 5th, 2019 at 5:46pm by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print