Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Lost trying to get debugging working with Atmel Studio 7 and Visual Micro (Read 217 times)
RLCook
Junior Member
**
Offline



Posts: 11
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #14 - Jul 10th, 2017 at 7:02pm
 
Visual Micro wrote on Jul 10th, 2017 at 6:18pm:
Thanks, it might be related to optimization. The optimization setting is specified in the arduino build instructions for the selected hardware but can be overridden either as a compiler switch or in parts of the code.

What was the size of the atmel studio project after build?



Which build are you asking about? The Test2 build is just 4k bytes.

My original project build is just 3600 bytes.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7841
United Kingdom
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #13 - Jul 10th, 2017 at 6:18pm
 
Thanks, it might be related to optimization. The optimization setting is specified in the arduino build instructions for the selected hardware but can be overridden either as a compiler switch or in parts of the code.

What was the size of the atmel studio project after build?

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



Posts: 11
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #12 - Jul 10th, 2017 at 2:38pm
 
Visual Micro wrote on Jul 10th, 2017 at 2:12pm:
Thanks, I'll take a look over the next week. Hopefully the arduino convert gives you what you need for now.

One last question is to try debug with visual micro then stop it, switch the output window to Micro Build and copy/paste post the output.

Thanks



Output in attached file. It was too large to post.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7841
United Kingdom
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #11 - Jul 10th, 2017 at 2:12pm
 
Thanks, I'll take a look over the next week. Hopefully the arduino convert gives you what you need for now.

One last question is to try debug with visual micro then stop it, switch the output window to Micro Build and copy/paste post the output.

Thanks

Back to top
« Last Edit: Jul 10th, 2017 at 2:13pm by Visual Micro »  
WWW  
IP Logged
 
RLCook
Junior Member
**
Offline



Posts: 11
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #10 - Jul 10th, 2017 at 1:55pm
 
Visual Micro wrote on Jul 10th, 2017 at 1:44pm:
if you create a new atmel studio gcc app file>new>project without using arduino/visual micro. It can be with a very simple main. Does that upload and break into the main correctly?



Yes, it did. In fact I created an Arduino project and let Atmel Studio convert it to their project format and It worked as expected.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7841
United Kingdom
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #9 - Jul 10th, 2017 at 1:44pm
 
if you create a new atmel studio gcc app file>new>project without using arduino/visual micro. It can be with a very simple main. Does that upload and break into the main correctly?

Back to top
« Last Edit: Jul 10th, 2017 at 1:45pm by Visual Micro »  
WWW  
IP Logged
 
RLCook
Junior Member
**
Offline



Posts: 11
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #8 - Jul 10th, 2017 at 1:17pm
 
Visual Micro wrote on Jul 10th, 2017 at 12:52am:
Have you included the arduino.h in your project_name.cpp?


Yes I did.

I just sent you the entire project directory. There is not much to it.

Larry
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7841
United Kingdom
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #7 - Jul 10th, 2017 at 12:52am
 
Have you included the arduino.h in your project_name.cpp?
Back to top
 
WWW  
IP Logged
 
RLCook
Junior Member
**
Offline



Posts: 11
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #6 - Jul 9th, 2017 at 11:29pm
 
Visual Micro wrote on Jul 8th, 2017 at 12:49pm:
Please zip your .cppproj file and email to info[at]visualmicro.com

Thanks


The requested file is on its way. Good luck and thanks...
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7841
United Kingdom
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #5 - Jul 8th, 2017 at 12:49pm
 
Please zip your .cppproj file and email to info[at]visualmicro.com

Thanks
Back to top
 
WWW  
IP Logged
 
RLCook
Junior Member
**
Offline



Posts: 11
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #4 - Jul 7th, 2017 at 8:10pm
 
Visual Micro wrote on Jul 7th, 2017 at 7:32pm:
If you right click and view the atmel project properties what is the tool set to

If you put a breakpoint in setup or loop then upload does it break in known sources?

If you just click build do you see a visual micro build output?



Tool is set to Atmel-ICE Interface: JTAG

It does not break in known source. It always stops in a Disassembly tab after pressing "Start Debugging and Break". When I go look at a breakpoint in the cpp source and hover over it I get a message that reads: "The breakpoint will not currently be hit. Unable to set requested breakpoint on target...." and it is a white circle with Red border rather than a solid red circle. If I do a Break All the breakpoint doesn't change. It still shows the same as above. If I Stop Debugging then the breakpoint shows as solid red and I can set more if I want but they never break when I start debugging.

When I press Build I get an Output window that is labeled: "Show output from: Micro Build" and it looks just like the output from a VS2015 build with Visual Micro installed.
Back to top
« Last Edit: Jul 8th, 2017 at 4:39am by RLCook »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7841
United Kingdom
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #3 - Jul 7th, 2017 at 7:32pm
 
If you right click and view the atmel project properties what is the tool set to

If you put a breakpoint in setup or loop then upload does it break in known sources?

If you just click build do you see a visual micro build output?

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



Posts: 11
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #2 - Jul 7th, 2017 at 7:18pm
 
Visual Micro wrote on Jul 7th, 2017 at 7:15pm:
If you project is called "Foo" then you need a Foo.cpp and Foo.h not Project.cpp and Project.h





I know. The project is named Test2 and the files are Test2.ino, Test2.cpp and Test2.h.

I should have written the original post that way. My mistake...
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7841
United Kingdom
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #1 - Jul 7th, 2017 at 7:15pm
 
If you project is called "Foo" then you need a Foo.cpp and Foo.h not Project.cpp and Project.h



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



Posts: 11
Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Jul 7th, 2017 at 7:06pm
 
I just recently installed Atmel Studio 7 and added Visual Micro.

I have a custom Leonardo board with a JTAG connection tha I want to develop code for using the Arduino libraries.

I opened Studio 7 and created a new Visual Micro project. To do so, I selected Start->New Project. Then selected "VM Arduino Sketch". I gave it a name and location and proceeded. Ateml Studio created the project and then I got the "Visual Micro - Undo the changes Atmel 7.0 has made?" and selected YES.

I selected vMicro->Toggle Hidden Files.

I selected vMicro->Debugger->Atmel Studio Debugger

I selected vMicro->Uploader->Programmer->Atmel Studio Device Programming

I selected vMicro->Uploader->Always Use Programmer For Upload

I selected vMicro->Add Code->Add Empty Arduino .cpp and Header. Named them Project.cpp and Project.h. Copied setup() and loop() from Project.ino to Project.cpp.

Build Solution: Success.

In Project select Tool->Atmel-ICE->JTAG Interface

Select Debug->Start Debugging and Break. Device Programming window pops up. Select Atmel-ICE; ATmega32U4; JTAG; Apply. Select Memories->Program. Close the programming window.

Debugger loads and starts and I am shown a "Disassembly" tab pointing to address 00000000 (I assume the vector table). Hit Continue. If I Break All it appears to stop running but I cannot set breakpoints anywhere in my source. It acts like it has no idea how the source relates to what was programmed.

What have I done wrong or forgotten to do?
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print