Visual Studio Ide for Arduino
https://www.visualmicro.com/forums/YaBB.pl
Visual Micro >> Usb/Serial/Udp Debugging >> Atmel Debugger with Arduino
https://www.visualmicro.com/forums/YaBB.pl?num=1562450322

Message started by Chuck95 on Jul 6th, 2019 at 10:58pm

Title: Atmel Debugger with Arduino
Post by Chuck95 on Jul 6th, 2019 at 10:58pm
I am confused as to how to actually initiate debugging with the arduino in Atmel Studio. When I start debugging via the F5 key it forces me to choose the simulator tool and does not load anything on to the arduino. Any break points I place in my code are ignored.

Is there a way to select the arduino/USB interface as my programming option for debugging or do I have to use the micro project tool banner for debugging instead? I am using Version 7.0.1931 for Atmel Studio and Version 1905.29.0 for VisualMicro. I am using an arduino Mega Rev3 with the ATemga2560 chip.

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 6th, 2019 at 11:52pm
Please try this test

With an empty IDE, click File>New>Project>Arduino Sketch

Then follow the relevant parts of the guide in red on our atmel studio page to see if you can start atmel studio debugging.

+ It is optional to use standard usb or atmel studio for the actual upload. To use standard arduino usb upload ignore the point about selecting the "use atmel studio device programming" as the arduino programmer.

The main point is to ensure "vMicro>Debugger>Use atmel studio debugging" is enabled and that we are using an 8 bit project and not a 32 bit project.

Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 7th, 2019 at 6:00pm
How do I create a project_name.cpp that overrides the .ino file when using advanced mode for debugging? I tried adding a new .cpp item to the project but it gives me the following compiling errors:
recipe for target 'Sketch1.o' failed
=arduino.h: No such file or directory

When I do not include the .cpp file I get the following compiling errors:
recipe for target 'Sketch1.elf' failed
Id returned 1 exit status

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 6:04pm
Your would need to post the full output you see but that documentation is supposed to have been removed. You no longer need the sketch_name.cpp alongside an empty sketch_name.ino.

You can use one or more .ino files as normal for Arduino projects. Obviously other cpp files are ok too.

EDIT: By the way there is an update for visual micro in atmel studio 7 in the releases section of this forum.

Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 7th, 2019 at 6:33pm
I have updated my visual micro to the latest version via the VSIX installer (1906.12.0) and started a new project from scratch.

First it shows me this error (see attached error1.jpg). I click yes and then it gives me a regular .ino file with the blank setup and loop blocks. I make sure the 'Atmel Studio Debugger' is checked under vMicro tab and plug in my Mega.

I then click the debug button (F5) and it throws my the following compiler error with no other output (see error2.jpg).
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=error_001.zip (30 KB | 5 )

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 6:40pm
Hi,

The first Error is not an error. It is a prompt telling you that atmel studio has added files that are not valid for an arduino project and asking if you want them removed.

If you did not click yes to the first "Error" then you must remove the files manually. You need to ensure you delete them from the project folder not just remove them from the project.

The 2nd error can only be understood by following guide in yellow at the top of this page so that we can see the verbose build output and also your build properties. It's important to first confirm that compile upload is working using the vMicro menu and then see if the same works using "Debug>Start without debugging"


Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 7th, 2019 at 7:08pm
Here is the output with the proper compiler settings turned on (see attached).  The same errors were thrown when I tried "Start without debugging"; however, it was able to compile and upload to the mega via the "build and upload" button under the vMicro tab.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=output_036.txt (1 KB | 5 )

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 7:12pm
For some reason Visual Micro isn't trying to override the debug menu events. Therefore you see atmel trying to do a normal build which it won;t be able to do.

Please use the vMicro menu to compile and upload and then post the output with the settings shown in the yellow box above enabled.

Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 7th, 2019 at 7:17pm
Here is the output from the vMicro build.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=output_vMicro.txt (24 KB | 5 )

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 7:18pm
You could try clicking "build>configuration Manager" and un-checking the "Build" option for the project. This will prevent AS7 from trying to build and we might then see there is a more obvious error in the "Micro Build" output window.

Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 7th, 2019 at 7:22pm
The option was already un-checked when I opened the configuration manager.

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 7:26pm
Okay when you see the atmel error please use the drop down list above the output window to select "Micro Build" and then post the output you see, if any.

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 7:28pm
Ah I read what version you has installed. That's the gallery version. The one I mentioned is in the releases section of this forum. See the links in the RELEASE thread at the top of this list

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 7th, 2019 at 7:33pm
There is no output in Micro Build when atmel error appears after initiating debugging procedure.

EDIT: What does gallery version imply and which version should I use then? Do I just open the .VSIX file in Atmel studio?

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 7:45pm
It's all the same system. Microsoft have the .vsix format and they run their vsixinstaller.exe to install extensions.

The forum version is simply more up to date. It takes a while for atmel to press the publish button on new releases in the gallery so the forum can be more responsive.

You should run the vsix you downloaded from the forum. They are actually just zip files with .vsix extension :)

Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 7th, 2019 at 7:54pm
Ok so new version is downloaded and no more compiling errors! But now it is prompting me to select a programming tool and I just want to use the USB interface. How is this done?

EDIT: So now I am back to the same problem I was having before which is that it is prompting me to connect to a debugger/programmer and does not give me an option to use the USB interface.

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 9:46pm
Do you want to use atmel hardware debugging or the Visual Micro serial debugging? Do you have an atmel hardware debugger?

Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 7th, 2019 at 11:53pm
I do not have an external programmer so I would like to use whatever method allows me to use the USB programmer built in to the arduino.

Title: Re: Atmel Debugger with Arduino
Post by Visual Micro on Jul 7th, 2019 at 11:56pm
The default settings for visual micro provided usb debugging. You only had to switch the tool bar between release and debug to enable or disable the usb debugger.

Documentation index link is at the top of visualmicro.com

Atmel have their own debug system which as you have seen is more complex but in some ways more powerful.

Title: Re: Atmel Debugger with Arduino
Post by Chuck95 on Jul 8th, 2019 at 12:14am
Ok I have gotten it to debug properly now. Thank you for the help!

Visual Studio Ide for Arduino » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2019. All Rights Reserved.