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) Debugger/ breakpoints not working (Read 11724 times)
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Debugger/ breakpoints not working
Dec 7th, 2016 at 2:25pm
Print Post  
Even after I watched so many video tutorials and read amount of forum posts in the web about this issue I got no solution for this.

I've got the full license of visual micro on visual studio 2015 community. 

I want to debug a example sketch on Genuino 101 Arduino 1.6. 


Compiling debug version of 'BlinkWithoutDelay' for 'Arduino/Genuino 101'
        1 file(s) copied.

Program size: 19,796 bytes (used 13% of a 155,648 byte maximum) (1.18 secs)
 
Uploading 'BlinkWithoutDelay' to 'Arduino/Genuino 101' using 'COM8'
Starting download script...
SUCCESS: Sketch will execute in about 5 seconds.
     The upload process has finished.


As you can see compiling and uploading works. 
But debugging is not possible.
Expression window only says "Waiting for debug breakpoint data". 

Even if I tried something like Serial.print("xyz") inside of the loop, nothing is shown in the Micro Debug Message or Micro Debug Trace window. 

Automatic debuggin is enabled. I also tried enable micro debug full. Local speed and remote speed are setted. 
Nothing seems to work for me.

Any ideas?

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #1 - Dec 7th, 2016 at 2:34pm
Print Post  
Hi,

Does normal Serial work without debug? (Switch toolbar to Release and try Serial)

Thanks
« Last Edit: Dec 7th, 2016 at 2:34pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Re: Debugger/ breakpoints not working
Reply #2 - Dec 7th, 2016 at 3:12pm
Print Post  
Hi,

Micro Build says:

Uploading 'BlinkWithoutDelay' to 'Arduino/Genuino 101' using 'COM8'
Starting download script...
Flashing is taking longer than expected
Try pressing MASTER_RESET button
     The upload process has finished.
SUCCESS: Sketch will execute in about 5 seconds.


serial is just showing this in release mode:
Port closed
Opening port
Port open
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #3 - Dec 7th, 2016 at 3:28pm
Print Post  
If I recall your 101 has two serial ports. The main port works slightly differently to a normal Arduino serial port so try this code but make sure the toolbar is set to Release and not Debug so we are not confused with debug until you know your board.
Code
Select All
void setup()
{
 while (!Serial) {}

 Serial.begin(115200);

}

void loop()
{
  Serial.println("Hello world");
} 

  
Back to top
WWW  
IP Logged
 
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Re: Debugger/ breakpoints not working
Reply #4 - Dec 7th, 2016 at 3:35pm
Print Post  
I tried it.
Seems that it's not working as you can see in the screenshot.
Did I forgot anything else? Undecided
« Last Edit: Dec 7th, 2016 at 3:37pm by sayo »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #5 - Dec 7th, 2016 at 3:41pm
Print Post  
Please try this

Code
Select All
void setup()
{

 Serial1.begin(115200);

}

void loop()
{
  Serial1.println("Hello world");
}  

  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #6 - Dec 7th, 2016 at 3:44pm
Print Post  
By the way one other  thing to check when using Serial (not Serial1 as per last example)

After the serial window opens click the Connect button to disconnect then click it again to connect. I read the 101 takes 10 seconds to startup.
  
Back to top
WWW  
IP Logged
 
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Re: Debugger/ breakpoints not working
Reply #7 - Dec 7th, 2016 at 3:46pm
Print Post  
Now I got the follow in the serial monitor

Port closed
Uploading to I/O board
Opening port
Port open
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #8 - Dec 7th, 2016 at 4:03pm
Print Post  
That is the same message.

1)
Go back to the Serial code I gave you. Not Serial1

Upload the Serial code

On the serial monitor there are some hidden buttons. Make the window wider so you can seer the buttons. Click "Auto-Recon" then click Connect twice.

2)

Open the arduino ide and try the same with their serial monitor.

  
Back to top
WWW  
IP Logged
 
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Re: Debugger/ breakpoints not working
Reply #9 - Dec 7th, 2016 at 4:15pm
Print Post  
1)

Port closed
Opening port
Port open

Port closed


2) 

arduino ide prints the hello world like charm

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #10 - Dec 7th, 2016 at 4:32pm
Print Post  
Okay sorry I just looked at your monitor screen image. You have the speed set to 9600 but the code has 115200 Smiley
  
Back to top
WWW  
IP Logged
 
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Re: Debugger/ breakpoints not working
Reply #11 - Dec 7th, 2016 at 4:37pm
Print Post  
Oh, sorry for that.
I tested it with 115200 now, but's the same result: no output.   Undecided

I tried setting the speed a few times before, but it didn't fix the issue...
  
Back to top
 
IP Logged
 
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Re: Debugger/ breakpoints not working
Reply #12 - Dec 7th, 2016 at 4:38pm
Print Post  
I also tried it with another device - the Bluno. 
But the result was the same. 
It's always just saying "Waiting for debug breakpoint data"...  Undecided
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #13 - Dec 7th, 2016 at 4:46pm
Print Post  
Send screen shot of serial window with debug enabled
« Last Edit: Dec 7th, 2016 at 9:21pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Re: Debugger/ breakpoints not working
Reply #14 - Dec 7th, 2016 at 4:51pm
Print Post  
Sorry?

Here's the screenshot:

http://imgur.com/a/49RuR
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #15 - Dec 7th, 2016 at 9:24pm
Print Post  
Sorry my phone produces garbage messages Smiley

The Arduino IDE (and visual micro) has the Dtr option enabled by default. 

Try clicking Dtr so it is switched on. It's important for some (most) boards to have the Dtr enabled.

« Last Edit: Dec 7th, 2016 at 9:30pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #16 - Dec 8th, 2016 at 2:16am
Print Post  
Hi again,

Sorry for the confusion. 

I've done some testing and found that whilst the Dtr property on the serial monitor is certainly important the debugger should also have been ensuring in background that Dtr was on. A bug in the last couple of builds prevented your Serial Monitor Dtr button from being monitored properly.

There is a new release of visual micro (1612.7.1) that should remove some of the confusion you have encountered.

Read more if interested but switching on Dtr and using the latest update will hopefully solve all issues.

....

You would have hit two problems each with identical result.

1) In both debug and release mode, no Dtr will often mean no serial the board starts before the pc is ready. The Dtr causes the board to reset when the pc opens the serial.

2) In debug mode. Without Dtr, the board will have started and the demo breakpoint hit before the pc debug/serial has started. In that case the arduino is normally showing a message and waiting for F5/Continue instruction from you. This shouldn't happen often because visual micro forces the dtr forcing the board to reset when debug starts. (That's unless you switch the option off) 

In cases where the arduino has hit a breakpoint before debug starts entering the letter 'c' into the serial monitor text box and clicking the send button will bring the debug/arduino to life.

After switching between release an debug, an upload is required before the changes take effect.

Thanks for the post!
  
Back to top
WWW  
IP Logged
 
sayo
Junior Member
**
Offline


Posts: 12
Joined: Dec 7th, 2016
Re: Debugger/ breakpoints not working
Reply #17 - Dec 8th, 2016 at 10:41am
Print Post  
Hi, 
thank you very much!
Now it works like charm for the 101 and the Bluno!
It's a great tool and I'm glad that I can use it now.
It will speed up my development a lot.  Smiley

Finally I got one more question:
As I know the bluno uses the serial for the bluetooth communication. 
Can this be a problem if I'm using visual micro?
If I'm using breakpoints does visual micro sending anything via the serial so that the bluetooth communication can be disturbed?
If yes is there any possibility in the settings to avoid this?

Thank you very much.
You helped me a lot!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugger/ breakpoints not working
Reply #18 - Dec 8th, 2016 at 2:27pm
Print Post  
Great news and thanks for the update.

The debugger will send using serial so you are right it needs some consideration.

You can configure the debugger to use an alternative serial port or you can use the softwareSerial option which requires 1 pin for trace mode and 2 pins for trace/break. See this doc for how to configure. http://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-With-Different-Por...

To be clear. If you only want debug trace then serial is sent from the mcu to the pc. If you also want to be able to break or update variable values while debugging then serial also needs to be sent from pc to mcu.

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