VS Arduino
Visual Micro >> Installation & Troubleshooting >> How to step debug blink?
https://www.visualmicro.com/forums/YaBB.pl?num=1599750875

Message started by bk13 on Sep 10th, 2020 at 3:14pm

Title: How to step debug blink?
Post by bk13 on Sep 10th, 2020 at 3:14pm
Windows 10, Visual Studio 2017, Arduino DUE
Cannot get started.  Created a new project and added only code to blink the on board light.  It does not blink.
Changed to debug mode, set a breakpoint, it will not step through the code.
There are too many things to describe.  What might I tell you that might help diagnose the problem?

get_started.JPG ( 95 KB | 8 Downloads )

Title: Re: How to setp debug blink?
Post by Visual Micro on Sep 10th, 2020 at 4:08pm
Hi

The usb debugger only supports stepping from breakpoint to breakpoint.

You need to use the hardware debug options to step the code.

It is always useful to post the info requested in yellow above.

I don't think ! workds for the Due toolchain use 0 or 1 or HIGH/LOW.

Title: Re: How to setp debug blink?
Post by bk13 on Sep 10th, 2020 at 10:35pm
Re: … only supports break point to break point.
Ok, changed that toolbar field to be Debug:Hardware, and understand that I may not be able to step through the code.
Re: I don't think ! workds for the Due toolchain use 0 or 1 or HIGH/LOW.
Ok Changed light flash code to:
[CODE]
if( current_time - light_time >= 500 )
{
      light_time = current_time;
//      light_on = !light_on;
      if (light_on == true)
         light_on = false;
      else
         light_on = true;

      digitalWrite(LED_BUILTIN, light_on);
   };
[/CODE]
Set breakpoint at the if statement.  In the debut dialog, Actions is checked and Continue execution is not checked. Build, then F5, Start debugging.
Output windows shows that VS does the upload and ends with CPU reset. 
Then, …, nothing.
Press F10 to Step
Output window clears, proclaims it is compiling, and proceeds to upload the code.
That is not expected.
Press F11 to step, exactly the same results.
Turn off debugging and try to run.  Light does not blink.  F10 causes a project rebuild and download.
I suspect that there is a setup problem.  I am certain that these symptoms are not make good sense to me.

Title: Re: How to setp debug blink?
Post by Visual Micro on Sep 11th, 2020 at 12:33pm
If you have changed your config to hardware debug then you need to post the info requested in yellow above again.

I can assure you that hardware debug allows step with the correct config and that the led on the board blinks with the correct code :)

Title: Re: How to setp debug blink?
Post by bk13 on Sep 11th, 2020 at 7:52pm
I do not see anything highlighted in yellow above.  Arduino Genuino was started and a minimum blink program was implemented. It builds, downloads, and runs.  The light does blink. 
Start a new minimal project in VS. Copy all the code to the new VS project. It compiles and downloads, but the light does not blink.  There is something wrong in my setup.

There is an error message in Variable Explorer that might be significant.  I don't know how to coerce VS to provide additional details.
variable_explorer.JPG ( 24 KB | 3 Downloads )
minimal_1.JPG ( 76 KB | 3 Downloads )

Title: Re: How to setp debug blink?
Post by Visual Micro on Sep 11th, 2020 at 8:12pm
The variable explorer is part of hardware debugging so you can close the window and ignore it.

It looks like you have all debugging switched off which is good, we wouldn't confuse things with debugging for such a basic issue such as failing to blink.

Can you please email your sketch from arduino ide and the one from visual studio.

I have also attached an image of the yellow box from above in case it is different color for you.

Thanks




forum_yellow_box.png ( 8 KB | 4 Downloads )

Title: Re: How to setp debug blink?
Post by bk13 on Sep 17th, 2020 at 8:51pm
I sent the email suggested along with the attachments.  There has been no reply.

I ask for any reader to please send me working solution of a minimal project for an Arduino to see if that will work on my computer.  In the list of allowed file types sln is not present.  Maybe zip it up and post. 

Title: Re: How to step debug blink?
Post by Visual Micro on Sep 17th, 2020 at 9:37pm
Hi

We can't see any email from you.

A working project is obtained using "File>New>Arduino Project" or "File>New>Project>C++\Arduino Empty Project".

The code should be exactly same as Arduino IDE therefore there is some confusion and we need to see the requested config.

Thanks

Title: Re: How to step debug blink?
Post by bk13 on Sep 19th, 2020 at 6:45pm
I clicked on the link: Click here to Email us, and sent an email to 'sales@visualmicro.com'  That is what came up for me.  Now when I click it wants to create a new account. 
Rather putting a link to click and do something, maybe just the email.
Where should I send the email?
you can send to me at  b1 the two letters, that special symbol, followed by m  then b then kelly then dot net. 

Title: Re: How to step debug blink?
Post by Visual Micro on Sep 19th, 2020 at 7:05pm
I have your email now thanks. There are two properties you need to enable as shown left side of the yellow box. You missed the "Verbose" ons so we can see the build commands.

Enabled vMicro > Compiler > Show Build Properties and Verbose

Please resend the visual micro build output after clicking compile.

The code isn't required thanks.

Title: Re: How to step debug blink?
Post by Visual Micro on Sep 21st, 2020 at 9:12pm
We have looked at this again. We think you are on an older version of Visual Micro which had an issue with ICE upload to the board you are using. Please update Visual Micro to the latest release and I am sure it will all work as expected.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.