Hi,
Thanks for all the great info. I think I have answers to all the questions along with links to new visual micro release at the end of this message ...
1)
VS is nicer in many respects but the GDB and sim are not available for avr boards so easily. So atmel wins for you with your requirements and VS will be a time waster for you.
2)
Atmel studio has two different .vcproj project file types. One for 8bit and one for 32bit.
If you have a 32bit project and attempt to use an 8bit arduino board visual micro sets the atmel project device>mcu to a SAM board.
If you have an 8bit project and attempt to set a not avr mcu visual micro sets the atmel project device>mcu to mega2560.
Those defaults are because atmel will crash if we set an invalid mcu for the type of project we have. (It's easier in visual studio because it just has one c++ project type however VS does not know about the hardware so it's a trade off)
3)
When you use Visual Micro menu items such as "File>New>Arduino Project" and "File>Open>Arduino Project" Visual Micro inspects the currently selected arduino board and creates either an 8bit project (.cppproj) or a 32 bit project (.cccproj).
Visual Micro assumes 32bit for any mcu type it does not know and did not until today's release properly cater for Attiny. Therefore you ended up with a 32 bit project and keep seeing the SAM device selected in the atmel project properties.
This is where most of the confusion has come from for you. Sorry about that.
4)
Creating an 8bit project can be done in many ways. The .ccpproj file name simply has to match the folder and a .ino file name for visual micro to be happy.
However,
with the new release of visual micro you can delete the project_name.cpproj then open atmel studio and click "file>open>arduino project" and open the project_name.ino. This will create an 8bit project and your sources should be auto automatically re-included in the new project.
5)
When you have a valid 8 bit project you are ready to configure upload/start to use the atmel project device...
- Set the "vMicro>Uploader>Programmer" to "Atmel Device Programming"
- Check the "vMicro>Uploader>Use Programmer for Upload" menu
When you attempt to "Debug>Start" (or upload) Atmel will be in control and might open the device programming dialog, click cancel if using the sim or use the device programming tools as documented for your board.
That should be upload working okay.
6)
Now we want to switch from Visual Micro serial debug to Atmel hardware debug.
- Check the "vMicro>Debugger>Atmel Studio Debugging" menu item.
- Add a source code file called "Project_Name".cpp to your project.
- Move all the code from .ino source files into a "Project_Name".cpp (atmel debug does not like .ino files)
- To the top of the project_name.cpp add an #include <arduino.h>
- In the project_name.cpp, if you have any methods other than setup() and loop() then optionally add prototypes.
note: The .ino file must remain, can be empty, is ignored by the compiler when you have a .cpp of the same name in the project folder.
tip: If you add libaries to your .cpp project visual micro will add example #includes into the .ino file for reference only. The above steps will give you upload and debug but debug symbols might be missing.
7)
Visual Micro does copy the .elf to the location atmel is expecting but the atmel solution explorer isn't so good at showing it (refreshing)
All we might need to do it set optimization to debug
- Click "vMicro>Project Properties" and add the -Og switch to general (current configuration)>extra flags
8)
The latest release has been posted to the atmel gallery for approval that can take a few days.
You can download and install the same version using one of the following two links. There are two links because Microsoft screwed up the installer for the vs shell that atmel uses. So depending on which microsoft ide you installed last one of the installs should find atmel studio 7 and prompt you to install visual micro.
Normally, installing from inside atmel studio "tools>extensions and updates" uses the older microsoft installer which is why the download has "InsideIDE" in the name.
Older installer normally inside ide (VM ver 1801.28) Outide ide when VS has been installed after atmel studio (VM ver 1801.28) I have bo comment about that one!!
Summary With the update and the above points I hope you find things a bit smoother.