Arduino Zero: how do I compile from within Atmel Studio?

I recently bought an Arduino Zero: the arduino.cc version. I am able to debug the Zero via Atmel Studio using the following method:

  • Verify and Upload the project sketch by using the Arduino 1.6.7 IDE.
  • Open Atmel Studio and select File > Open Object File for Debugging.
  • Select the .elf file that was created after uploading the sketch in Arduino 1.6.7 IDE.
  • Start debugging in Atmel Studio.

The above technique works fine, but what I really want to do is eliminate the need to compile from Arduino 1.6.7 IDE. This would allow me to set Optimizations and other Toolchain options which are unavailable when debugging from an object file.

Does anyone know how I can compile all of the Arduino Zero code from within Atmel Studio? I tried using the Create project from Arduino Sketch option in File > New Project, but there is no option for Arduino Zero in the board selection list.

Can I bring all of the Arduino files into a blank project and then compile it that way?

Any help is greatly appreciated! I've been struggling with finding information on Zero since it is such a new board.

I had exactly the same goal and I faced the same annoying issue regarding that our Zero board is not available in the Atmel studio "new project" assistant.

However It is possible to setup Atmel Studio to use the same Toolchain than Arduino IDE, I saw some videos in Youtube, but they were using older versions of Atmel Studio (6.2 for example) or the Arduino One board. Some examples:
https://www.youtube.com/watch?v=EeDlN-07cMA&list=UUNNLL5gqyn0_8OEAKS8zzuQ

But the easiest way to compile Arduino sketches for our Zero is using the Arduino Visual Micro plugin
http://www.visualmicro.com/page/Arduino-for-Atmel-Studio.aspx

Just keep in mind that this plugin is using the Arduino Toolchain inside the Atmel Studio environment, I mean it will not work if you donĀ“t have the Arduino IDE environemnt installed.

And now I hate the Atmel Studio environment, it is so slow and massive...

And now I hate the Atmel Studio environment, it is so slow and massive...

I know what you mean, but there is a cure for it! Atmel Studio is built on top of Microsoft's Visual Studio which uses the Windows Registry to connect the parts. And Atmel followed the paradigm as they added features in order to support all of their products in a single framework.

This being said, the cure is to use a solid state drive to store Atmel Studio, Windows, and its registry. Also use enough RAM, 8GB is a nice number, so that Windows can cache whatever it wants. SSD prices are so low these days, around $70 for 256GB, and the old mechanical drives make nice paperweights.

Another difficulty with Atmel Studio is the large number of features complicate the learning cycle, and Atmel followed Microsoft's lead. But it's just a learning cycle! If you want something simple stick with the Arduino IDE.