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
Unable to open source file to add breakpoints (Read 3158 times)
Bohemie
Newbies
*
Offline



Posts: 4
Unable to open source file to add breakpoints
Apr 20th, 2017 at 11:53pm
 
I've been able to compile & upload an existing Arduino sketch.  I want to open one of the source files to add breakpoints but I get this error message:

   object reference not set to an instance of an object

I get this on all the source files except for the .ino

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



Posts: 10529
United Kingdom
Re: Unable to open source file to add breakpoints
Reply #1 - Apr 21st, 2017 at 8:39pm
 
Hi,

Please confirm the following:-

1. which version of atmel studio
2. after the error does a code file open at all?
3. close the project and create a new standard atmel gcc application project (not arduino). can you open the code file(s) in the new project?
4. please supply screen shot of the ide with a project open and the error on screen

Thanks

Back to top
 
WWW  
IP Logged
 
Bohemie
Newbies
*
Offline



Posts: 4
Re: Unable to open source file to add breakpoints
Reply #2 - Apr 21st, 2017 at 10:21pm
 
Atmel Studio 7  version 7.0.1417
Arduino IDE for Atmel Studio 7   version 1704.3.0

The only file I can open is the .ino

I've created an Arduino project (not one from Arduino IDE for Atmel Studio 7) and I can open/edit source files in that one.

I've deleted all my Arduino IDE for Atmel Studio 7 projects.  I decided the debugging capabilities were not what I needed.

Please close this thread. No sense in using your time coming up with a solution that I won't be using.

Thanks

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



Posts: 10529
United Kingdom
Re: Unable to open source file to add breakpoints
Reply #3 - Apr 21st, 2017 at 11:35pm
 
Sounds like the cpp files in your project are mapped to the wrong location. The is a small icon on the solution explorer to switch between the two different file views of any atmel project. Is it possible the files don't exist? did you check the path of the file(s) in the F4 properties.

Visual Micro offers the simple udb debugger and also integrates with the atmel studio hardware debuggers if you have one. Take a look at the atmel7 page on visualmicro.com to see how to combine arduino with atmel device (hardware) programming. It does sound like you need the hardware debugging which allows live expression watch and update, stack trace etc Smiley
Back to top
« Last Edit: Apr 21st, 2017 at 11:36pm by Visual Micro »  
WWW  
IP Logged
 
Bohemie
Newbies
*
Offline



Posts: 4
Re: Unable to open source file to add breakpoints
Reply #4 - Apr 23rd, 2017 at 2:57am
 
Turns out I've been using this package all along. 

I finally figured out where to add my source files.

I just bought a hobbyist license. 

Still need to figure out how to do stack tracing and how to use my Arduino environment (especially the compiler) rather than the Studio 7 setup.  Off to search the documentation & the forums.  Smiley
Back to top
« Last Edit: Apr 23rd, 2017 at 2:57am by Bohemie »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10529
United Kingdom
Re: Unable to open source file to add breakpoints
Reply #5 - Apr 23rd, 2017 at 10:18am
 
Thanks  Smiley

If you have an .ino file in your project then you are using visual micro for build and upload. Atmel studio does not compile projects that contain arduino .ino files.

What I think you need to do is to look at how to use the atmel environment to upload and debug. The other way around than you thought.

Take a looks at the AS7 page which shows how to selected the "vMicro>Uploader>Programmer>Use atmel studio device programming" and make sure you tick "always use for upload" which is just below the programmers selection.

The atmel device programming allows you to use a hardware programmer instead of normal arduino serial/usb upload.

Regardless of the type of upload you choose you have the option to use the visual micro serial/usb debugger or a real hardware debugger. Only a hardware debugger will give stack trace and more debug functionality. To use a hardware debugger tick the "vMicro>Debugger>Use atmel studio debugger".

These two options give you seamless combinations of arduino or arduino and atmel. Best of both worlds! Except normally users are expected to either know arduino or know atmel studio. So it's going to be a bit confusing for you at first.

To be clear, if you have a project with an .ino file you are using arduino and you will also be using visual micro. After that you have the flexibility to choose between using visualmicro/arduino or atmel for upload and visualmicro or atmel for debug.

If you choose the atmel upload or debug methods you will then need to refer to the atmel documentation because, after build, visual micro hands over entirely to atmel as if using a real atmel project.

http://www.visualmicro.com/page/Arduino-for-Atmel-Studio-7.aspx
Back to top
« Last Edit: Apr 23rd, 2017 at 10:23am by Visual Micro »  
WWW  
IP Logged
 
Bohemie
Newbies
*
Offline



Posts: 4
Re: Unable to open source file to add breakpoints
Reply #6 - Apr 23rd, 2017 at 11:05am
 
There's an option to Configure the IDE.  No matter what I put in the path, the compiler that's used is the one in the Studio 7 directory structure.  I've tried closing & restarting Studio 7 & re-booting my PC with no luck.

The Studio 7 compile messages are saying avr-gcc 5.4 while the compiler window in my Arduino 1.8.1 says 4.9.2.

I may be fighting a compiler issue or a compiler option issue so I want to use the 1.8.1 tools and debug with Studio 7.


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



Posts: 10529
United Kingdom
Re: Unable to open source file to add breakpoints
Reply #7 - Apr 23rd, 2017 at 11:20am
 
The arduino rules are as follows:-

1) The folder name and an .ino name must be the same
2) The project must be in the same folder and have the same name

If these rules do not apply then Visual Micro will go to sleep. You might find it more obvious if you toggle the visual micro commands on the "Window" menu. These will cause the arduino tools bars to only be visible when the rules are adhered to.

I suggest you close your project and follow the getting started guide in the visual micro documentation or create a small project using the arduino ide. It is important for you to understand what an arduino project is before you attempt to use any atmel specific features.

The getting started guide is here. Create a project using the visual micro new project features and upload it to your board. Do not add any .cpp files to your project until you see how a project works without .cpp, a simple arduino project with one or more .ino files. I suggest this because as7 can not play a part or confuse in this type of project.

http://www.visualmicro.com/page/User-Guide.aspx?doc=index


ps: Visual Micro creates arduino compatible projects and also combines some atmel upload/debug/intellisense features. It does not bring arduino to raw atmel projects. Arduino has it's own main.cpp outside of your normal project code defined within the tool chain. Atmel projects have their own main.cpp. Arduino defines serial ports, pins etc. In atmel projects you define your own. The two types of projects are very different. Visual micro only works with arduino style projects and that should hopefully make sense to you once you get your head around the difference between the two products arduino and atmel studio.

Back to top
« Last Edit: Apr 23rd, 2017 at 11:25am by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print