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 Debug doesn't work (Read 3284 times)
cybermec
Junior Member
**
Offline


Posts: 19
Joined: Jun 3rd, 2013
Debug doesn't work
Nov 13th, 2013 at 10:27pm
Print Post  
Hello,
It seems Debugger doesn't work well for me these days.
My setup starts with:

void setup()
{
     int res = MSG_OK;
     ConfigureCommands();


I put a Trace point on the ConfigureCommands() line which just initialize an array of pointers. The trace point contains this text:

SETUP - {res}

When running I get the following:

Port open

VMDP?_5|1_VMDPE


My trace point is not displayed but this strange message.
Worst, at the end of my setup function I have these lines:

     _courbeInProgress = false;
     _mesuresDemandees = false;
}


I put another Trace point on the last line with the following text:

ECHO 2 - {_mesuresDemandees}

Now the Trace point is displayed correctly, and the variable is managed by Expression monitor.
However it behaves strangely. During the setup I'm sending several messages to the Serial port. My last 2 messages are displayed after that Trace point.

Also, no one of the Trace points of the loop function display something.

I don't know what to do.
I need help please.  Sad
« Last Edit: Nov 13th, 2013 at 10:30pm by cybermec »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debug doesn't work
Reply #1 - Nov 14th, 2013 at 8:33pm
Print Post  
Hi,

The arduino serial buffer can overflow if you put breakpoints on or next to your own Serial print commands. If the serial buffer overflows then characters are dropped between the arduino and the pc.

Visual Micro uses a fixes set of serial characters at the start and end of each packet of data outputted by the debugger. If these are the characters that get dropped by the overflow then the serial window will show the data you have described.

If you are using the serial port and find the combination of visual micro debug and your own serial overfloads the serial port then an alternative is to use an FTDI cable with an alternate arduino hardware serial port if available. (see the project properties 'Remote' and 'Local' Port/Transport options)

If no additional hardware serial is available then you can use most digital pins (1 pin is required for trace and 2 for trace/break/modify vars)

I hope this makes sense and that I have understood correctly that the debugger is sharing the main arduino serial port with a program that also uses the Serial port. 

In summary, normally, this problem is avoided by putting breakpoints on code that does not perform serial.print. Otherwise using a 2nd dedicated serial port for debug is recommended.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint