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


Posts: 9
Joined: Nov 7th, 2018
Debugging problems
Jan 3rd, 2019 at 4:40pm
Print Post  
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: 9
Joined: Nov 7th, 2018
Re: Debugging problems
Reply #1 - Jan 3rd, 2019 at 5:01pm
Print Post  
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: 9
Joined: Nov 7th, 2018
Re: Debugging problems
Reply #2 - Jan 4th, 2019 at 10:38am
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging problems
Reply #3 - Jan 4th, 2019 at 1:26pm
Print Post  
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: 9
Joined: Nov 7th, 2018
Re: Debugging problems
Reply #4 - Jan 5th, 2019 at 8:34am
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging problems
Reply #5 - Jan 5th, 2019 at 5:38pm
Print Post  
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
« Last Edit: Jan 5th, 2019 at 5:46pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint