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
Normal Topic File>Open object file for debugging - Atmel Studio (Read 6401 times)
Henk Visser
Newbies
*
Offline


Posts: 2
Joined: Mar 12th, 2014
File>Open object file for debugging - Atmel Studio
Mar 12th, 2014 at 9:02pm
Print Post  
All,

I have a Arduino sketch that I would like pull directly into Atmel Studio 6 so that I can use the native debugging with my JTAGICE mkII. I want to be able to set break points, check registers and all the good stuff.

When I look at the folder that contains the files for the Arduino sketch here is what I have:

About 15 files that are C++ source code (*.cpp files)

About 36 header files (*.h)

There there is a single .ino file.

1.) Should I be able to create a new Atmel project, pull in all these files and compile? Anything I would be missing here? Most of all my projects have been pure C so I want to be sure I am not missing something wit the C++ files.

2.) I am not sure on how to handle the single .ino file. When I open this up in the text editor there are a few includes and some #ifdef 's.

If I am not able to do the native debugging with Visual Micro I wanted to see the best approached on pulling all the source in for now.

"After you have built the .elf using the Visual Micro Arduino compiler click "File>Open object file for debugging". This will create a new atmel solution that will allow normal Atmel "start with debugging" ".

I tried doing this but it seems Atmel Studio was not able to find a bunch of the files.

Thank you for your thoughts.



« Last Edit: Mar 12th, 2014 at 9:10pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12136
Location: United Kingdom
Joined: Apr 10th, 2010
Re: File>Open object file for debugging - Atmel Studio
Reply #1 - Mar 12th, 2014 at 9:23pm
Print Post  
Hi Henk,

Your good questions stand in their own right so I moved them into a new thread because the thread you used had a clear solution. I will remove the auto generated "off topic" message from the previous thread shortly because this was not off topic.

We are working on some easier solution to this. The native atmel debugger does not understand .ino files so, for now, you have to use "open object file for debugging"

Our next step with this development is to automatically "open the object file for debugging" and to automatically ensure all the source code can be found easily.

You will have seen the atmel studio file mapping window open when you first opened the .elf for debug. It is a strange window because often the source files it is unable to locate are located correctly lower down in the list. In that case you can copy the path and add a \ then atmel should automatically complete the file name for you.

Generally the sources are only in a few places so once you have configured the locations and saved the project you should not need to change it that much in future.

Something else to look at that might help you.... We have only just started to copy the .elf/.hex build files to the /debug /release folders in the last version and have done limited testing. You might find it easier to switch on "tools>options>visual micro>compiler>show build folder". This will give you a link to the real temp build folder where all the .h/cpp files used to actually build the .elf are stored. The .ino will be there as a [sketchname].cpp, in-fact the [sketchname].cpp will be a combination of all .ino files contained in the arduino sketch. 

This build system is how the arduino ide works, we are working on allowing an optional more "native atmel" compile in future versions but there have been so many arduino ide changes recently we have to give them dev priority.

I hope all this helps a bit
« Last Edit: Mar 12th, 2014 at 9:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Henk Visser
Newbies
*
Offline


Posts: 2
Joined: Mar 12th, 2014
Re: File>Open object file for debugging - Atmel Studio
Reply #2 - Mar 12th, 2014 at 9:54pm
Print Post  
Tim,

Thank you for the response.

1.) I have tried the ""open the object file for debugging".  Now when I click to start debugging I get the error "ISP on JTAGICE mkII () does not support debugging. Device is only programmed. Use start without debugging to avoid this message."


2.)
Looking at the output build files here is what I see:
 
core.a 

*.cpp files (Yes, I do see the [sketch_name].cpp in there)

*.h files

*.d files

*.eep file

*.elf

*.hex

*.o files

And 3 subfolders that contain *.d and *.o files.

3.) To get things moving forward without a cleaner solution should I then just be able t pull in the .cpp and header files and compile? Something looks fishy with the core.a file. Smiley

Thank you Tim!

-Henk

« Last Edit: Mar 12th, 2014 at 10:00pm by Henk Visser »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12136
Location: United Kingdom
Joined: Apr 10th, 2010
Re: File>Open object file for debugging - Atmel Studio
Reply #3 - Mar 12th, 2014 at 10:06pm
Print Post  
Quote:
1.) I have tried the ""open the object file for debugging".  Now when I click to start debugging I get the error "ISP on JTAGICE mkII () does not support debugging. Device is only programmed. Use start without debugging to avoid this message."


Out of interest. How did you upload the program? Using Visual Micro Atmel programmer?

a. You have to set "debug wire" in the "project properties dialog"?
b. Did you hack the reset pin on your Arduino? 
c. Which board are you using?

Quote:
To get things moving forward without a cleaner solution should I then just be able t pull in the .cpp and header files and compile


If you have the skill to configure an atmel solution to handle the compile and you are working on just one or two projects then that would be a good solution.

Otherwise you have to use Visual Micro which will give you an automatic Arduino compatible compile (for now).

If you use Visual Micro for the build, you can keep the debug solution open. Atmel will auto detect the changes to the .elf and the mappings dialog is always available by right clicking the debug project in the solution explorer.

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint