Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Atmel Debugger with Arduino (Read 760 times)
Chuck95
Junior Member
**
Offline



Posts: 10
Atmel Debugger with Arduino
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.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #1 - 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.
Back to top
« Last Edit: Jul 6th, 2019 at 11:53pm by Visual Micro »  
WWW  
IP Logged
 
Chuck95
Junior Member
**
Offline



Posts: 10
Re: Atmel Debugger with Arduino
Reply #2 - 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
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #3 - 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.
Back to top
« Last Edit: Jul 7th, 2019 at 6:05pm by Visual Micro »  
WWW  
IP Logged
 
Chuck95
Junior Member
**
Offline



Posts: 10
Re: Atmel Debugger with Arduino
Reply #4 - 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).
Back to top
 

error_001.zip (30 KB | 4 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #5 - 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"

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



Posts: 10
Re: Atmel Debugger with Arduino
Reply #6 - 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.
Back to top
 

output_036.txt (1 KB | 5 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #7 - 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.
Back to top
« Last Edit: Jul 7th, 2019 at 7:12pm by Visual Micro »  
WWW  
IP Logged
 
Chuck95
Junior Member
**
Offline



Posts: 10
Re: Atmel Debugger with Arduino
Reply #8 - Jul 7th, 2019 at 7:17pm
 
Here is the output from the vMicro build.
Back to top
 

output_vMicro.txt (24 KB | 4 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #9 - 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.
Back to top
 
WWW  
IP Logged
 
Chuck95
Junior Member
**
Offline



Posts: 10
Re: Atmel Debugger with Arduino
Reply #10 - Jul 7th, 2019 at 7:22pm
 
The option was already un-checked when I opened the configuration manager.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #11 - 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.
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #12 - 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
Back to top
 
WWW  
IP Logged
 
Chuck95
Junior Member
**
Offline



Posts: 10
Re: Atmel Debugger with Arduino
Reply #13 - 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?
Back to top
« Last Edit: Jul 7th, 2019 at 7:38pm by Chuck95 »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #14 - 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 Smiley
Back to top
 
WWW  
IP Logged
 
Chuck95
Junior Member
**
Offline



Posts: 10
Re: Atmel Debugger with Arduino
Reply #15 - 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.
Back to top
« Last Edit: Jul 7th, 2019 at 8:06pm by Chuck95 »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #16 - 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?
Back to top
« Last Edit: Jul 7th, 2019 at 9:47pm by Visual Micro »  
WWW  
IP Logged
 
Chuck95
Junior Member
**
Offline



Posts: 10
Re: Atmel Debugger with Arduino
Reply #17 - 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.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10459
United Kingdom
Re: Atmel Debugger with Arduino
Reply #18 - 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.
Back to top
« Last Edit: Jul 7th, 2019 at 11:57pm by Visual Micro »  
WWW  
IP Logged
 
Chuck95
Junior Member
**
Offline



Posts: 10
Re: Atmel Debugger with Arduino
Reply #19 - Jul 8th, 2019 at 12:14am
 
Ok I have gotten it to debug properly now. Thank you for the help!
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print