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) Lost trying to get debugging working with Atmel Studio 7 and Visual Micro (Read 9137 times)
RLCook
Junior Member
**
Offline


Posts: 12
Joined: Apr 12th, 2017
Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Jul 7th, 2017 at 6:06pm
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #1 - Jul 7th, 2017 at 6:15pm
Print Post  
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: 12
Joined: Apr 12th, 2017
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #2 - Jul 7th, 2017 at 6:18pm
Print Post  
Tim@Visual Micro wrote on Jul 7th, 2017 at 6: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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #3 - Jul 7th, 2017 at 6:32pm
Print Post  
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: 12
Joined: Apr 12th, 2017
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #4 - Jul 7th, 2017 at 7:10pm
Print Post  
Tim@Visual Micro wrote on Jul 7th, 2017 at 6: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.
« Last Edit: Jul 8th, 2017 at 3:39am by RLCook »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #5 - Jul 8th, 2017 at 11:49am
Print Post  
Please zip your .cppproj file and email to info[at]visualmicro.com

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


Posts: 12
Joined: Apr 12th, 2017
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #6 - Jul 9th, 2017 at 10:29pm
Print Post  
Tim@Visual Micro wrote on Jul 8th, 2017 at 11:49am:
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #7 - Jul 9th, 2017 at 11:52pm
Print Post  
Have you included the arduino.h in your project_name.cpp?
  
Back to top
WWW  
IP Logged
 
RLCook
Junior Member
**
Offline


Posts: 12
Joined: Apr 12th, 2017
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #8 - Jul 10th, 2017 at 12:17pm
Print Post  
Tim@Visual Micro wrote on Jul 9th, 2017 at 11:52pm:
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #9 - Jul 10th, 2017 at 12:44pm
Print Post  
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?

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


Posts: 12
Joined: Apr 12th, 2017
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #10 - Jul 10th, 2017 at 12:55pm
Print Post  
Tim@Visual Micro wrote on Jul 10th, 2017 at 12: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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #11 - Jul 10th, 2017 at 1:12pm
Print Post  
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

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


Posts: 12
Joined: Apr 12th, 2017
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #12 - Jul 10th, 2017 at 1:38pm
Print Post  
Tim@Visual Micro wrote on Jul 10th, 2017 at 1: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.
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #13 - Jul 10th, 2017 at 5:18pm
Print Post  
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: 12
Joined: Apr 12th, 2017
Re: Lost trying to get debugging working with Atmel Studio 7 and Visual Micro
Reply #14 - Jul 10th, 2017 at 6:02pm
Print Post  
Tim@Visual Micro wrote on Jul 10th, 2017 at 5: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
 
Page Index Toggle Pages: 1
Send TopicPrint